AI Frameworks·
intermediate
·8 min read·Apr 4, 2026How to Use the Memory MCP Server for Persistent AI Knowledge
Give your AI agent persistent memory using the Knowledge Graph MCP server. Store and retrieve information across conversations.
memoryknowledge graphpersistent statecontextlong-term memory
Use the Memory MCP Server for Persistent AI Knowledge
The Memory MCP server (also called Knowledge Graph server) gives AI agents the ability to store and retrieve information across conversations, creating a persistent knowledge base.
Why Persistent Memory?
By default, AI agents forget everything between conversations. The Memory server solves this by:
- ▸Storing facts, preferences, and context as a knowledge graph
- ▸Allowing retrieval of past information in new conversations
- ▸Building a personal knowledge base over time
Configuration
json
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
}
}
}How It Works
The memory server stores information as a knowledge graph with:
- ▸Entities: People, projects, concepts (nodes)
- ▸Relations: Connections between entities (edges)
- ▸Observations: Facts about entities (properties)
Available Tools
| Tool | Description |
|---|---|
code | Add new entities to the graph |
code | Connect entities with relationships |
code | Add facts about entities |
code | Remove entities |
code | Remove specific facts |
code | Remove connections |
code | Read the entire knowledge graph |
code | Search for specific entities |
code | Get details about specific nodes |
Example Usage
Storing Project Context
code
"Remember that Project Alpha is using React and TypeScript, is led by Sarah, and has a deadline of March 15th"Retrieving Information
code
"What do you know about Project Alpha?"Building Relationships
code
"Sarah manages Project Alpha and reports to David. David oversees the Engineering department."Storage Location
By default, the knowledge graph is stored in a local JSON file. You can specify a custom path:
json
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"],
"env": {
"MEMORY_FILE_PATH": "/path/to/memory.json"
}
}
}
}Tips
- ▸Tell the AI to "remember" important information explicitly
- ▸Periodically review the knowledge graph for accuracy
- ▸The knowledge graph works best for structured, factual information
- ▸Combine with other servers for powerful context-aware workflows