memtrace 0.7.24 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +209 -287
  2. package/install.js +9 -6
  3. package/installer/package.json +1 -1
  4. package/installer/skills/commands/memtrace-api-topology.md +31 -34
  5. package/installer/skills/commands/memtrace-cochange.md +64 -33
  6. package/installer/skills/commands/memtrace-daily.md +73 -0
  7. package/installer/skills/commands/memtrace-decision-recall.md +91 -0
  8. package/installer/skills/commands/memtrace-evolution.md +121 -88
  9. package/installer/skills/commands/memtrace-fleet-publish-intent.md +18 -2
  10. package/installer/skills/commands/memtrace-fleet-record-episode.md +23 -2
  11. package/installer/skills/commands/memtrace-fleet-resolve.md +24 -1
  12. package/installer/skills/commands/memtrace-graph.md +59 -41
  13. package/installer/skills/commands/memtrace-impact.md +67 -19
  14. package/installer/skills/commands/memtrace-index.md +20 -3
  15. package/installer/skills/commands/memtrace-intent-verification.md +81 -0
  16. package/installer/skills/commands/memtrace-preflight.md +85 -0
  17. package/installer/skills/commands/memtrace-provenance.md +90 -0
  18. package/installer/skills/commands/memtrace-quality.md +49 -32
  19. package/installer/skills/commands/memtrace-relationships.md +73 -30
  20. package/installer/skills/commands/memtrace-search.md +86 -61
  21. package/installer/skills/workflows/memtrace-change-impact-analysis.md +32 -12
  22. package/installer/skills/workflows/memtrace-code-review.md +17 -11
  23. package/installer/skills/workflows/memtrace-codebase-exploration.md +41 -5
  24. package/installer/skills/workflows/memtrace-continuous-memory.md +54 -56
  25. package/installer/skills/workflows/memtrace-decision-memory.md +139 -0
  26. package/installer/skills/workflows/memtrace-episode-replay.md +87 -63
  27. package/installer/skills/workflows/memtrace-first.md +63 -7
  28. package/installer/skills/workflows/memtrace-fleet-coordination.md +21 -1
  29. package/installer/skills/workflows/memtrace-fleet-first.md +35 -5
  30. package/installer/skills/workflows/memtrace-incident-investigation.md +113 -55
  31. package/installer/skills/workflows/memtrace-refactoring-guide.md +31 -11
  32. package/installer/skills/workflows/memtrace-session-continuity.md +63 -49
  33. package/installer/skills/workflows/memtrace-style-fingerprint.md +27 -4
  34. package/package.json +7 -7
  35. package/skills/commands/memtrace-api-topology.md +31 -34
  36. package/skills/commands/memtrace-cochange.md +64 -33
  37. package/skills/commands/memtrace-daily.md +73 -0
  38. package/skills/commands/memtrace-decision-recall.md +91 -0
  39. package/skills/commands/memtrace-evolution.md +121 -88
  40. package/skills/commands/memtrace-fleet-publish-intent.md +18 -2
  41. package/skills/commands/memtrace-fleet-record-episode.md +23 -2
  42. package/skills/commands/memtrace-fleet-resolve.md +24 -1
  43. package/skills/commands/memtrace-graph.md +59 -41
  44. package/skills/commands/memtrace-impact.md +67 -19
  45. package/skills/commands/memtrace-index.md +20 -3
  46. package/skills/commands/memtrace-intent-verification.md +81 -0
  47. package/skills/commands/memtrace-preflight.md +85 -0
  48. package/skills/commands/memtrace-provenance.md +90 -0
  49. package/skills/commands/memtrace-quality.md +49 -32
  50. package/skills/commands/memtrace-relationships.md +73 -30
  51. package/skills/commands/memtrace-search.md +86 -61
  52. package/skills/workflows/memtrace-change-impact-analysis.md +32 -12
  53. package/skills/workflows/memtrace-code-review.md +17 -11
  54. package/skills/workflows/memtrace-codebase-exploration.md +41 -5
  55. package/skills/workflows/memtrace-continuous-memory.md +54 -56
  56. package/skills/workflows/memtrace-decision-memory.md +139 -0
  57. package/skills/workflows/memtrace-episode-replay.md +87 -63
  58. package/skills/workflows/memtrace-first.md +63 -7
  59. package/skills/workflows/memtrace-fleet-coordination.md +21 -1
  60. package/skills/workflows/memtrace-fleet-first.md +35 -5
  61. package/skills/workflows/memtrace-incident-investigation.md +113 -55
  62. package/skills/workflows/memtrace-refactoring-guide.md +31 -11
  63. package/skills/workflows/memtrace-session-continuity.md +63 -49
  64. package/skills/workflows/memtrace-style-fingerprint.md +27 -4
package/README.md CHANGED
@@ -1,383 +1,305 @@
1
- <p align="center">
2
- <img src="https://raw.githubusercontent.com/syncable-dev/memtrace-public/main/assets/logo.svg" alt="Memtrace" width="100" height="100" />
3
- </p>
1
+ # Memtrace
4
2
 
5
- <h1 align="center">Memtrace</h1>
3
+ Code intelligence graph — an MCP server that builds a persistent knowledge graph from your codebase, enabling structural search, relationship analysis, temporal evolution tracking, and architectural understanding.
6
4
 
7
- <p align="center">
8
- <strong>The persistent memory layer for coding agents.</strong><br/>
9
- A bi-temporal, episodic, structural knowledge graph — built from AST, not guesswork.
10
- </p>
5
+ ## Quick Start
11
6
 
