Memory MCP
A knowledge-graph-based memory system for AI agents that enables persistent information storage between conversations.
Features
- Persistent memory storage using a knowledge graph structure
- Entity-relation model for organizing information
- Tools for adding, searching, and retrieving memories
The system provides the following MCP tools:
load_knowledge_graph()
: Retrieves the entire knowledge graphadd_entities(entities)
: Adds new entities to the memoryadd_relations(relations)
: Creates relationships between entitiesadd_observations(entity_name, observations)
: Adds observations to existing entitiesdelete_entities(entity_names)
: Removes entities from memorydelete_relations(relations)
: Removes relationshipssearch_nodes(query)
: Searches for entities and relations matching a queryopen_nodes(names)
: Retrieves specific entities and their relationships
Usage
Run the agent with:
The agent will automatically:
- Load its memory at the start of conversations
- Reference relevant information during interactions
- Update its memory with new information when the conversation ends
Exit a conversation by typing q
.
Configuration
Set the memory storage location with the MEMORY_FILE_PATH
environment variable (defaults to memory.json
).