Megamemory Knowledge Graph
Persistent project knowledge graph for coding agents. MCP server with semantic search, in-process embeddings, and web explorer.
What is Megamemory Knowledge Graph?
Megamemory Knowledge Graph is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to persistent project knowledge graph for coding agents. mcp server with semantic search, in-process embeddings, and web explorer.
Persistent project knowledge graph for coding agents. MCP server with semantic search, in-process embeddings, and web explorer.
This server falls under the Knowledge & Memory category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Persistent project knowledge graph for coding agents. MCP se
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx megamemoryConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Megamemory Knowledge Graph
MegaMemory is a persistent knowledge graph MCP server designed to give coding agents long-term memory across sessions. It stores concepts, decisions, patterns, and relationships in a local SQLite database with in-process semantic embeddings (~23 MB model, no external API required), enabling agents to query what they already know before doing redundant work. Developers use it with Claude Code, Cursor, Codex, and other agentic coding tools to build up a shared understanding of a codebase that persists between conversations.
Prerequisites
- Node.js 18 or higher installed
- An MCP-compatible coding agent client (Claude Code, Cursor, Codex, OpenCode, or any stdio MCP client)
- Disk space for the embedding model (~23 MB, downloaded automatically on first use)
- Write access to the project directory (the knowledge database defaults to .megamemory/knowledge.db)
Install MegaMemory globally
Install the package globally with npm so the megamemory command is available for the installer and for running the web explorer.
npm install -g megamemoryRun the automatic installer
The install command detects your coding environment and adds MegaMemory as an MCP server. Pass --target to specify a particular client.
megamemory install
# Or target a specific client:
megamemory install --target claudecodeConfigure manually for other MCP clients
For MCP clients not detected automatically, add MegaMemory as a stdio server in your client's MCP configuration file.
{
"mcpServers": {
"megamemory": {
"command": "megamemory",
"args": [],
"env": {}
}
}
}Initialize the knowledge graph in your project
Open your coding agent in a project directory. The first tool call will create the .megamemory/knowledge.db file automatically. The embedding model downloads on first use.
(Optional) Change the database location
By default the database lives in .megamemory/knowledge.db relative to the working directory. Override with an environment variable to use a shared or absolute path.
export MEGAMEMORY_DB_PATH=/path/to/shared/knowledge.db(Optional) Launch the web explorer
MegaMemory includes a local web UI to browse and inspect the knowledge graph visually.
megamemory serve
# or on a custom port:
megamemory serve --port 8080Megamemory Knowledge Graph Examples
Client configuration (Claude Code / stdio)
MCP configuration block to add MegaMemory to Claude Code or any stdio-based MCP client.
{
"mcpServers": {
"megamemory": {
"command": "megamemory",
"args": [],
"env": {
"MEGAMEMORY_DB_PATH": ".megamemory/knowledge.db"
}
}
}
}Prompts to try
Example prompts that let the agent use MegaMemory's knowledge graph tools.
- "Before writing any code, check what you already know about the authentication module."
- "Add what you just learned about the payment service to your memory."
- "What decisions have been recorded about the database schema?"
- "List all top-level concepts you know about this project."
- "Create a relationship between the AuthService and the TokenValidator concepts."Troubleshooting Megamemory Knowledge Graph
Embedding model fails to download on first use
Ensure you have an internet connection on first run. The ~23 MB model is fetched automatically. If behind a proxy, set the HTTPS_PROXY environment variable.
Knowledge graph not persisting between sessions
Check that MEGAMEMORY_DB_PATH points to a stable location and is not inside a temp directory. Verify the .megamemory/ folder has write permissions.
megamemory command not found after install
Run 'npm install -g megamemory' and ensure your npm global bin directory is in PATH. Check with 'npm bin -g' and add it to your shell profile if missing.
Frequently Asked Questions about Megamemory Knowledge Graph
What is Megamemory Knowledge Graph?
Megamemory Knowledge Graph is a Model Context Protocol (MCP) server that persistent project knowledge graph for coding agents. mcp server with semantic search, in-process embeddings, and web explorer. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Megamemory Knowledge Graph?
Follow the installation instructions on the Megamemory Knowledge Graph GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Megamemory Knowledge Graph?
Megamemory Knowledge Graph works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Megamemory Knowledge Graph free to use?
Yes, Megamemory Knowledge Graph is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Megamemory Knowledge Graph Alternatives — Similar Knowledge & Memory Servers
Looking for alternatives to Megamemory Knowledge Graph? Here are other popular knowledge & memory servers you can use with Claude, Cursor, and VS Code.
MemPalace
★ 52.6kA local AI memory system that stores all conversations verbatim and organizes them into navigable structures. It provides 19 MCP tools for AI assistants to search and retrieve past decisions, debugging sessions, and architecture debates automatically
Kratos
★ 25.7k🏛️ Memory System for AI Coding Tools - Never explain your codebase again. MCP server with perfect project isolation, 95.8% context accuracy, and the Four Pillars Framework.
Context Mode
★ 15.4kAn MCP server that preserves LLM context by intercepting large data outputs and returning only concise summaries or relevant sections. It enables efficient sandboxed code execution, file processing, and documentation indexing across multiple programm
Memu
★ 13.7kMemory for 24/7 proactive agents like OpenClaw.
MemOS
★ 9.3kMemOS (Memory Operating System) is a memory management operating system designed for AI applications. Its goal is: to enable your AI system to have long-term memory like a human, not only remembering what users have said but also actively invoking, u
Everos
★ 5.4kBuild, evaluate, and integrate long-term memory for self-evolving agents.
Browse More Knowledge & Memory MCP Servers
Explore all knowledge & memory servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Megamemory Knowledge Graph in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Megamemory Knowledge Graph?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.