MegaMemory

Memory and knowledgeDeveloper tools

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

Your AI app calls the MegaMemory MCP server, which does the memory and knowledge and developer tools work and sends the result back to the chat.

About MegaMemory

MegaMemory is a community MCP server from 0xK3vin, filed in our directory under memory and knowledge and developer tools. Persistent project knowledge graph for coding agents. MCP server with semantic search, in-process embeddings, and web explorer.

At a glance

Publisher
0xK3vin (community)
Runs
See the README for setup
Written in
TypeScript
License
MIT
GitHub stars
906

How to set up MegaMemory

  1. Follow the install steps in the MegaMemory README; it is written in TypeScript, so have that toolchain ready.
  2. Check the MegaMemory README for keys or settings; the registry lists none that MegaMemory requires.
  3. Add MegaMemory to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the MegaMemory tools to confirm the connection.
  5. Run one read-only task with MegaMemory first, and keep your app asking before each tool call until the results look right.

MegaMemory compared with similar servers

  • Projectmem by riponcm has fewer GitHub stars than MegaMemory (886 against 906); both are community servers, and both run locally.
  • Memory Bank by alioshr has more GitHub stars than MegaMemory (926 against 906); both are community servers, and both run locally.
  • Knowledge Graph by shaneholloman has fewer GitHub stars than MegaMemory (885 against 906); both are community servers, and both run locally.

Before you connect MegaMemory

  • Give MegaMemory its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each MegaMemory tool call until you trust what it does with them.
  • Treat text that MegaMemory fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for MegaMemory on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for MegaMemory

How marketing and sales teams put MegaMemory to work, by company size. Pick the size closest to yours and start MegaMemory on one use case.

Small business

  • A small business can give MegaMemory its offers, FAQs and tone of voice once, so every draft starts from the same facts.
  • Founders can use MegaMemory to keep notes from calls and decisions, then ask what was agreed with a customer weeks later.
  • A small business with a developer can use MegaMemory to ship site and tracking fixes faster, with the AI reading the code it changes.
  • MegaMemory runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing teams can connect MegaMemory to positioning docs and past campaigns, so agents write on message without a long prompt each time.
  • Sales and marketing can share one knowledge base through MegaMemory, so answers about pricing and features match across teams.
  • Growth engineers can use MegaMemory to build landing pages, tracking and integrations in fewer cycles, with reviews kept in the normal flow.
  • Start MegaMemory on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises can use MegaMemory with permissions that follow the source documents, so an agent only recalls what the person asking may see.
  • Large orgs can make MegaMemory the approved memory layer for agents, with retention rules and a way to delete what shouldn't be kept.
  • Enterprise engineering teams can roll out MegaMemory with repo scopes and audit logs, so agents work only where they are allowed.
  • MegaMemory is a community server, so have security review the code and pin a version before MegaMemory touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

MegaMemory README

From 0xK3vin/MegaMemory on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

MegaMemory

Persistent project knowledge graph for coding agents.

An MCP server that lets your coding agent build and query a graph of concepts, architecture, and decisions, so it remembers across sessions.

The LLM is the indexer. No AST parsing. No static analysis. Your agent reads code, writes concepts in its own words, and queries them before future tasks. The graph stores concepts, features, modules, patterns, decisions, not code symbols.

The Loop

understand → work → update

  1. Session start, agent calls list_roots to orient itself
  2. Before a task, agent calls understand with a natural language query (or get_concept for exact ID lookup)
  3. After a task, agent calls create_concept or update_concept to record what it built

Everything persists in a per-project SQLite database at .megamemory/knowledge.db.

Installation
npm install -g megamemory

[!NOTE] Requires Node.js >= 18. The embedding model (~23MB) downloads automatically on first use.

Quick Start
megamemory install

Run the interactive installer and choose your editor:

[!NOTE] The installer only updates config files after a successful read/merge, and it will not overwrite existing plugin/command files unless they are already marked as MegaMemory-managed.

With opencode
megamemory install --target opencode

One command configures:

  • MCP server in ~/.config/opencode/opencode.json
  • Workflow instructions in ~/.config/opencode/AGENTS.md
  • Skill tool plugin at ~/.config/opencode/tool/megamemory.ts
  • Bootstrap command /user:bootstrap-memory for initial graph population
  • Save command /user:save-memory to persist session knowledge

Restart opencode after running install.

With Claude Code
megamemory install --target claudecode

Configures:

  • MCP server in ~/.claude.json
  • Workflow instructions in ~/.claude/CLAUDE.md
  • Commands in ~/.claude/commands/
With Antigravity
megamemory install --target antigravity

Configures:

  • MCP server in ./mcp_config.json (workspace-level)
With Codex
megamemory install --target codex

Configures:

  • MCP server in ~/.codex/config.toml
  • Workflow instructions in ~/.codex/AGENTS.md
With other MCP clients

Add megamemory as a stdio MCP server. The command is just megamemory (no arguments). It reads/writes .megamemory/knowledge.db relative to the working directory, or set MEGAMEMORY_DB_PATH to override.

