Memtrace ā Structural Memory for AI Coding Agents
The Problem
Every AI coding agent ā Claude Code, Cursor, Codex, Copilot ā starts each turn completely blank. It re-reads raw source files and re-derives the full call graph, type hierarchy, and import tree from scratch on every single invocation. That structural rework burns 60ā90% of the context window before any real reasoning begins. Less than 5% of tokens in a typical agentic coding session contribute genuine new intelligence. The rest is expensive, redundant noise ā and it compounds: accuracy drops 40% as sessions grow, stale context crowds out signal, and summaries strip out the structural relationships agents need most.
The Solution
Memtrace is a bi-temporal structural memory layer that turns your codebase into a live, queryable knowledge graph ā compiled from the AST, not guessed from embeddings. Every function, class, interface, and API endpoint becomes a typed node with deterministic relationships. Every file save becomes a queryable episode with timestamps, so agents can reason about structure, detect regressions, and time-travel through their own work without re-reading anything.
One Rust binary. Zero configuration. Five-minute install.
What agents can do with it
Find callers, callees, and dependencies instantly ā no file scanning, no token waste
Compute blast radius before making a change ā know exactly what breaks before anything is touched
Detect structural drift between sessions ā catch regressions the moment they happen, not at PR review
Time-travel through code evolution ā query any prior state of any symbol, not just git commits
Search across the full codebase with hybrid retrieval ā BM25 full-text + HNSW vector + graph traversal fused in one query
Map API topology across services ā cross-repo HTTP call graphs, dependency chains, dead endpoint detection
Benefits
ā90% token cost on structural queries (Mem0)
+26% accuracy on multi-step agentic tasks (Mem0)
ā91% p95 latency on structural lookups vs. RAG baselines
+32.8% SWE-bench bug-fix success rate when agents have graph context (RepoGraph)
200ā800ms per-save re-indexing ā every file save is a queryable episode in under a second
40+ MCP tools covering indexing, search, relationships, impact analysis, temporal evolution, API topology, graph algorithms, and direct Cypher queries
12 languages + 3 IaC formats supported via Tree-sitter grammars
Local-first, closed-source Rust ā code never leaves the machine, no account required, no telemetry