Overview
Knowledge graph-based persistent memory system for AI agents across sessions.
Setup
Run with npx:
npx -y @modelcontextprotocol/server-memoryConfiguration
Added to claude_desktop_config.jsonDocumentation
Memory MCP Server
Overview
The Memory MCP Server provides AI agents with a knowledge graph-based persistent memory system. It allows agents to store, retrieve, and reason about information across sessions, creating a long-term memory that persists beyond individual conversations.
This is particularly valuable for AI assistants that need to remember user preferences, project context, or important facts over extended periods of time.
Features
- Knowledge Graph Storage: Information is stored as a graph of entities and relationships, enabling semantic reasoning.
- Persistent Across Sessions: Memory survives between agent sessions and restarts.
- Semantic Search: Find relevant memories based on natural language queries.
- Contextual Retrieval: Returns memories in context, helping agents make connections between related information.
- Entity Linking: Automatically links related pieces of information together.
Installation
# Run via npx (recommended for MCP)
npx -y @modelcontextprotocol/server-memory
Configuration
To use the Memory MCP server, add it to your claude_desktop_config.json:
{
"mcpServers": {
"memory": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-memory"
]
}
}
}
Available Tools
| Tool | Description |
|---|---|
memory_add | Add a new memory entry to the knowledge graph. |
memory_search | Search for relevant memories based on a query. |
memory_delete | Delete a specific memory entry. |
memory_list | List all stored memories. |
memory_clear | Clear all stored memories. |
Usage Examples
Remembering User Preferences
The agent can use memory_add to store that the user prefers Python for data analysis, and memory_search to retrieve this preference when the user asks for coding recommendations.
Project Context
The agent can build a knowledge graph of a project's architecture, key decisions, and important files, allowing it to maintain context across multiple coding sessions.
Pros
- ✅ True Persistence: Memory survives beyond individual sessions.
- ✅ Semantic Reasoning: Knowledge graph enables finding related information.
- ✅ Structured Storage: Entities and relationships are explicitly modeled.
Cons
- ❌ Additional Dependency: Requires a separate MCP server to be running.
- ❌ Storage Limits: Knowledge graphs can grow large and may need pruning.
- ❌ Query Complexity: Finding the right memory can be challenging with large datasets.
Resources
- MCP Official Servers: https://github.com/modelcontextprotocol/servers