12
- <p align="center">
13
- <a href="https://www.npmjs.com/package/memtrace"><img src="https://img.shields.io/npm/v/memtrace?style=flat-square&color=00D4B8&label=npm" alt="npm version" /></a>
14
- <a href="https://github.com/syncable-dev/memtrace-public/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Proprietary%20EULA-0A1628?style=flat-square" alt="license" /></a>
15
- <a href="https://memtrace.io"><img src="https://img.shields.io/badge/docs-memtrace.io-00D4B8?style=flat-square" alt="docs" /></a>
16
- </p>
7
+ Run once without installing anything globally:
17
8
 
18
- > **Early Access** — Memtrace is under active development. Core indexing and structural search are stable. Temporal features (evolution scoring, timeline replay) are functional but may have rough edges. [Report issues here.](https://github.com/syncable-dev/memtrace-public/issues)
19
-
20
- ---
21
-
22
- 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.
9
+ ```bash
10
+ npx memtrace@latest start
11
+ ```
23
12
 
24
- 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.
13
+ Or pin Memtrace to one project so teammates use the same CLI version:
25
14
 
26
15
  ```bash
27
- npm install -g memtrace # binary + 18 skills + MCP server — one command
28
- memtrace start # launches the graph database and auto-indexes the current project
16
+ npm install --save-dev memtrace
17
+ npx memtrace start
29
18
  ```
30
19
 
31
- That's it. Run `memtrace start` from your project root — it spins up the graph database and kicks off indexing automatically. Claude, Cursor, Codex, Windsurf, VS Code/Copilot, Hermes, OpenCode, and Kiro pick up the skills/guidance and MCP tools automatically.
20
+ Global install is still supported when you want the `memtrace` command available everywhere:
32
21
 
33
- ---
22
+ ```bash
23
+ npm install -g memtrace
34
24
 
35
- ## Why Memtrace Exists
25
+ memtrace start
36
26
 
37
- Good code intelligence tools already exist. GitNexus and CodeGrapherContext build AST-based graphs with symbol relationships, and they work well for understanding what's in your codebase *right now*.
27
+ # Index your project
28
+ memtrace index /path/to/your/project
38
29
 
39
- Memtrace is a **bi-temporal episodic structural knowledge graph**. It builds on that same AST foundation and adds two dimensions:
30
+ # Start the MCP server (for direct use)
31
+ memtrace mcp
32
+ ```
40
33
 
41
- - **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.
42
- - **Cross-service API topology** — Memtrace maps HTTP call graphs between repositories, detecting which services call which endpoints across your architecture.
34
+ After `npm install -g memtrace`, the installer automatically:
43
35
 
44
- On top of that, the structural layer is comprehensive:
36
+ 1. Installs the platform-specific memtrace binary
37
+ 2. Installs 18 Memtrace skills/workflows, or the provider's nearest native equivalent
38
+ 3. Registers the memtrace MCP server for supported agents
39
+ 4. Registers the `memtrace` marketplace from the public HTTPS Git source in `~/.claude/settings.json` for Claude auto-updates
40
+ 5. Enables the `memtrace-skills@memtrace` Claude plugin in `enabledPlugins`
41
+ 6. Attempts `claude plugin marketplace add` + `claude plugin install` via CLI if available
45
42
 
46
- - **Symbols are nodes**functions, classes, interfaces, types, endpoints
47
- - **Relationships are edges** — `CALLS`, `IMPLEMENTS`, `IMPORTS`, `EXPORTS`, `CONTAINS`
48
- - **Community detection** — Louvain algorithm identifies architectural modules automatically
49
- - **Hybrid search** — Tantivy BM25 + vector embeddings + Reciprocal Rank Fusion, all on top of the graph
50
- - **Rust-native** — compiled binary, no Python/JS runtime overhead, sub-8ms average query latency
43
+ Skills are bundled inside the npm package no network fetch needed during install. The GitHub marketplace registration enables Claude to discover plugin updates automatically.
51
44
 
52
- The agent doesn't just search your code. It *remembers* it.
45
+ **No manual configuration needed** for Claude, Cursor, Codex, Windsurf, VS Code/Copilot, Hermes, OpenCode, or Kiro — just install or run with `npx`, then start exploring your codebase with your agent.
53
46
 
54
- ## Benchmarks
47
+ ## Claude Code Setup
55
48
 
56
- All four systems run on the same machine, same mempalace checkout, same 1,000 queries, same evaluator. Ground truth is extracted by Python's stdlib `ast` module — **not** from any tool's index — so no system gets a home-field advantage. Full reproduction scripts and raw results: [`benchmarks/fair/`](https://github.com/syncable-dev/memtrace-public/tree/main/benchmarks/fair).
49
+ The `npm install -g memtrace` command handles everything automatically. It registers the marketplace, installs the plugin, adds the MCP server, and writes skills to `~/.claude/skills/`.
57
50
 
58
- <img alt="Benchmark overview: Memtrace 96.7% Acc@1, 100% Acc@10, 9.16ms latency, 195 tokens — vs ChromaDB, GitNexus, CodeGrapher" src="https://raw.githubusercontent.com/syncable-dev/memtrace-public/main/assets/benchmarks/benchmark-overview.svg" width="720"/>
51
+ If you need to set it up manually, run these three commands:
59
52
 
60
- ### Results (1,000 Python symbol-lookup queries on mempalace)
53
+ ```bash
54
+ # 1. Register the memtrace marketplace (tells Claude where to find plugin updates)
55
+ claude plugin marketplace add https://github.com/syncable-dev/memtrace-public.git
61
56
 
62
- | Tool | Coverage | Acc@1 | Acc@5 | Acc@10 | Avg lat | Tokens |
63
- |:-----|---------:|------:|------:|-------:|--------:|-------:|
64
- | **Memtrace** (MemDB) | **100.0%** | **96.7%** | **100.0%** | **100.0%** | **9.16 ms** | 195 |
65
- | ChromaDB (all-MiniLM-L6-v2) | 100.0% | 62.3% | 86.1% | 87.9% | 58.5 ms | 1,937 |
66
- | GitNexus (eval-server) | 99.5% | 27.1% | 89.7% | 89.9% | 191.2 ms | 213 |
67
- | CodeGrapherContext (CLI) | 67.2% | 6.4% | 66.4% | 66.7% | 1627.2 ms | 221 |
57
+ # 2. Install the skills plugin (writes skills + enables them)
58
+ claude plugin install memtrace-skills@memtrace --scope user
68
59
 
69
- **What the numbers say, read fairly:**
60
+ # 3. Register the MCP server (gives Claude access to memtrace tools)
61
+ claude mcp add memtrace -- memtrace mcp
62
+ ```
70
63
 
71
- - **Memtrace** is exact-symbol lookup's sweet spot: 100% coverage, rank-1 hit in 96.7% of queries, and the correct file is in the top-10 every single time. 9 ms per query, 195 tokens per response.
72
- - **ChromaDB** shows what semantic embeddings look like for this workload — 88% top-10 but rank-1 is probabilistic, and the response is 10× larger because it returns 800-char chunks rather than symbol metadata.
73
- - **GitNexus** finds the right file 90% of the time — its response leads with execution *flows*, pushing standalone definitions down the list, which costs it rank-1 but not top-10.
74
- - **CodeGrapherContext**'s 67.2% coverage means its parser extracted two-thirds of the symbols Python's AST finds. Among symbols it did index, top-10 hit rate is excellent (~99%). Latency is dominated by CLI re-initialising FalkorDB per call.
64
+ This writes three things to `~/.claude/settings.json`:
75
65
 
76
- **Where each tool shines** — this benchmark measures exact-symbol lookup only. Different workloads produce different rankings: ChromaDB wins on natural-language queries, GitNexus on execution-flow traces, Memtrace on exact lookup / typo tolerance / temporal queries / cross-service API topology. See [`benchmarks/fair/README.md`](https://github.com/syncable-dev/memtrace-public/tree/main/benchmarks/fair/README.md) for a per-workload breakdown.
66
+ ```json
67
+ {
68
+ "mcpServers": {
69
+ "memtrace": {
70
+ "command": "memtrace",
71
+ "args": ["mcp"]
72
+ }
73
+ },
74
+ "enabledPlugins": {
75
+ "memtrace-skills@memtrace": true
76
+ },
77
+ "extraKnownMarketplaces": {
78
+ "memtrace": {
79
+ "source": {
80
+ "source": "git",
81
+ "url": "https://github.com/syncable-dev/memtrace-public.git"
82
+ }
83
+ }
84
+ }
85
+ }
86
+ ```
77
87
 
78
- <details>
79
- <summary><strong>Memtrace vs. general memory systems (Mem0, Graphiti)</strong></summary>
88
+ The `enabledPlugins` key activates the skill plugin. The `extraKnownMarketplaces` key registers the HTTPS Git marketplace so Claude can auto-discover updates. Skills are cached at `~/.claude/plugins/cache/memtrace/memtrace-skills/<version>/skills/` and also written to `~/.claude/skills/` for broader compatibility.
80
89
 
81
- <br/>
90
+ ## Supported Agent Integrations
82
91
 
83
- Mem0 and Graphiti are strong conversational memory engines designed for tracking entity knowledge (e.g. `User -> Likes -> Apples`). They excel at that. For code intelligence specifically, the tradeoff is that they rely on LLM inference to build their graphs which adds cost and time when processing thousands of source files.
92
+ `npm install -g memtrace` runs `memtrace-skills install` after the binary is installed. By default it configures every supported agent it can safely write to:
84
93
 
85
- **Graphiti** processes data through `add_episode()`, which triggers multiple LLM calls per episode entity extraction, relationship resolution, deduplication. At ~50 episodes/minute ([source](https://github.com/getzep/graphiti)), ingesting 1,500 code files takes **1–2 hours**.
94
+ | Agent / Editor | Skills or Guidance Written | MCP Config Written |
95
+ |:---------------|:---------------------------|:-------------------|
96
+ | **Claude Code** | `~/.claude/skills/` and Claude plugin cache | `~/.claude/settings.json` |
97
+ | **Claude Desktop** | Uses the same `~/.claude/skills/` files | Add `claude_desktop_config.json` manually if needed |
98
+ | **Cursor** | `~/.cursor/skills/` | `~/.cursor/mcp.json` |
99
+ | **Codex** | `~/.agents/skills/` | `~/.codex/config.toml` |
100
+ | **Windsurf** | `~/.codeium/windsurf/skills/` | `~/.codeium/windsurf/mcp_config.json` |
101
+ | **VS Code / Copilot** | `~/.copilot/skills/` | VS Code user `mcp.json` |
102
+ | **Hermes** | `~/.hermes/skills/` | `~/.hermes/config.yaml` |
103
+ | **OpenCode** | `~/.config/opencode/skills/` | `~/.config/opencode/opencode.json` |
104
+ | **Kiro** | `~/.kiro/steering/` auto steering files | `~/.kiro/settings/mcp.json` |
86
105
 
87
- **Mem0** processes data through `client.add()`, which queues async LLM extraction and conflict resolution per memory item ([source](https://mem0.ai)). Bulk ingestion with `infer=True` (default) means every file passes through an LLM pipeline. Throughput is bounded by your LLM provider's rate limits.
106
+ Limit the install to one or more agents:
88
107
 
89
- **Both** accumulate $10–50+ in API costs for large codebases because every relationship is inferred rather than parsed.
108
+ ```bash
109
+ npx memtrace-skills install --only claude,cursor,codex,windsurf,vscode,hermes,opencode,kiro
110
+ ```
90
111
 
91
- **Memtrace takes a different approach:** it 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. The tradeoff is that Memtrace is purpose-built for code — it doesn't handle conversational entity memory the way Mem0 and Graphiti do.
112
+ Install project-local config where the provider supports it:
92
113
 
93
- </details>
114
+ ```bash
115
+ npx memtrace-skills install --only claude,cursor,codex,vscode,opencode,kiro --local
116
+ ```
94
117
 
95
- <details>
96
- <summary><strong>Memtrace vs. code graphers (GitNexus, CodeGrapherContext)</strong></summary>
118
+ Project-local paths include `.claude/skills`, `.mcp.json`, `.cursor/skills`, `.cursor/mcp.json`, `.agents/skills`, `.codex/config.toml`, `.github/skills`, `.opencode/skills`, `.kiro/steering`, `.vscode/mcp.json`, `opencode.json`, and `.kiro/settings/mcp.json`. Windsurf MCP and Hermes skills/MCP are user-level by their current config models, so local installs write the user-level config and print a warning.
97
119
 
98
- <br/>
120
+ ### Skills (Installed Automatically)
99
121
 
100
- GitNexus and CodeGrapherContext both build AST-based code graphs with structural relationships — solid tools in the same space. Memtrace shares that foundation and extends it with temporal memory, API topology, and a Rust runtime:
122
+ Memtrace ships with 18 skills that teach agents how to use the knowledge graph effectively:
101
123
 
102
- | Capability | Memtrace | GitNexus | CodeGrapher |
103
- |:-----------|:---------|:---------|:------------|
104
- | AST-based graph | Yes | Yes | Yes |
105
- | Structural relationships (CALLS, IMPLEMENTS, IMPORTS) | Yes | Yes | Yes |
106
- | Bi-temporal version history per symbol | **Yes — 6 scoring modes** | Git-diff only | No |
107
- | Cross-service HTTP API topology | **Yes** | No | No |
108
- | Community detection (Louvain) | **Yes** | Yes | No |
109
- | Hybrid search (BM25 + vector + RRF) | **Yes — Tantivy + embeddings** | No | BM25 + optional embeddings |
110
- | Language | **Rust (compiled binary)** | JavaScript | Python |
111
- | Coverage (1K queries) | **100%** | 99.5% | 67.2% |
112
- | Acc@1 (1K queries) | **96.7%** | 27.1% | 6.4% |
113
- | Acc@10 (1K queries) | **100%** | 89.9% | 66.7% |
114
- | Query latency (1K queries) | **9.16 ms avg** | 191.2 ms avg | 1627.2 ms avg |
115
- | Tokens per query | **195 avg** | 213 avg | 221 avg |
116
- | Index time (~250 files / 2.3K nodes / 5.8K edges) | **~4 sec** (≈500 ms of graph work plus first-run local engine warmup) | ~6 sec | ~1 sec (cached) |
124
+ **Command Skills** (single-tool wrappers with usage guidance):
117
125
 
118
- All numbers from [the fair benchmark](https://github.com/syncable-dev/memtrace-public/tree/main/benchmarks/fair) on the same machine, same mempalace checkout, same 1,000 queries. Ground truth is extracted by Python's stdlib `ast` — not from any tool's index — so no system is advantaged in the dataset itself.
126
+ | Skill | Triggers on |
127
+ |-------|-------------|
128
+ | `memtrace-index` | "index this project", "set up code intelligence", "parse this codebase" |
129
+ | `memtrace-search` | "find this function", "where is X defined", "search for Y" |
130
+ | `memtrace-relationships` | "who calls this", "what does this call", "show class hierarchy" |
131
+ | `memtrace-evolution` | "what changed", "how did this evolve", "what's different since last week" |
132
+ | `memtrace-impact` | "what will break if I change this", "blast radius", "risk assessment" |
133
+ | `memtrace-quality` | "find dead code", "complexity hotspots", "code smells" |
134
+ | `memtrace-graph` | "show architecture", "find bottlenecks", "important functions" |
135
+ | `memtrace-api-topology` | "list API endpoints", "service dependencies", "who calls this API" |
136
+ | `memtrace-cochange` | "what changes with this", "hidden coupling", "historical dependency" |
119
137
 
120
- The latency difference is primarily Rust vs. interpreted runtimes, and MemDB's embedded native graph engine (in-process Node/Edge storage, bi-temporal predicates resolved at the storage layer, vector + lexical indexes co-located) vs. HTTP/embedding pipelines. The feature difference is temporal memory and API topology — dimensions Memtrace adds on top of the shared AST-graph foundation.
138
+ **Workflow Skills** (multi-step orchestrations):
121
139
 
122
- </details>
140
+ | Skill | Triggers on |
141
+ |-------|-------------|
142
+ | `memtrace-codebase-exploration` | "explore this codebase", "I'm new to this project", "give me an overview" |
143
+ | `memtrace-change-impact-analysis` | "what will break if I refactor this", "pre-change risk assessment" |
144
+ | `memtrace-code-review` | "review this PR", "post Memtrace review", "GitHub PR review" |
145
+ | `memtrace-incident-investigation` | "something broke", "root cause analysis", "what went wrong" |
146
+ | `memtrace-refactoring-guide` | "help me refactor", "reduce complexity", "clean up tech debt" |
147
+ | `memtrace-first` | "use Memtrace before file search", "source-code discovery policy" |
148
+ | `memtrace-continuous-memory` | "watch this repo", "keep the graph fresh while editing" |
149
+ | `memtrace-episode-replay` | "why does this code look this way", "replay implementation attempts" |
150
+ | `memtrace-session-continuity` | "continue", "catch me up", "what changed while away" |
123
151
 
124
- ## 25+ MCP Tools
152
+ ### Installing Skills Separately
125
153
 
126
- Memtrace exposes a full structural toolkit via the [Model Context Protocol](https://modelcontextprotocol.io):
154
+ If you installed memtrace via cargo or the skills weren't installed:
127
155
 
128
- <table>
129
- <tr>
130
- <td width="50%" valign="top">
156
+ ```bash
157
+ npx memtrace-skills install
158
+ ```
131
159
 
132
- **Search & Discovery**
133
- - `find_code` — hybrid BM25 + semantic search with RRF
134
- - `find_symbol` — exact/fuzzy name match with Levenshtein
160
+ To remove skills:
161
+
162
+ ```bash
163
+ npx memtrace-skills uninstall
164
+ ```
135
165
 
136
- **Relationships**
137
- - `analyze_relationships` — callers, callees, hierarchy, imports
138
- - `get_symbol_context` — 360° view in one call
166
+ ## Claude Desktop Setup
139
167
 
140
- **Impact Analysis**
141
- - `get_impact` — blast radius with risk rating
142
- - `detect_changes` — diff-to-symbols scope mapping
168
+ Skills are installed to `~/.claude/skills/` which is shared between Claude Code and Claude Desktop — both pick up memtrace skills after `npm install -g memtrace`.
143
169
 
144
- **Code Quality**
145
- - `find_dead_code` — zero-caller detection
146
- - `find_most_complex_functions` — complexity hotspots
147
- - `calculate_cyclomatic_complexity` — per-symbol scoring
148
- - `get_repository_stats` — repo-wide metrics
170
+ The plugin is enabled via `~/.claude/settings.json` (the `enabledPlugins` and `extraKnownMarketplaces` keys written by the installer), which is also shared.
149
171
 
150
- </td>
151
- <td width="50%" valign="top">
172
+ The only additional step for Claude Desktop is adding the MCP server to `claude_desktop_config.json`:
152
173
 
153
- **Temporal Analysis**
154
- - `get_evolution` — 6 scoring modes (compound, impact, novel, recent, directional, overview)
155
- - `get_timeline` — full symbol version history
156
- - `detect_changes` — diff-based impact scope
174
+ ```json
175
+ {
176
+ "mcpServers": {
177
+ "memtrace": {
178
+ "command": "memtrace",
179
+ "args": ["mcp"]
180
+ }
181
+ }
182
+ }
183
+ ```
157
184
 
158
- **Graph Algorithms**
159
- - `find_bridge_symbols` — betweenness centrality
160
- - `find_central_symbols` — PageRank / degree
161
- - `list_communities` — Louvain module detection
162
- - `list_processes` / `get_process_flow` — execution tracing
185
+ After that, Claude Desktop has both the skills (how to use memtrace) and the MCP tools (the actual capabilities).
163
186
 
164
- **API Topology**
165
- - `get_api_topology` — cross-repo HTTP call graph
166
- - `find_api_endpoints` — all exposed routes
167
- - `find_api_calls` — all outbound HTTP calls
187
+ ## MCP Tools
168
188
 
169
- **Indexing & Watch**
170
- - `index_directory` — parse, resolve, embed
171
- - `watch_directory` — live incremental re-indexing
172
- - `execute_cypher` — direct graph queries
189
+ Memtrace exposes 25+ tools via the MCP protocol:
173
190
 
174
- </td>
175
- </tr>
176
- </table>
191
+ **Indexing:** `index_directory`, `list_indexed_repositories`, `delete_repository`, `check_job_status`, `list_jobs`
177
192
 
178
- ## 18 Agent Skills
193
+ **Search:** `find_code` (hybrid BM25 + semantic), `find_symbol` (exact/fuzzy name match)
179
194
 
180
- Memtrace ships skills that teach agents *how* to use the graph. They fire automatically based on what you ask — no prompt engineering required.
195
+ **Relationships:** `analyze_relationships` (callers, callees, hierarchy, imports), `get_symbol_context` (360° view)
181
196
 
182
- | | Skill | You say... |
183
- |:--|:------|:-----------|
184
- | **Search** | `memtrace-search` | _"find this function"_, _"where is X defined"_ |
185
- | **Relationships** | `memtrace-relationships` | _"who calls this"_, _"show class hierarchy"_ |
186
- | **Evolution** | `memtrace-evolution` | _"what changed this week"_, _"how did this evolve"_ |
187
- | **Impact** | `memtrace-impact` | _"what breaks if I change this"_, _"blast radius"_ |
188
- | **Quality** | `memtrace-quality` | _"find dead code"_, _"complexity hotspots"_ |
189
- | **Architecture** | `memtrace-graph` | _"show me the architecture"_, _"find bottlenecks"_ |
190
- | **APIs** | `memtrace-api-topology` | _"list API endpoints"_, _"service dependencies"_ |
191
- | **Index** | `memtrace-index` | _"index this project"_, _"parse this codebase"_ |
192
- | **Co-change** | `memtrace-cochange` | _"what else changes with this"_, _"hidden coupling"_ |
193
-
194
- Plus **9 workflow skills** that chain multiple tools with decision logic:
195
-
196
- | Skill | You say... |
197
- |:------|:-----------|
198
- | `memtrace-codebase-exploration` | _"I'm new to this project"_, _"give me an overview"_ |
199
- | `memtrace-change-impact-analysis` | _"what will break if I refactor this"_ |
200
- | `memtrace-code-review` | _"review this PR"_, _"post Memtrace review"_ |
201
- | `memtrace-incident-investigation` | _"something broke"_, _"root cause analysis"_ |
202
- | `memtrace-refactoring-guide` | _"help me refactor"_, _"clean up tech debt"_ |
203
- | `memtrace-first` | _"use Memtrace before file search"_ |
204
- | `memtrace-continuous-memory` | _"watch this repo"_, _"keep the graph fresh"_ |
205
- | `memtrace-episode-replay` | _"why does this code look this way"_ |
206
- | `memtrace-session-continuity` | _"continue"_, _"catch me up"_ |
207
-
208
- ## Temporal Engine
209
-
210
- Six scoring algorithms for different temporal questions:
211
-
212
- | Mode | Best for |
213
- |:-----|:---------|
214
- | **`compound`** | General-purpose _"what changed?"_ — weighted blend of impact, novelty, recency |
215
- | **`impact`** | _"What broke?"_ — ranks by blast radius (`in_degree^0.7 × (1 + out_degree)^0.3`) |
216
- | **`novel`** | _"What's unexpected?"_ — anomaly detection via surprise scoring |
217
- | **`recent`** | _"What changed near the incident?"_ — exponential time decay |
218
- | **`directional`** | _"What was added vs removed?"_ — asymmetric scoring |
219
- | **`overview`** | Quick module-level summary |
220
-
221
- Uses **Structural Significance Budgeting** to surface the minimum set of changes covering ≥80% of total significance.
222
-
223
- ## Compatibility
224
-
225
- | Editor / Agent | MCP Tools (25+) | Skills / Guidance | Install |
226
- |:---------------|:---------------:|:-----------:|:--------|
227
- | **Claude Code** | ✅ | ✅ | `npm install -g memtrace` — fully automatic |
228
- | **Claude Desktop** | ✅ | ✅ | Automatic — shared with Claude Code |
229
- | **Cursor** (v2.4+) | ✅ | ✅ | `npm install -g memtrace` — fully automatic |
230
- | **Codex CLI** | ✅ | ✅ | `npm install -g memtrace` — fully automatic |
231
- | **Windsurf** | ✅ | ✅ | `npm install -g memtrace` — fully automatic |
232
- | **VS Code (Copilot)** | ✅ | ✅ | `npm install -g memtrace` — fully automatic |
233
- | **Hermes** | ✅ | ✅ | `npm install -g memtrace` — fully automatic |
234
- | **OpenCode** | ✅ | ✅ | `npm install -g memtrace` — fully automatic |
235
- | **Kiro** | ✅ | Steering | `npm install -g memtrace` — fully automatic |
236
- | **Cline / Roo Code** | ✅ | — | Add MCP server manually |
237
- | **Any MCP client** | ✅ | — | Add MCP server manually |
238
-
239
- > **MCP tools** work with any editor or agent that supports the [Model Context Protocol](https://modelcontextprotocol.io). **Skills** are workflow prompts that teach the agent *how* to chain tools. Kiro does not use `SKILL.md`, so Memtrace writes equivalent auto steering files instead.
240
-
241
- ## Setup
242
-
243
- ### Claude Code + Claude Desktop
244
-
245
- `npm install -g memtrace` handles everything automatically — binary, 18 skills, MCP server, plugin, and marketplace all register in one command for both Claude Code and Claude Desktop.
246
-
247
- For manual setup:
197
+ **Impact:** `get_impact` (blast radius), `detect_changes` (diff-based scope)
248
198
 
249
- ```bash
250
- claude plugin marketplace add https://github.com/syncable-dev/memtrace-public.git
251
- claude plugin install memtrace-skills@memtrace --scope user
252
- claude mcp add memtrace -- memtrace mcp
253
- ```
199
+ **Temporal:** `get_evolution` (modes: `recent`, `compound`, `summary`, `overview`), `get_timeline`, `get_changes_since`, `get_episode_replay`, `get_cochange_context`
254
200
 
255
- ### Cursor
201
+ **Quality:** `find_dead_code`, `calculate_cyclomatic_complexity`, `find_most_complex_functions`, `get_repository_stats`
256
202
 
257
- Cursor **v2.4+** supports Agent Skills natively, and `npm install -g memtrace` handles everything automatically — no separate Cursor plugin is needed because Cursor reads the same `SKILL.md` format as Claude.
203
+ **Graph Algorithms:** `find_bridge_symbols` (betweenness centrality), `find_central_symbols` (PageRank), `list_communities` (Louvain), `list_processes`, `get_process_flow`
258
204
 
259
- What the installer writes:
260
- - **MCP server** → `~/.cursor/mcp.json` (global — works in every project you open)
261
- - **18 skills/workflows** → `~/.cursor/skills/memtrace-*/SKILL.md`
205
+ **API Topology:** `get_api_topology`, `find_api_endpoints`, `find_api_calls`, `link_repositories`
262
206
 
263
- For a **project-local** install (so the skills travel with your repo and teammates get them on clone), run inside the project:
207
+ **Watch:** `watch_directory` (live incremental re-indexing), `list_watched_paths`
264
208
 
265
- ```bash
266
- npx memtrace-skills install --only cursor --local
267
- ```
209
+ **Low-level:** `execute_cypher` (read-only Cypher queries)
268
210
 
269
- ### Codex, Windsurf, VS Code, Hermes, OpenCode, and Kiro
211
+ ## `get_evolution` modes
270
212
 
271
- The installer also writes skills/guidance and MCP configuration for the newer agent surfaces:
213
+ | Mode | Use case |
214
+ |------|----------|
215
+ | `recent` | Per-episode changelog (default); supports `file_path`, `kind`, pagination |
216
+ | `compound` | Top changed files + top touched symbols |
217
+ | `summary` / `overview` | Totals + first/last episode metadata |
272
218
 
273
- | Agent | Global skills / guidance | Global MCP config | Project-local support |
274
- |:------|:-------------------------|:------------------|:----------------------|
275
- | **Codex** | `~/.agents/skills/` | `~/.codex/config.toml` | `.agents/skills/`, `.codex/config.toml` |
276
- | **Windsurf** | `~/.codeium/windsurf/skills/` | `~/.codeium/windsurf/mcp_config.json` | `.windsurf/skills/`; MCP remains user-level |
277
- | **VS Code / Copilot** | `~/.copilot/skills/` | VS Code user `mcp.json` | `.github/skills/`, `.vscode/mcp.json` |
278
- | **Hermes** | `~/.hermes/skills/` | `~/.hermes/config.yaml` | user-level only |
279
- | **OpenCode** | `~/.config/opencode/skills/` | `~/.config/opencode/opencode.json` | `.opencode/skills/`, `opencode.json` |
280
- | **Kiro** | `~/.kiro/steering/` | `~/.kiro/settings/mcp.json` | `.kiro/steering/`, `.kiro/settings/mcp.json` |
219
+ Requires `repo_id` + `from` (e.g. `"90d ago"`). Never pass `days`.
281
220
 
282
- Install only selected integrations:
221
+ ## Performance Benchmarking
283
222
 
284
- ```bash
285
- npx memtrace-skills install --only codex,windsurf,vscode,hermes,opencode,kiro
286
- ```
223
+ All benchmarks below were measured live on the same machine, same codebase ([mempalace](https://github.com/mempalace/mempalace)), same 1,000 queries. Every system ran in its recommended production mode — no mocking, no hardcoded numbers. Raw results and reproduction scripts are in [`benchmarks/`](benchmarks/).
287
224
 
288
- Install project-local config where supported:
225
+ ### Search Accuracy & Latency (1,000 queries)
289
226
 
290
- ```bash
291
- npx memtrace-skills install --only codex,vscode,opencode,kiro --local
292
- ```
227
+ | System | Accuracy (Acc@1) | Avg Latency | P95 Latency | Avg Tokens/Query | n |
228
+ |:-------|:-----------------|:------------|:------------|:-----------------|:--|
229
+ | **Memtrace** | **97.3%** | **13.4 ms** | **16.5 ms** | **319** | 1,000 |
230
+ | ChromaDB | 89.6% | 60.6 ms | 76.8 ms | 1,912 | 1,000 |
231
+ | GitNexus | 12.8% | 172.7 ms | 221.5 ms | 254 | 1,000 |
232
+ | CodeGrapherContext | 0.0%† | 510.5 ms | 753.5 ms | 23 | 50 |
293
233
 
294
- ### Other MCP Clients
234
+ > [!IMPORTANT]
235
+ > **Understanding the Accuracy Scores:** This benchmark measures **Structural Location Precision** (finding the exact file path).
236
+ > - **Memtrace** is optimized for "Sniper" lookups—returning the exact file and line for every symbol.
237
+ > - **GitNexus** and **CGC** optimize for "Discovery"—returning symbol names or execution flows which often omit the direct file path in their CLI outputs. Their lower scores reflect a **design mismatch with this specific automated test**, not necessarily a failure of their underlying search engine.
295
238
 
296
- For Cline, Roo Code, or any client that only needs MCP tools, add this server manually:
239
+ **Methodology:** 1,000 unique symbols sampled from the indexed graph. Accuracy = "expected file path appears in response." Latency = wall-clock `time.time()` including protocol overhead.
240
+ - † CGC's CLI returns names without paths, resulting in 0% in this specific validation script.
241
+ - GitNexus returns "Flow" stories; our script only credits results where a path is explicitly present.
297
242
 
298
- ```json
299
- {
300
- "mcpServers": {
301
- "memtrace": {
302
- "command": "memtrace",
303
- "args": ["mcp"]
304
- }
305
- }
306
- }
307
- ```
243
+ ### Token Reduction (Context Window Efficiency)
308
244
 
309
- <details>
310
- <summary>Config file locations by editor</summary>
245
+ Over 1,000 queries, total tokens injected into the agent's context window:
311
246
 
312
- | Editor | Config file |
313
- |:-------|:------------|
314
- | **Windsurf** | `~/.codeium/windsurf/mcp_config.json` |
315
- | **VS Code (Copilot)** | `.vscode/mcp.json` in your project root |
316
- | **Codex** | `~/.codex/config.toml` or `.codex/config.toml` |
317
- | **Hermes** | `~/.hermes/config.yaml` |
318
- | **OpenCode** | `~/.config/opencode/opencode.json` or project `opencode.json` |
319
- | **Kiro** | `~/.kiro/settings/mcp.json` or `.kiro/settings/mcp.json` |
320
- | **Cline** | Cline MCP settings in the extension panel |
247
+ | System | Avg Tokens/Query | Total Tokens (1K queries) | Reduction vs ChromaDB |
248
+ |:-------|:-----------------|:--------------------------|:----------------------|
249
+ | **Memtrace** | **319** | **318,876** | **83.3% fewer tokens** |
250
+ | ChromaDB (Sentence Transformers) | 1,912 | 1,911,500 | (baseline) |
251
+ | GitNexus | 254 | 254,416 | 86.7%† |
321
252
 
322
- </details>
253
+ > † GitNexus returns fewer tokens than Memtrace — but with only 12.8% accuracy. Compact results that point to the wrong files waste the agent's reasoning budget. **Memtrace returns compact *and* accurate context.**
323
254
 
324
- ### Uninstall
255
+ **Why this matters:** Every token in the agent's context window costs inference time and money. ChromaDB dumps 10 chunks of ~800 characters per query regardless of relevance. Memtrace returns only the matching symbol's structural block — the exact function, class, or interface the agent asked for. Over a coding session with hundreds of queries, this is the difference between staying within context limits and hitting token ceilings that force expensive re-summarization.
325
256
 
326
- ```bash
327
- memtrace uninstall # removes skills, MCP server, plugin, and settings
328
- npm uninstall -g memtrace # removes the binary
329
- ```
257
+ ### Memtrace vs. General Memory Systems (Mem0, Graphiti)
258
+ 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.
330
259
 
331
- Already ran `npm uninstall` first? The cleanup script is persisted at `~/.memtrace/uninstall.js`:
260
+ **Why they can't index codebases:**
261
+ - **Graphiti** processes data through `add_episode()`, which triggers multiple LLM calls per episode (entity extraction, relationship resolution, deduplication). At its documented default throughput of ~50 episodes/minute ([source](https://github.com/getzep/graphiti)), ingesting 1,500 code files would take **30+ minutes** — and each file may chunk into multiple episodes, pushing real-world times to **1–2 hours**. Every episode costs LLM tokens.
262
+ - **Mem0** processes data through `client.add()`, which queues asynchronous LLM extraction and conflict resolution per memory item ([source](https://mem0.ai)). Bulk code ingestion with `infer=True` (default) means every file passes through an LLM distillation pipeline. Throughput is bounded entirely by your LLM provider's rate limits.
263
+ - **Both** accumulate significant API costs ($10–50+ depending on model and file count) because they use LLMs to *guess* code relationships rather than parsing them deterministically.
332
264
 
333
- ```bash
334
- node ~/.memtrace/uninstall.js
335
- ```
265
+ **Memtrace indexes 1,500 files in 1.2–1.8 seconds for $0.00** — no LLM calls, no API costs, no rate limits. It compiles native Tree-sitter AST parsers and resolves deterministic symbol references (`CALLS`, `IMPLEMENTS`, `IMPORTS`) locally.
336
266
 
337
- ### A note on install
267
+ ## Requirements
338
268
 
339
- `npm install -g memtrace` ships a small main package + a platform-specific binary (one of `@memtrace/darwin-arm64`, `@memtrace/linux-x64`, or `@memtrace/win32-x64`) that npm picks automatically.
269
+ - **Node.js 18** for npm installation
270
+ - **Git** — for temporal analysis (commit history)
271
+ - **MemDB** — bundled graph + vector backend used by the CLI; no Docker required for normal Memtrace usage
340
272
 
341
- Most setups just work. If `memtrace start` ever says **"Could not find binary for your platform"**, any of these will fix it:
273
+ ## Development
342
274
 
343
275
  ```bash
344
- # Option 1 — re-run install, asking npm to keep optional deps
345
- npm install -g memtrace --include=optional
276
+ # Build from source
277
+ cargo build --release --bin memtrace
346
278
 
347
- # Option 2 refresh from latest
348
- memtrace install # built-in self-update
349
- # or:
350
- npm install -g memtrace@latest --force
279
+ # Run the MCP server
280
+ cargo run --release --bin memtrace -- mcp
351
281
 
352
- # Option 3 — install the platform binary directly (Apple Silicon shown — swap for your platform)
353
- npm install -g @memtrace/darwin-arm64
282
+ # Run the local runtime without Docker
283
+ cargo run --release --bin memtrace -- start --headless
354
284
  ```
355
285
 
356
- This typically only happens on machines where npm is configured to skip optional dependencies (some corporate npmrc setups, certain CI caches). Postinstall self-heals on most installs; the options above cover the rest.
286
+ ## Workspace-local data (`.memdb/`)
357
287
 
358
- ## Languages
288
+ The MemDB on-disk index lives in a workspace-local directory by default — `./.memdb/` relative to where you ran `memtrace start` or `memtrace index`. Each repository owns its own data dir, the dir is fully self-contained, and copying the workspace preserves the index.
359
289
 
360
- Rust · Go · TypeScript · JavaScript · Python · Java · C · C++ · C# · Swift · Kotlin · Ruby · PHP · Dart · Scala · Perl — and more via Tree-sitter.
290
+ Add `.memdb/` to your project's `.gitignore` so the index doesn't end up in a commit:
361
291
 
362
- ## Requirements
292
+ ```gitignore
293
+ # Memtrace MemDB on-disk index
294
+ .memdb/
295
+ ```
363
296
 
364
- Memtrace does parsing, graph construction, and embedding generation locally. Expect the first index to use noticeable CPU and memory; follow-up queries and incremental indexing are much lighter.
297
+ If you previously ran Memtrace with the legacy global default (`/tmp/memdb-memtrace`), the binary will print a one-line migration notice on next boot. Copy or symlink the legacy directory to `./.memdb` to keep your indexed graphs, or run `memtrace reset` to start fresh.
365
298
 
366
- | Requirement | Minimum | Recommended |
367
- |:------------|:--------|:------------|
368
- | **CPU** | 4 cores | 8+ cores for large monorepos |
369
- | **Memory** | 8 GB RAM | 16–32 GB RAM |
370
- | **Disk** | 5 GB free | 10–20 GB free for large repositories |
371
- | **GPU** | Not required | Not required |
372
- | **Node.js** | ≥ 18 | Current LTS |
373
- | **Git** | Required for temporal analysis | Full repository history for best results |
299
+ Override the location with `MEMTRACE_MEMDB_DATA_DIR=/path/to/your/data-dir` if you need a custom path (CI caches, shared volumes, etc).
374
300
 
375
- <br/>
301
+ ## License
376
302
 
377
- <p align="center">
378
- <a href="https://memtrace.io">Documentation</a> · <a href="https://www.npmjs.com/package/memtrace">npm</a> · <a href="https://github.com/syncable-dev/memtrace-public/issues">Issues</a>
379
- </p>
303
+ Proprietary EULA — Free to use. See [LICENSE](https://github.com/syncable-dev/memtrace-public/blob/main/LICENSE).
380
304
 
381
- <p align="center">
382
- <sub>Built by <a href="https://syncable.dev">Syncable</a> · <a href="https://github.com/syncable-dev/memtrace-public/blob/main/LICENSE">Proprietary EULA</a> · Free to use</sub>
383
- </p>
305
+ <!-- Memtrace contributor attribution smoke: 2026-05-23 -->