Elasticsearch Knowledge Graph for MCP
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Integrations
Uses Elasticsearch as the backend for the knowledge graph, providing distributed, scalable storage for entities and relations with advanced search capabilities
Provides a TypeScript interface to Elasticsearch with all core operations for interacting with the knowledge graph
MCP Memory: Persistent Memory for AI Conversations 🧠
Give your AI a memory that persists across conversations. Never lose important context again.
MCP Memory is a robust, Elasticsearch-backed knowledge graph system that gives AI models persistent memory beyond the limits of their context windows. Built for the Model Context Protocol (MCP), it ensures your LLMs remember important information forever, creating more coherent, personalized, and effective AI conversations.
🌟 Why AI Models Need Persistent Memory
Ever experienced these frustrations with AI assistants?
- Your AI forgetting crucial details from earlier conversations
- Having to repeat the same context every time you start a new chat
- Losing valuable insights once the conversation history fills up
- Inability to reference past work or decisions
MCP Memory solves these problems by creating a structured, searchable memory store that preserves context indefinitely. Your AI can now build meaningful, long-term relationships with users and maintain coherence across days, weeks, or months of interactions.
✨ Key Features
- 📊 Persistent Memory: Store and retrieve information across multiple sessions
- 🔍 Smart Search: Find exactly what you need with powerful Elasticsearch queries
- 📓 Contextual Recall: AI automatically prioritizes relevant information based on the conversation
- 🧩 Relational Understanding: Connect concepts with relationships that mimic human associative memory
- 🔄 Long-term / Short-term Memory: Distinguish between temporary details and important knowledge
- 🗂️ Memory Zones: Organize information into separate domains (projects, clients, topics)
- 🔒 Reliable & Scalable: Built on Elasticsearch for enterprise-grade performance
🚀 5-Minute Setup
Getting started is incredibly simple:
Prerequisites
- Docker: Required for running Elasticsearch (or a local Elasticsearch installation)
- Node.js: Version 18 or higher
- npm: For package management
🔌 Connecting to Claude Desktop
MCP Memory is designed to work seamlessly with Claude Desktop, giving Claude persistent memory across all your conversations:
- Copy and configure the launch script:The repository includes a
launch.example
file that you can simply copy:Make the script executable:CopyCopy - Add the command to Claude Desktop:
- Open Claude Desktop Settings
- Navigate to the "Commands" section
- Click "Add New Command"
- Configure as follows:
- Name: MCP Memory
- Command: /path/to/mcp-servers/memory/launch.sh
- Arguments: Leave empty
- Run in background: Yes
- Show in menu: Yes
- Verify connection:
- Start the command from Claude Desktop
- You should see a notification that Claude is connected to MCP Memory
- Try asking Claude about something you discussed in a previous conversation!
For complete examples and visual guides, see the Claude Desktop MCP Server Setup Guide online.
💡 How It Works
MCP Memory creates a structured knowledge graph where:
- Entities represent people, concepts, projects, or anything worth remembering
- Relations connect entities, creating a network of associations
- Observations capture specific details about entities
- Relevance scoring determines what information to prioritize
When integrated with an LLM, the system automatically:
- Stores new information learned during conversations
- Retrieves relevant context when needed
- Builds connections between related concepts
- Forgets unimportant details while preserving critical knowledge
🛠️ Example: How Agents Use Memory
From the User's Perspective
Conversation 1: Initial Information
Conversation 2: Days or Weeks Later
Conversation 3: After the Birthday
How the Agent Uses Memory
When the user mentions something important, the agent:
- Recognizes important information worth remembering
- Stores it in memory by creating entities, relations, and observations
- Updates existing information when new details emerge
When the user mentions something related to stored information, the agent:
- Searches memory for relevant context based on the current conversation
- Retrieves important details that might be helpful
- Incorporates this information naturally into its responses
This happens automatically - the user simply has a normal conversation with the assistant, and the memory system works behind the scenes to maintain context across sessions.
Intelligent Entity Management
MCP Memory includes smart handling of entity creation and updates:
- When attempting to create an entity that already exists, the system returns the existing entity data with guidance on how to extend it with new information
- The system intelligently differentiates between creating new entities and updating existing ones
- Entity relationships are automatically maintained even when information is updated
🧰 Admin Tools
MCP Memory includes a comprehensive admin CLI for maintaining your knowledge graph:
📚 Advanced Features
Memory Zones
Organize knowledge into separate domains:
Conversational Memory Management
You can also instruct the assistant to organize memories in different zones through natural conversation:
Creating and Using Memory Zones
Retrieving Zone-Specific Information
Switching Between Memory Zones
By organizing memory into separate zones, conversations become more relevant and focused on the current topic or project.
Search Capabilities
Leverage Elasticsearch's powerful search features:
🤝 Contributing
Contributions are welcome! See CONTRIBUTING.md for details.
📝 License
MIT
You must be authenticated.
Provides a scalable knowledge graph implementation for Model Context Protocol using Elasticsearch, enabling AI models to store and query information with advanced search capabilities, memory-like behavior, and multi-zone architecture.
- 🌟 Why AI Models Need Persistent Memory
- ✨ Key Features
- 🚀 5-Minute Setup
- 💡 How It Works
- 🛠️ Example: How Agents Use Memory
- 🧰 Admin Tools
- 📚 Advanced Features
- 🤝 Contributing
- 📝 License