Megamemory Knowledge Graph

v1.0.0Knowledge & Memorystable

Persistent project knowledge graph for coding agents. MCP server with semantic search, in-process embeddings, and web explorer.

agentic-codingaiai-agentsclaude-codecode-context
Share:
170
Stars
0
Downloads
0
Weekly
0/5

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

Persistent project knowledge
Semantic search over codebase
In-process embeddings
0xK3vin

Maintainer

LicenseMIT
Languagetypescript
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx megamemory

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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)
1

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 megamemory
2

Run 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 claudecode
3

Configure 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": {}
    }
  }
}
4

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.

5

(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
6

(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 8080

Megamemory 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.

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.

Quick Config Preview

{ "mcpServers": { "megamemory": { "command": "npx", "args": ["-y", "megamemory"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides