engram is a local code-graph context layer for AI coding agents. It indexes a repository into a local SQLite knowledge graph and exposes it over MCP (stdio), so the agent can ask about code structure, call sites, and git-mined mistakes instead of re-reading whole files. Apache-2.0, local-only, zero cloud, no API key, no account.
npm install -g engramx(Or skip the global install and run it on demand with npx — see the MCP
config below, which uses npx.)
cd /absolute/path/to/the/project
engram init .This builds .engram/graph.db from the repo (AST extraction + git history). It
runs entirely locally and takes a few seconds on a typical repo.
Add this to the MCP settings (in Cline: MCP Servers → Configure, i.e.
cline_mcp_settings.json):
{
"mcpServers": {
"engram": {
"command": "npx",
"args": ["-y", "-p", "engramx", "engram-serve", "/absolute/path/to/the/project"]
}
}
}Replace /absolute/path/to/the/project with the absolute path to the repo you
indexed in step 2.
engram doctor -p /absolute/path/to/the/projectIt should report that the graph is present and the AST provider is reachable.
query_graph— natural-language search of the code graphgod_nodes— the most-connected entities (core abstractions)graph_stats— node / edge counts and confidence breakdownshortest_path— trace the connection between two symbolsbenchmark— the structural context-token reduction on this repo (a reduction in tokens entering context, not a dollar/bill saving — your real cost is dominated by prompt caching)
- Requirements: Node ≥ 20. For the grep call-site feature,
ripgrep(rg) onPATH(optional — engram falls back gracefully without it). - Keeping the graph fresh: re-run
engram init .after large changes, orengram reindex <file>for one file, orengram install-hookto update it automatically as files change. - Privacy: nothing leaves the machine — engram never makes a network call
and stores everything in local SQLite under
.engram/.