Engram
Gives coding agents a persistent, searchable project memory stored locally in SQLite
Per-project knowledge graph a coding agent writes to and searches so it keeps context between sessions
By Kevin (individual) TypeScript Local · stdio Knowledge and memoryDeveloper tools
59 popularity score ★ 734 ↓ 173/wk
Opens the app, which asks before it adds the server.
npm install -g megamemoryclaude mcp add megamemory -- megamemory{
"mcpServers": {
"megamemory": {
"command": "megamemory",
"args": []
}
}
}{
"mcpServers": {
"megamemory": {
"command": "megamemory",
"args": []
}
}
}{
"servers": {
"megamemory": {
"type": "stdio",
"command": "megamemory",
"args": []
}
}
}[mcp_servers.megamemory]
command = "megamemory"
args = []gemini mcp add --scope user megamemory megamemoryMEGAMEMORY_DB_PATH |
Optional: Path of the SQLite graph file; defaults to .megamemory/knowledge.db under the working directory. |
|---|
MegaMemory is a local stdio MCP server that keeps a graph of what a coding agent has learned about one project: features, modules, patterns, config, decisions and components, joined by typed links such as depends_on, implements or calls. It does not parse code itself. The agent reads the code, writes each concept in its own words with optional file references, and searches the graph at the start of later tasks. The intended rhythm is to list the top-level concepts when a session opens, search before a task, and add or update concepts afterwards.
The graph lives in a SQLite file at .megamemory/knowledge.db under the directory the server is started from, or wherever MEGAMEMORY_DB_PATH points. Search is semantic: each concept is embedded on your machine with the all-MiniLM-L6-v2 model and compared by cosine similarity, so no API key is needed. In v1.6.2 the understand tool returns 10 matches by default and accepts top_k up to 50 (src/index.ts). Removals are soft deletes that keep the reason in history, and every tool call is also written to a timeline log in the same database, which the browser explorer can replay.
The same package carries a CLI: megamemory install writes the server entry and workflow instructions into opencode, Claude Code, Antigravity or Codex config; megamemory serve opens a graph viewer in the browser; and megamemory merge, conflicts and resolve reconcile two knowledge.db files from diverging git branches, with two tools that let the agent settle merge conflicts against the current code.
| Runtime | Node.js 18+ |
|---|
Node.js 18 or later and the megamemory npm package installed globally (npm install -g megamemory), since clients launch the plain megamemory command. On first use it downloads an embedding model of about 23 MB, so that first run needs network access. The client must start it in the project directory, or MEGAMEMORY_DB_PATH must be set, for the graph to land in the right project.
It indexes nothing by itself: the graph only holds what the agent chooses to write, so its quality depends on the agent and the instructions it follows. Search compares against every concept one by one, which its README calls fast enough for graphs under 10,000 nodes. understand returns at most 50 results per call. SQLite files cannot be merged by git, so branches that both change knowledge.db need the megamemory merge command. The generic client example in the README is opencode-style JSON (type "local", command as an array); other clients need their own format with command megamemory and no arguments.
Suits developers who use a coding agent on the same codebase across many sessions and want it to keep architecture notes and decisions in a file that sits in the repository and stays on their machine, with no account or API key. It fits teams that commit the graph alongside code, given its merge tooling. It is less suited to memory that spans many unrelated projects or that must be shared live between machines, since each graph is one SQLite file per project, and to anyone wanting automatic code indexing: the agent has to write every entry.
understandget_conceptcreate_conceptupdate_conceptlinkremove_conceptlist_rootslist_conflictsresolve_conflict