Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (memtrace) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Memtrace
The persistent memory layer for coding agents.
A bi-temporal, episodic, structural knowledge graph — built from AST, not guesswork.
Memtrace gives coding agents something they've never had: structural memory. Not vector similarity. Not semantic chunking. A real knowledge graph compiled from your codebase's AST — where every function, class, interface, and API endpoint exists as a node with deterministic, typed relationships.
Index once. Every agent query after that resolves through graph traversal — callers, callees, implementations, imports, blast radius, temporal evolution — in milliseconds, with zero token waste.
npm install -g memtrace # binary + 12 skills + MCP server — one command
memtrace start # launches the graph database
memtrace index . # indexes your codebase in secondsThat's it. Claude picks up the skills and MCP tools automatically.
Why Memtrace Exists
Static code graphs exist. Tools like GitNexus and CodeGrapherContext build AST-based graphs with symbol relationships — and they're useful. But they solve one dimension: what exists right now.
Memtrace is a bi-temporal episodic structural knowledge graph. It adds two dimensions no other code intelligence tool has:
- Temporal memory — every symbol carries its full version history. Agents can reason about what changed, when it changed, and how the architecture evolved — not just what exists today. Six scoring algorithms (impact, novelty, recency, directional, compound, overview) let agents ask different temporal questions.
- Cross-service API topology — Memtrace maps HTTP call graphs between repositories, detecting which services call which endpoints. No other code grapher does inter-service relationship mapping.
On top of that, the structural layer is comprehensive:
- Symbols are nodes — functions, classes, interfaces, types, endpoints
- Relationships are edges —
CALLS,IMPLEMENTS,IMPORTS,EXPORTS,CONTAINS - Community detection — Louvain algorithm identifies architectural modules automatically
- Hybrid search — Tantivy BM25 + vector embeddings + Reciprocal Rank Fusion, all on top of the graph
- Rust-native — compiled binary, no Python/JS runtime overhead, single-digit millisecond queries
The agent doesn't just search your code. It remembers it.
Benchmarks
All benchmarks run on the same machine, same codebase, same queries. No cherry-picking.
Does it find the right thing?
How fast?
How much context does it save?
How long to set up?
Memtrace vs. general memory systems (Mem0, Graphiti)
Mem0 and Graphiti are excellent conversational memory engines for tracking entity knowledge (e.g. User -> Likes -> Apples). They are architecturally unsuited for code intelligence because they require LLM inference to build their graphs.
Graphiti processes data through add_episode(), which triggers multiple LLM calls per episode — entity extraction, relationship resolution, deduplication. At ~50 episodes/minute (source), ingesting 1,500 code files takes 1–2 hours. Every episode costs LLM tokens.
Mem0 processes data through client.add(), which queues async LLM extraction and conflict resolution per memory item (source). Bulk ingestion with infer=True (default) means every file passes through an LLM distillation pipeline. Throughput is bounded by your LLM provider's rate limits.
Both accumulate $10–50+ in API costs because they use LLMs to guess code relationships rather than parsing them deterministically.
Memtrace indexes 1,500 files in 1.2–1.8 seconds for $0.00 — no LLM calls, no API costs, no rate limits. Native Tree-sitter AST parsers resolve deterministic symbol references (CALLS, IMPLEMENTS, IMPORTS) locally.
Memtrace vs. code graphers (GitNexus, CodeGrapherContext)
GitNexus and CodeGrapherContext both build AST-based code graphs with structural relationships — they're real tools solving real problems. Here's what Memtrace adds:
| Capability | Memtrace | GitNexus | CodeGrapher |
|---|---|---|---|
| AST-based graph | Yes | Yes | Yes |
| Structural relationships (CALLS, IMPLEMENTS, IMPORTS) | Yes | Yes | Yes |
| Bi-temporal version history per symbol | Yes — 6 scoring modes | Git-diff only | No |
| Cross-service HTTP API topology | Yes | No | No |
| Community detection (Louvain) | Yes | Yes | No |
| Hybrid search (BM25 + vector + RRF) | Yes — Tantivy + embeddings | No | BM25 + optional embeddings |
| Language | Rust (compiled binary) | JavaScript | Python |
| Query latency (1K queries) | 4.6 ms avg | 220 ms avg | 466.7 ms avg |
| Index time (1,500 files) | 1.5 sec | 10.5 sec | 3.5 min |
The speed difference comes from Rust vs. interpreted runtimes, and Memgraph's Bolt protocol vs. HTTP/embedding pipelines. The feature difference is temporal memory and API topology — dimensions that don't exist in static-snapshot graphs.
25+ MCP Tools
Memtrace exposes a full structural toolkit via the Model Context Protocol:
|
Search & Discovery
Relationships
Impact Analysis
Code Quality
|
Temporal Analysis
Graph Algorithms
API Topology
Indexing & Watch
|
12 Agent Skills
Memtrace ships skills that teach Claude how to use the graph. They fire automatically based on what you ask — no prompt engineering required.
| Skill | You say... | |
|---|---|---|
| Search | memtrace-search |
"find this function", "where is X defined" |
| Relationships | memtrace-relationships |
"who calls this", "show class hierarchy" |
| Evolution | memtrace-evolution |
"what changed this week", "how did this evolve" |
| Impact | memtrace-impact |
"what breaks if I change this", "blast radius" |
| Quality | memtrace-quality |
"find dead code", "complexity hotspots" |
| Architecture | memtrace-graph |
"show me the architecture", "find bottlenecks" |
| APIs | memtrace-api-topology |
"list API endpoints", "service dependencies" |
| Index | memtrace-index |
"index this project", "parse this codebase" |
Plus 4 workflow skills that chain multiple tools with decision logic:
| Skill | You say... |
|---|---|
memtrace-codebase-exploration |
"I'm new to this project", "give me an overview" |
memtrace-change-impact-analysis |
"what will break if I refactor this" |
memtrace-incident-investigation |
"something broke", "root cause analysis" |
memtrace-refactoring-guide |
"help me refactor", "clean up tech debt" |
Temporal Engine
Six scoring algorithms for different temporal questions:
| Mode | Best for |
|---|---|
compound |
General-purpose "what changed?" — weighted blend of impact, novelty, recency |
impact |
"What broke?" — ranks by blast radius (in_degree^0.7 × (1 + out_degree)^0.3) |
novel |
"What's unexpected?" — anomaly detection via surprise scoring |
recent |
"What changed near the incident?" — exponential time decay |
directional |
"What was added vs removed?" — asymmetric scoring |
overview |
Quick module-level summary |
Uses Structural Significance Budgeting to surface the minimum set of changes covering ≥80% of total significance.
Setup
Claude Code
npm install -g memtrace handles everything automatically. For manual setup:
claude plugin marketplace add syncable-dev/memtrace
claude plugin install memtrace-skills@memtrace --scope user
claude mcp add memtrace -- memtrace mcp -e MEMGRAPH_URL=bolt://localhost:7687Claude Desktop
Skills and plugins are shared between Claude Code and Claude Desktop — both activate after npm install -g memtrace. Add the MCP server to claude_desktop_config.json:
{
"mcpServers": {
"memtrace": {
"command": "memtrace",
"args": ["mcp"],
"env": { "MEMGRAPH_URL": "bolt://localhost:7687" }
}
}
}Languages
Rust · Go · TypeScript · JavaScript · Python · Java · C · C++ · C# · Swift · Kotlin · Ruby · PHP · Dart · Scala · Perl — and more via Tree-sitter.
Requirements
| Dependency | Purpose |
|---|---|
| Memgraph | Graph database — auto-managed via memtrace start |
| Node.js ≥ 18 | npm installation |
| Git | Temporal analysis (commit history) |
Documentation · npm · Issues
Built by Syncable · Proprietary EULA · Free to use