Your codebase, as a living map your agents can actually read.
Memtrace is the Rust CLI + MCP server that gives AI coding agents persistent structural memory of your repo. Tree-sitter parses the AST. The AST is the structure. No LLM in the indexing path. That's how we index 1,500 files in 1.5 seconds with $0 in API costs, and refresh after every edit in sub-50ms.
Two capabilities no other memory tool has.
The Magalz BMAD case study, written up by a user we'd never spoken to: 13 sessions on a production Next.js app, with quantified before/after numbers. This is the kind of artifact most companies need a year of customer-success investment to produce.
Always-fresh structural state
Every edit triggers a sub-50ms incremental snapshot. Your agent's memory is never one-session stale. Before a refactor, it queries the call graph and returns the blast radius (every caller, every test, every consumer) before writing a line.
Rewind and replay
The codebase is stored bi-temporally in MemDB. Every change becomes a recallable episode. When debugging a regression, replay how the function got to its current state, not guess from now. What worked before. What changed when. Which commit broke it.
Zero LLM during indexing
Mem0 and Graphiti call an LLM per chunk to extract structure. Slow, expensive, lossy on code. We use Tree-sitter. The AST is the structure. 1,500 files in 1.5 seconds, $0 in API cost.
Three signals, one ranked list
Tantivy BM25 for lexical recall. Jina-code 768-dim HNSW for semantic recall. Graph traversal for structural neighbors. Fused via Reciprocal Rank Fusion at k=60. Median 13ms.
Source code in. Structural graph out. No LLM in between.
The five-stage pipeline is bottlenecked by disk I/O, not API tokens, which is exactly why per-edit incremental snapshots stay sub-50ms.
Tree-sitter → typed graph → bi-temporal store
Parse with Tree-sitter
15+ languages. Native AST, zero LLM calls.
AST → graph nodes & edges
Typed: CALLS · IMPORTS · IMPLEMENTS · EXTENDS · CONTAINS
3-pass cross-file resolver
Import-guided 1.0 · same-file 0.9 · guarded fuzzy 0.4-0.6
Persist to MemDB
Bi-temporal headers on every node, edge, embedding
Index for retrieval
HNSW (Jina-code 768d) + Tantivy BM25 inline
Seven first-tier languages. All shipping.
Every language has working indexing and cross-file resolution via the unified 3-pass resolver. Out of scope today (same as Sourcegraph, Kythe, ctags): polymorphic dispatch, reflection, generated code. Runtime-trace ingestion is on the roadmap.
13 sessions. Production Next.js. Unprompted.
Magalz, a beta user we had never spoken to, sent a 4,000-word integration guide documenting before/after for 13 actual usage sessions on a production Next.js + Postgres project. The numbers below are his.
Reproducible from the public repo. Every one.
The benchmark harness is fully open and runnable without the beta binary, so anyone can verify before joining the queue.
1,000 exact-match queries. Hybrid retrieval at the top of the ranking.
Typo-tolerance variant. Lexical + semantic together absorb misspellings.
Faster than a page scroll. Cheap to call before every edit.
2× more accurate (80.5% vs 34.5% Acc@1), 233× faster (0.18ms vs 54ms).
Mem0 indexes conversations. Memtrace indexes code.
The category we sit in (Sourcegraph SCIP, ctags, raw Tree-sitter, Kythe, Glean) has no ranked retrieval, no semantic similarity, no bi-temporal queries. We benchmark against them in the open repo.
We built Memtrace using Claude Code. It forgot.
Mid-build, Claude Code lost the plot on Memtrace's own architecture. It contradicted decisions we'd made 50 turns earlier. It re-read the same files. It forgot which retrieval weights we'd already tuned. We were living the pain we were building Memtrace to solve.
We pointed the beta at Memtrace's own codebase.
The session-loss stopped. The blind refactor suggestions stopped. The dogfood test was the only proof the architectural bet was real. Three months later, the Magalz case study landed: unsolicited, 4,000 words, on someone else's production codebase. That's the bet, validated by someone we'd never spoken to.
Your agents don't have to forget.
Point Memtrace at your repo.
Get a living map back in 1.5 seconds.
Free during early access. We pace approvals to feedback bandwidth: under 24h, capped at 50 per week. Rather have 500 users for whom this is magic than 50,000 for whom it's broken.