A Model Context Protocol (MCP) server implementation for Graphiti memory graphs. This server allows language models to interact with knowledge graphs, search memories, and explore relationships through a standardized interface.
- Hybrid Memory Search: Combines semantic similarity and BM25 retrieval with Reciprocal Rank Fusion reranking
- Advanced Filtered Search: Comprehensive search with filtering, reranking, and BFS capabilities
- Recent Context Search: Context-aware search within recent conversations
- Node Management: Find, explore, and get detailed information about nodes in the knowledge graph
- User and Group Support: Search within specific user graphs or group graphs
- Episode Management: Access detailed episode information from the knowledge graph
- Casefile Integration: Get casefile indexes and specific pages
- Seamless MCP Integration: Works with Claude Desktop and other AI tools supporting MCP
The easiest way to use this package is through npx:
npx graph-memory-mcp-server
To use with Claude Desktop:
- Open Claude Desktop
- Enable the MCP feature in settings
- Add the server configuration to your
claude_desktop_config.json
:{ "mcpServers": { "graphiti-memory": { "command": "npx", "args": [ "-y", "graph-memory-mcp-server@latest", "--zep-api-key", "YOUR_ZEP_API_KEY", "--mongo-uri", "mongodb://username:password@host:port/database", "--db-name", "your-database-name" ] } } }
- Restart Claude Desktop
- Ask Claude to search memories, explore knowledge graphs, and analyze relationships
You can install the package globally using:
npm install -g graph-memory-mcp-server
Then run:
graph-memory-mcp-server
- Clone this repository
- Install dependencies:
npm install
- Build the TypeScript code:
npm run build
- Start the server:
node dist/index.js
This server implements the Model Context Protocol, allowing language models to:
- Search and explore memory graphs using various strategies
- Find specific nodes and relationships in knowledge graphs
- Access detailed information about entities and their connections
- Navigate user-specific and group-specific knowledge graphs
- Retrieve episode and casefile information
The server provides a streamlined set of tools organized by functionality:
-
hybrid_memory_search
: Simple, general-purpose search combining semantic similarity and BM25 retrieval with RRF reranking. Use this for broad exploration of memories. -
search_with_filters
: [ENHANCED] Advanced search with comprehensive filtering and reranking options. This tool can handle all search scenarios:- Basic filtered search by entity/edge types
- Focused search around specific nodes (replaces
focused_memory_search
) - BFS search from origin nodes (replaces
search_with_bfs
) - All reranking methods (RRF, MMR, node distance, episode mentions, cross encoder)
-
search_recent_context
: [NEW] Context-aware search within recent conversations. Ideal for "What issues need addressing today?" queries. Can also accept custom origin UUIDs for BFS-style searches.
-
find_memory_nodes
: Discover nodes by name, type, or properties. Essential for getting node UUIDs. -
get_memory_node_details
: Get comprehensive information about a specific node including relationships. -
get_user_nodes
: List all nodes associated with a specific user.
-
get_episode
: Get detailed information about a specific episode by UUID. -
get_recent_episodes
: [NEW] Retrieve recent episodes/messages with role filtering.
-
get_users
: List all users in the system with pagination. -
get_casefile_index
&get_casefile_pages
: Browse and read casefile content.
The following tools have been removed in favor of more flexible alternatives:
Old:
{
"tool": "focused_memory_search",
"arguments": {
"query": "recent projects",
"focal_node_uuid": "node-uuid-12345",
"user_id": "user123"
}
}
New:
{
"tool": "search_with_filters",
"arguments": {
"query": "recent projects",
"reranker": "node_distance",
"focal_node_uuid": "node-uuid-12345",
"user_id": "user123"
}
}
Old:
{
"tool": "advanced_memory_search",
"arguments": {
"query": "machine learning applications",
"search_recipe": "EDGE_HYBRID_SEARCH_NODE_DISTANCE",
"focal_node_uuid": "node-uuid-67890",
"user_id": "user123"
}
}
New:
{
"tool": "search_with_filters",
"arguments": {
"query": "machine learning applications",
"scope": "edges",
"reranker": "node_distance",
"focal_node_uuid": "node-uuid-67890",
"user_id": "user123"
}
}
Old:
{
"tool": "search_with_bfs",
"arguments": {
"query": "deployment issues",
"bfs_origin_node_uuids": ["uuid1", "uuid2", "uuid3"],
"user_id": "user123"
}
}
New Option 1 - Using search_with_filters:
{
"tool": "search_with_filters",
"arguments": {
"query": "deployment issues",
"bfs_origin_node_uuids": ["uuid1", "uuid2", "uuid3"],
"user_id": "user123"
}
}
New Option 2 - Using search_recent_context:
{
"tool": "search_recent_context",
"arguments": {
"query": "deployment issues",
"custom_origin_uuids": ["uuid1", "uuid2", "uuid3"],
"user_id": "user123"
}
}
// Simple search for general exploration
{
"tool": "hybrid_memory_search",
"arguments": {
"query": "artificial intelligence research",
"limit": 10,
"user_id": "user123"
}
}
// Search with entity filtering and MMR reranking
{
"tool": "search_with_filters",
"arguments": {
"query": "software projects",
"node_labels": ["Project", "Repository"],
"reranker": "mmr",
"mmr_lambda": 0.7,
"limit": 15,
"user_id": "user123"
}
}
// Find issues that need attention today
{
"tool": "search_recent_context",
"arguments": {
"query": "issues to address today",
"lastn": 30,
"only_user_episodes": true,
"user_id": "user123"
}
}
// Find nodes related to a person
{
"tool": "find_memory_nodes",
"arguments": {
"search_term": "John Smith",
"node_type": "Person",
"user_id": "user123"
}
}
// Get detailed information about a specific node
{
"tool": "get_memory_node_details",
"arguments": {
"node_uuid": "found-node-uuid",
"include_relationships": true,
"relationship_depth": 2
}
}
This server is built on:
- Graphiti: Knowledge graph and memory management
- Model Context Protocol (MCP): Standardized AI tool integration
- TypeScript: Type-safe development
- Hybrid Search: Combining multiple search and ranking strategies
For development, you can run the server directly using ts-node:
npm run dev
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
Graphiti is a powerful knowledge graph and memory management system that enables AI applications to build, maintain, and query complex knowledge representations. This MCP server provides a bridge between Graphiti's capabilities and AI language models through standardized tool interfaces.