Your Coding Agent’s Long-Term Memory, Stored in SQLite
It gives coding agents a persistent SQLite-backed knowledge graph so they stop forgetting how the project works between sessions.

What it does
MegaMemory is an MCP server that gives coding agents a long-term memory layer. After each task, the agent writes concepts—features, modules, patterns, decisions—into a per-project SQLite database. Before the next task, it queries the graph to recall context. Everything persists locally in .megamemory/knowledge.db.
The interesting bit
Instead of parsing ASTs or scraping static symbols, the project treats the LLM itself as the indexer: the agent reads code and summarizes concepts in its own words. Embeddings run in-process via a quantized ONNX model, so after a one-time ~23MB download the whole thing works offline with no API keys. There is even a custom two-way merge engine because Git cannot diff SQLite files.
Key highlights
- Stores semantic concepts (e.g.,
decision,pattern) rather than raw code symbols. - In-process
all-MiniLM-L6-v2embeddings give brute-force cosine search over the graph. - Includes a web explorer to visualize nodes, edges, and parent-child relationships in the browser.
- Provides dedicated merge and conflict-resolution commands for branching workflows that touch the same
.megamemory/knowledge.db.
Caveats
- Search is brute-force cosine similarity, which the README says is only “fast enough for graphs with <10k nodes.”
- Because the graph is a SQLite binary, merging divergent branches requires manual or AI-assisted resolution rather than standard Git tooling.
Verdict
Worth a look if you run agentic coding workflows and are tired of repeating project context every session. Less useful if your agent already has perfect recall or you rarely work across long-running branches.
Frequently asked
- What is 0xK3vin/MegaMemory?
- It gives coding agents a persistent SQLite-backed knowledge graph so they stop forgetting how the project works between sessions.
- Is MegaMemory open source?
- Yes — 0xK3vin/MegaMemory is open source, released under the MIT license.
- What language is MegaMemory written in?
- 0xK3vin/MegaMemory is primarily written in TypeScript.
- How popular is MegaMemory?
- 0xK3vin/MegaMemory has 501 stars on GitHub.
- Where can I find MegaMemory?
- 0xK3vin/MegaMemory is on GitHub at https://github.com/0xK3vin/MegaMemory.