Field noteDec 2, 20263 min read1 source

MegaMemory: Persistent project knowledge graph for coding agents

In one minute

MegaMemory is an MCP server for building and querying a persistent project knowledge graph for coding agents (github.com). It stores concepts such as features, modules, patterns and decisions rather than code symbols (github.com).

What changed: MegaMemory adds a persistent project knowledge graph MCP server with semantic search, in-process embeddings, and a web explorer for coding agents.

What happened

The documented workflow has the agent read the code and write concepts in its own words; MegaMemory does not build the graph through AST parsing or static analysis (github.com). At session start, call list_roots to orient; before a task, use understand with a natural-language query or get_concept for an exact ID; afterward, use create_concept or update_concept to record what was built (github.com).

The graph lives in a per-project SQLite database at .megamemory/knowledge.db (github.com). The installer supports OpenCode, Claude Code, Antigravity and Codex; other MCP clients can run MegaMemory as a stdio server. Set MEGAMEMORY_DB_PATH to override the database path. The installer updates configuration only after a successful read and merge, and leaves existing plugin or command files alone unless they are marked as MegaMemory-managed (github.com).

understand uses semantic search and returns matched concepts with children, edges and parent context (github.com). Concepts can have typed relationships and optional file references (github.com), while removing a concept is a soft delete that preserves its history. Run megamemory serve to open the browser graph explorer; nodes are colored by kind and sized by edge count, and selecting one shows its summary, files and edges. The embedding model runs in-process, with no API key or network calls after its first download, according to the README.

MegaMemory also offers a two-way database merge that detects conflicts by concept ID (github.com). Identical concepts are deduplicated; conflicting ones remain as left and right variants under a merge group (github.com). Its documented AI-assisted resolution workflow checks both versions against current source files before recording a resolution and verification reason. The project is written in TypeScript and distributed under the MIT license. The explorer image shows a selected Semantic Search node and its detail panel.

What the archive adds

MegaMemory’s graph depends on concepts the agent writes after reading a project, not a programmatic code index. That makes its memory an explicit, agent-authored layer rather than a map generated by static analysis.

Limits and uncertainty

The README says brute-force cosine similarity over node embeddings is fast enough for graphs with fewer than 10,000 nodes; this is the project’s guidance, not an independently reported benchmark (github.com).

Skill to build now

Install with Node.js 18 or later using npm install -g megamemory; an approximately 23 MB embedding model downloads on first use (github.com). Run megamemory install for the interactive editor choice (github.com), or use a client-specific target: megamemory install --target opencode configures the MCP server, workflow instructions, plugin, and bootstrap and save commands; restart OpenCode afterward. For Claude Code, use megamemory install --target claudecode; for Codex, megamemory install --target codex; for Antigravity, megamemory install --target antigravity. Inspect the graph with megamemory serve.

Reader takeaway

MegaMemory stores project knowledge as agent-authored concepts—not code symbols—in a per-project SQLite database. Its documented loop is to orient, query before work, then record changes afterward. The README supports several client setups, but its search-size guidance is a project claim rather than an independent benchmark.

How this was made

First seen
Dec 2, 2026, 12:00 UTC in our intake.
Sources
1 source carried the story when we picked it up; we cite the original.
Written by
gpt-6-luna (AI model).
Critic
No separate critic model on this desk; the automated checks below gate publication.
Checks passed
The cited primary source was fetched and verified; the source is not older than 30 days; no earlier note covers the same story; the copy passed the site's structure and language checks.
Confidence
Novelty judgement: a new fact, medium confidence. Editorial value: medium.
Human review
Published without a per-item human sign-off. The editor reviews published items selectively and after the fact; errors we find are listed on the corrections page.

Corrections and error statistics

Evidence / sources

  1. 1github.com/0xK3vin/MegaMemory
All Field Notes

Next reads

Read next

Open the graph
  1. 01topicCoding AgentsExplore the coding-agents topic hub.
  2. 02topicMcpExplore the mcp topic hub.
  3. 03topicClaudeExplore the claude topic hub.
  4. 04archiveField NotesOpen the latest editorial analysis.
  5. 05sourcesSourcesSee the original sources this archive cites.
Who read this page?Machine requests, hidden until opened

Loading the privacy-safe route aggregate...

Open the JSON contract