Your AI coding agents have amnesia. engram is the cure.
A cross-agent, git-friendly, local-first memory layer for AI coding agents.
A 15-second loop: engram init wires every agent β an agent remembers a decision β a new session recalls it.
| π§ 5 agents, one memory | Claude Code Β· Codex Β· Gemini Β· Cursor Β· any MCP client |
| π¦ 4 production dependencies | minisearch Β· @modelcontextprotocol/sdk Β· yaml Β· commander |
| πͺΆ ~15 kB installed | 14.8 kB packed Β· 46.2 kB unpacked Β· 9 files |
| π΄ 0 runtime network calls | local-only Β· no cloud Β· no telemetry Β· no account |
| β‘ ~5 ms recall at 10 memories Β· ~332 ms at 1,000 | measured, not estimated β see Performance |
| ποΈ 1 command wires every installed agent | npx engramkit init |
Every AI coding agent β Claude Code, Codex, Gemini CLI, Cursor β forgets everything the moment a session ends. You re-explain the architecture, re-litigate settled decisions, and watch the agent repeat a fix you already debugged last week. Per-agent "memory" features exist, but they don't talk to each other: what Claude Code learns, Cursor can't see.
engram is one memory layer every agent shares. It lives in your repo as plain markdown under .engram/, is diffable in code review, and ships as a zero-config MCP server β npx engramkit init and every supported agent is wired up in one command.
# In any git repo:
npx engramkit init # creates .engram/ + wires every installed agent
git add .engram .claude .mcp.json .codex .gemini .cursor AGENTS.md
git commit -m "chore: add engram memory layer"
# Use it manually, or just let your agents use it over MCP:
engramkit add "Use Postgres, not MySQL β we need JSONB + RLS" --type decision --tags db
engramkit recall "database choice"Now any agent you open in that repo will:
- See the memory index at session start (injected via a hook) β every past decision, fix, and preference, one line each.
recallbefore doing real work β BM25 search over the full memory layer.rememberafter a decision or root-cause β saved as.engram/memories/<slug>.md, INDEX regenerated, ready to commit.
engramkit list # browse everything
engramkit list --type fix # just the bug root-causes
engramkit forget <id> # delete a stale one
engramkit serve # start the MCP server manually (agents do this for you)Prefer to have engram available in every repo without per-project wiring? Install it once as a Claude Code plugin from this repo's marketplace:
# In Claude Code (any project):
/plugin marketplace add Victorchatter/engramkit
/plugin install engramkit@engramkit-marketplaceThat gives every Claude Code session, in any repo, the recall + remember MCP tools and a SessionStart hook that injects the project's .engram/INDEX.md when present (silent otherwise). Then you only need .engram/ created per project:
engramkit init # in each repo: creates .engram/ (+ optional per-project agent wiring)The plugin's MCP server runs
npx -y engramkit serve, so it works for others onceengramkitis published to npm. Until then, anyone withengramkiton their PATH (e.g. vianpm link) can use it.To submit to the official community marketplace (broader discovery, review required), run
claude plugin validate .then submit at https://platform.claude.com/plugins/submit.
flowchart LR
subgraph repo["your git repo Β· everything committed, git-diffable"]
direction TB
mem[".engram/memories/*.md<br/>one file per memory<br/>+ YAML frontmatter"]
idx[".engram/INDEX.md<br/>auto-regenerated on every write"]
mem --> idx
end
CC["Claude Code"] --> srv
CX["Codex CLI"] --> srv
GM["Gemini CLI"] --> srv
CR["Cursor"] --> srv
ANY["any MCP client"] --> srv
srv["engram MCP server<br/>npx engramkit serve<br/>tools: recall Β· remember"] <-->|reads / writes| repo
style srv fill:#eef,stroke:#4a6,stroke-width:2px
style repo fill:#f7f7f7,stroke:#999
- Storage: one markdown file per memory in
.engram/memories/<slug>.md, with YAML frontmatter (id,type,tags,created,source). An auto-generated.engram/INDEX.md(one line per memory) is injected into agent context at session start and regenerated on every write. Everything is committable; engram never writes outside your repo (except agent config files duringinit). - Search: BM25 full-text (via
minisearch) β title and tags boosted, prefix + fuzzy matching. Rebuilt per call (fine until ~10k memories; persistence is a roadmap item). No embeddings, no API calls, no network. - The universal adapter:
engramkit serveis a standard MCP server exposing two tools βrecallandrememberβ whose descriptions teach agents when to call them. Any MCP-compatible agent picks it up automatically onceinitregisters it.
sequenceDiagram
participant U as you
participant A as agent (Claude Code)
participant E as engram MCP
participant R as .engram/
Note over A,R: session start β SessionStart hook fires
A->>R: read .engram/INDEX.md (one line per memory)
R-->>A: index injected into context
U->>A: "fix the checkout 500"
A->>E: recall("checkout 500")
E->>R: BM25 search memories/
R-->>E: ranked hits
E-->>A: prior root-cause: missing CORS allowlist
A->>U: "this was a CORS allowlist bug last time β re-apply the fix?"
Note over A,R: session end β Stop hook fires
A->>E: remember(...) (only if something new was learned)
E->>R: write memories/<slug>.md, regenerate INDEX
Measured locally (Windows 11, Node 22, warm filesystem cache). engram rebuilds its BM25 index on every call, so per-op cost is roughly linear in vault size β no hidden quadratic scans, no background services, no network. Below ~300 memories every operation is sub-100 ms; at 1,000 memories a recall is ~β second. A persistent incremental index (roadmap) flattens this for >10k.
| memories in vault | recall (one query) | add one memoryΒΉ | linear scan (no index) |
|---|---|---|---|
| 10 | 4.5 ms | ~10 ms | 1.2 ms |
| 100 | 35 ms | ~22 ms | 12 ms |
| 1,000 | 332 ms | ~165 ms | 121 ms |
ΒΉ Adding one memory re-reads all memories to regenerate INDEX.md, so it costs the same order as a recall. In normal use you add occasionally, one at a time β unnoticeable until the vault is very large. (Bulk-seeding thousands in a tight loop is the one place the rebuild-on-write shows up.) The linear-scan column is the baseline engram's BM25 index replaces β cheaper per op at this scale, but it means every recall would need to inspect every file with no ranking; the index buys relevance, not raw speed.
Honest scope: these are engram's own numbers. The alternatives in the section below were not independently benchmarked here β engram is designed to win on structural dimensions (cross-agent breadth, zero network, zero-config, install size, plain markdown) rather than on raw latency against hosted services.
engram's recall stays flat (~380 tokens) no matter how large the vault gets, because it's bounded top-5 retrieval, not a context dump. Retention doesn't decay with history size either β a decision is a file with an exact BM25 match, not a compressed summary that drifts. The claude-mem series above is estimated from its published architecture, not independently benchmarked β shown dashed in both charts to mark that.
| engram | Claude Code auto-memory | claude-mem |
mem0 | |
|---|---|---|---|---|
| Works across all agents | β Claude Code, Codex, Gemini, Cursor, any MCP | β Claude Code only | β Claude Code only | |
| Plain markdown, readable | β
.engram/*.md |
β opaque | ||
| Local-only, no cloud | β | β | β | β defaults to hosted |
| Runtime network calls | 0 | 0 | 0 | yes (hosted API) |
| Git-diffable in code review | β
commit .engram/ |
β | β | β |
| Production dependencies | 4 | built-in | separate package | many |
| Zero-config | β
npx engramkit init |
β (one agent) | β provisioning + keys |
engram is the only one that gives every agent you use the same memory, in files you can read and review, with no account or key anywhere.
| Agent | How engram wires it | Status |
|---|---|---|
| Claude Code | .claude/settings.json SessionStart + Stop hooks, .mcp.json server |
β |
| Codex CLI | .codex/config.toml MCP server ([mcp_servers.engramkit]) |
β |
| Gemini CLI | .gemini/settings.json mcpServers.engramkit |
β |
| Cursor | .cursor/mcp.json mcpServers.engramkit |
β |
| Any MCP client | Run npx engramkit serve and add it to your client's MCP config |
β |
| all agents | AGENTS.md block with recall/remember instructions |
β |
engram init detects which agents are installed and wires only those; pass --all to write every config regardless. All wiring is idempotent β re-running never duplicates or clobbers existing config.
Config formats were verified against current (2026) docs, not memory. See
docs/agent-config-sources.mdfor the source links.
- Node.js >= 18.
- A git repo (run
engramkit initat the root).
These are intentionally out of scope for v1 β listed here so you know what's coming, and where to help:
- Semantic / embedding search β v1 is BM25 only, so
databasewon't match a memory that says "DB". Embeddings + a local index are the next big step. - Persistent search index β the minisearch index is rebuilt per
recalltoday; persist + incrementally update once repos exceed ~10k memories. - Cloud / team sync β today every memory is local and committed per-repo. Optional encrypted sync for teams is a future mode.
- Web UI β a small browser view over
.engram/for browsing/editing memories. - Memory decay / review queue β surface stale memories for pruning.
- Per-user global memory β v1 is per-repo only; a cross-repo personal memory is planned.
engram is open source and small on purpose. See CONTRIBUTING.md β the whole codebase is five modules (store, search, init, mcp, cli) and the bar for a new dependency is high. Bug reports and new-agent support requests are very welcome; see the issue templates.
engram collects nothing β no telemetry, no account, no network calls at runtime. Memories stay in your repo as plain markdown. See PRIVACY.md for the full policy.



