StackMap
Subscribe
Explore / MegaMemory
0xK3vin

MegaMemory

MCP server that lets a coding agent build and query a typed concept graph of the project — SQLite store, in-process embeddings, merge-conflict resolution and a local web graph explorer.

459 41 TypeScript MITupdated 3 months ago
View on GitHubDispute this mapping →
Curator's take

The memory that stores design intent rather than code structure: the agent writes `feature`/`module`/`pattern`/`decision` concepts with typed links, and `understand` does semantic search over them. One npm install, a ~23MB embedding model, `.megamemory/knowledge.db` in the repo, nothing leaves the machine, installers for Claude Code, Codex, OpenCode and Antigravity. Its weakness is inherent: the graph is only as true as the last agent that wrote it — hence the merge/conflict tooling — so treat the DB as regenerable and pair it with an AST-derived index rather than replacing one. Small, single-maintainer project; fine for a repo you own, thin for a fleet.

Mapped by ShipWithAI editors · links verified
README.md

MegaMemory

Persistent project knowledge graph for coding agents.

npm license node npm downloads Twitter Follow

MegaMemory web explorer


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

How MegaMemory works

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

Continue your stack

What teams reach for next — and why each earns a place beside MegaMemory. Ranked by curator confidence.