{
  "megamemory": {
    "type": "local",
    "command": ["megamemory"],
    "enabled": true
  }
}
MCP Tools
Tool Description
understand Semantic search over the knowledge graph. Returns matched concepts with children, edges, and parent context.
get_concept Look up a concept by its exact ID. Returns full context including children, edges, incoming edges, and parent.
create_concept Add a new concept with optional edges and file references.
update_concept Update fields on an existing concept. Regenerates embeddings automatically.
link Create a typed relationship between two concepts.
remove_concept Soft-delete a concept with a reason. History preserved.
list_roots List all top-level concepts with direct children.
list_conflicts List unresolved merge conflicts grouped by merge group.
resolve_conflict Resolve a merge conflict by providing verified, correct content based on the current codebase.

Concept kinds: feature · module · pattern · config · decision · component

Relationship types: connects_to · depends_on · implements · calls · configured_by

Knowledge Graph
Web Explorer

Visualize the knowledge graph in your browser:

megamemory serve
  • Nodes are colored by kind and sized by edge count
  • Dashed edges show parent-child links; solid edges show relationships
  • Click any node to inspect summary, files, and edges
  • Search supports highlight/dim filtering
  • If port 4321 is taken, you'll be prompted to pick another
megamemory serve --port 8080   # custom port
How It Works
src/
  index.ts       CLI entry + MCP server (9 tools)
  tools.ts       Tool handlers (understand, get_concept, create, update, link, remove, list_conflicts, resolve_conflict)
  db.ts          SQLite persistence (libsql, WAL mode, schema v3)
  embeddings.ts  In-process embeddings (all-MiniLM-L6-v2, 384 dims)
  merge.ts       Two-way merge engine for knowledge.db files
  merge-cli.ts   CLI handlers for merge, conflicts, resolve commands
  types.ts       TypeScript types
  cli-utils.ts   Colored output + interactive prompts
  install.ts     multi-target installer (opencode, Claude Code, Antigravity, Codex)
  web.ts         HTTP server for graph explorer
plugin/
  megamemory.ts  Opencode skill tool plugin
commands/
  bootstrap-memory.md  /user command for initial population
  save-memory.md       /user command to save session knowledge
web/
  index.html     Single-file graph visualization (d3-force + Canvas)
  • Embeddings, In-process via Xenova/all-MiniLM-L6-v2 (ONNX, quantized). No API keys, and no network calls after the first model download.
  • Storage, SQLite with WAL mode, soft-delete history, and schema migrations (currently v3).
  • Search, Brute-force cosine similarity over node embeddings; fast enough for graphs with <10k nodes.
  • Merge, Two-way merge with conflict detection by concept ID, with AI-assisted conflict resolution via MCP tools.
CLI Commands
Command Description
megamemory Start the MCP stdio server
megamemory install Configure editor/agent integration
megamemory serve Launch the web graph explorer
megamemory merge Merge two knowledge.db files
megamemory conflicts List unresolved merge conflicts
megamemory resolve Resolve a merge conflict
megamemory --help Show help
megamemory --version Show version
Merging Knowledge Graphs

When branches diverge, each may update .megamemory/knowledge.db independently. Since SQLite files cannot be auto-merged by git, megamemory provides dedicated merge commands.

Merge two databases
megamemory merge main.db feature.db --into merged.db

Concepts are compared by ID: identical nodes are deduplicated, and conflicting nodes are kept as ::left/::right variants under one merge group UUID. Use --left-label and --right-label to replace default side labels with branch names.

megamemory merge main.db feature.db --into merged.db --left-label main --right-label feature-xyz
View conflicts
megamemory conflicts            # human-readable summary
megamemory conflicts --json     # machine-readable output
megamemory conflicts --db path  # specify database path
Resolve conflicts manually
megamemory resolve <merge-group-uuid> --keep left    # keep the left version
megamemory resolve <merge-group-uuid> --keep right   # keep the right version
megamemory resolve <merge-group-uuid> --keep both    # keep both as separate concepts
AI-assisted resolution

When an AI agent runs /merge, it calls list_conflicts, verifies both versions against current source files, then calls resolve_conflict with resolved: {summary, why?, file_refs?} plus a verification reason. It does not pick a side blindly; it resolves to what the codebase currently reflects.

License

MIT

Questions about MegaMemory

What is the MegaMemory MCP server?

Persistent project knowledge graph for coding agents. MCP server with semantic search, in-process embeddings, and web explorer. MegaMemory is maintained by 0xK3vin on GitHub at 0xK3vin/MegaMemory, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the MegaMemory MCP server?

MegaMemory doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (0xK3vin/MegaMemory). Like most servers, MegaMemory ends with a command or URL you paste into your AI app's MCP config.

Does MegaMemory need an API key?

The registry lists no required keys for MegaMemory. Check the MegaMemory README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is MegaMemory an official MCP server?

No. MegaMemory is a community server maintained by 0xK3vin. Community servers can be excellent; read the code and the open issues before you give MegaMemory access to company data.

What license is MegaMemory under?

MegaMemory is released under the MIT license, according to its GitHub repository. The license covers the code of MegaMemory; the service it connects to has its own terms.