AI coding agents just got something they've never had before: institutional memory that doesn't cost a fortune in API calls or break when three agents touch the same file.
The Summary
- Memtrace is open-source structural memory for AI coding agents — a live knowledge graph that tracks every function, class, and dependency across your entire codebase without making a single LLM call
- Indexes 1,500 files in 1.5 seconds with zero API costs, runs 1,200x faster than the closest alternative (Mem0), and handles 50k-file repos in under 90 seconds
- Built for the agent fleet problem: multiple AI agents working the same repo simultaneously, each one seeing the same call graph and temporal history, no merge conflicts or stale context
- Real differentiation is bi-temporal queries — agents can time-travel through code history and see blast radius of changes before they make them
The Signal
The agent economy has a memory problem. Current AI coding agents work like developers with severe amnesia. They read files, make changes, then forget everything. Next session, they start over. When you run multiple agents on the same codebase, they collide. One refactors a function while another is calling it. Tests break that nobody saw coming. The solution until now has been expensive: feed the entire context window to an LLM every single time, rack up API bills, wait for responses.
Memtrace solves this with a Rust-powered knowledge graph that tracks structural relationships between code elements. Every function, every class, every call edge gets indexed once. Agents query the graph in milliseconds instead of re-reading files or burning tokens. The performance gap is brutal: 1.5 seconds to index 1,500 files versus 31 minutes for Mem0. For exact symbol queries, Memtrace hits 96.6% accuracy at 0.07ms latency. GitNexus hits 97% accuracy but takes 8.95ms — 128x slower.
The real unlock is bi-temporal architecture. This isn't just version control for code. It's version control for dependencies and call graphs across time. An agent can query "what called this function in the version from Tuesday" or "show me everything that will break if I rename this class." The graph caller recall on Django codebases is 81.6% versus GitNexus at 5.3%. That's the difference between an agent that sees the blast radius and one that's coding blind.
"Each agent reads the same call graph, sees the same blast radius, inherits the same temporal history. No collisions. No stale context."
Three design choices make this work:
- Tree-sitter parsing: supports 20+ languages plus framework-specific scanners for Vapor, Kong, Terraform, GitHub Actions, even Postgres RLS policies
- MCP-native: built on Model Context Protocol, meaning any agent that speaks MCP can query it without custom integration work
- Zero LLM calls: the graph IS the memory, agents don't ask an LLM to remember things or summarize context
The new LeanCTX Native mode (v0.3.57+) adds compression on top. Four modes for compressed reads, single-call directory maps, and an adaptive learner that beats static compression tables by 14%. You get a real-time token-savings dashboard. This matters because agents don't just need memory, they need memory that fits in limited context windows. Structural memory plus compression means agents can hold more of the codebase in working memory without hitting token limits.
Incremental re-indexing runs at 42.5ms p95. That's the time it takes to update the graph after you save a file. Fast enough that the graph stays current while you work. Your agents never query stale structure.
The Implication
The agent fleet problem has been theoretical until now. Companies want multiple specialized agents working the same codebase — one for tests, one for documentation, one for refactoring. But coordination is expensive and error-prone. Memtrace makes it practical. Every agent queries the same structural memory, sees the same dependencies, inherits the same history. No conflicts, no redundant indexing, no API bills that scale with agent count.
Watch for this pattern: agents that share structural memory will outperform agents that don't, especially as codebases grow past 10k files. The companies that figure out shared agent memory first will ship faster with fewer broken builds. If you're running AI coding agents at scale, test this against your current setup. If you're building agent tooling, bi-temporal graphs are now table stakes.