Memtrace · the code memory Code layer · live
Memtrace

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.

97.3%accuracy
13msmedian latency
1.5sto index 1,500 files
$0API cost
Memtrace · structural call graph
1,504 symbols
2,917 edges
01 · What you can do with it

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.

Capability 01

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.

Capability 02

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.

The architectural bet

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.

Hybrid retrieval

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.

02 · The indexing pipeline

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

Step 01

Parse with Tree-sitter

15+ languages. Native AST, zero LLM calls.

Step 02

AST → graph nodes & edges

Typed: CALLS · IMPORTS · IMPLEMENTS · EXTENDS · CONTAINS

Step 03

3-pass cross-file resolver

Import-guided 1.0 · same-file 0.9 · guarded fuzzy 0.4-0.6

Step 04

Persist to MemDB

Bi-temporal headers on every node, edge, embedding

Step 05

Index for retrieval

HNSW (Jina-code 768d) + Tantivy BM25 inline

1,500 files · 1.5 seconds · $0 API cost · sub-50ms incremental snapshots 97.3% accuracy on the Mempalace 1k typo benchmark · 13.4ms median
03 · Language coverage

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.

TypeScript
Full set + RETURNS_TYPE, PARAM_TYPE
Cross-file resolved
Python
Calls, imports, extends, type-refs
Cross-file resolved
Go
Calls, imports, type-refs
Cross-file resolved
Rust
Calls, imports, impl, trait-bounds
Cross-file resolved
Java
Full set + IMPLEMENTS, INSTANTIATES
Cross-file resolved
C#
Calls, imports, extends, type-refs
Cross-file resolved
C++
Calls, imports, base-class edges
Cross-file resolved
+8 more
Ruby · Kotlin · Swift · Scala · Elixir · PHP · OCaml · Haskell
Lexical + partial AST
04 · A real user, real numbers

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.

Magalz · BMAD case study 13 sessions · Next.js + Postgres
May 2026 · unsolicited
Codebase briefing for a 5-story epic
~20 min ~5sec
−99.6% time
Evolution analysis · 142 change episodes
~30 min ~5sec
−99.7% time
Identify 2 high-risk refactor targets
1–2 hrs ~5sec
>99% time
80 dead-code symbols across modules
"never" ~5sec
∞ newly possible
Most-connected type identification
"infeasible" ~5sec
∞ newly possible
Indexing the full repo
31 min · Mem0 1.5sec
1,240× faster
05 · Benchmarks

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.

Mempalace · Acc@1
96.6%

1,000 exact-match queries. Hybrid retrieval at the top of the ranking.

Mempalace · Acc@10 typo
97.3%

Typo-tolerance variant. Lexical + semantic together absorb misspellings.

Median latency
13.4ms

Faster than a page scroll. Cheap to call before every edit.

Django · vs ChromaDB
233×

2× more accurate (80.5% vs 34.5% Acc@1), 233× faster (0.18ms vs 54ms).

06 · Why this wins

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.

Tool
Index 1,500 files
API cost
Bi-temporal
Sub-50ms refresh
Mem0
~31 min
$$$ per-token
Not designed for code
Graphiti
1–2 hours
$$$ per-token
claude-mem
n/a (per-turn)
$$ per-token
Conversation only
Sourcegraph SCIP
Minutes
$0
~ Static · no ranking
Memtrace
1.5 sec
$0
Native
Sub-50ms
07 · The dogfood test

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.

The proof

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.

Join the beta

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.