memtrace 0.7.25 → 0.8.1
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.
- package/README.md +209 -287
- package/install.js +9 -6
- package/installer/package.json +1 -1
- package/installer/skills/commands/memtrace-api-topology.md +31 -34
- package/installer/skills/commands/memtrace-cochange.md +64 -33
- package/installer/skills/commands/memtrace-daily.md +73 -0
- package/installer/skills/commands/memtrace-decision-recall.md +91 -0
- package/installer/skills/commands/memtrace-evolution.md +121 -88
- package/installer/skills/commands/memtrace-fleet-publish-intent.md +18 -2
- package/installer/skills/commands/memtrace-fleet-record-episode.md +23 -2
- package/installer/skills/commands/memtrace-fleet-resolve.md +24 -1
- package/installer/skills/commands/memtrace-graph.md +59 -41
- package/installer/skills/commands/memtrace-impact.md +67 -19
- package/installer/skills/commands/memtrace-index.md +20 -3
- package/installer/skills/commands/memtrace-intent-verification.md +81 -0
- package/installer/skills/commands/memtrace-preflight.md +85 -0
- package/installer/skills/commands/memtrace-provenance.md +90 -0
- package/installer/skills/commands/memtrace-quality.md +49 -32
- package/installer/skills/commands/memtrace-relationships.md +73 -30
- package/installer/skills/commands/memtrace-search.md +86 -61
- package/installer/skills/workflows/memtrace-change-impact-analysis.md +32 -12
- package/installer/skills/workflows/memtrace-code-review.md +17 -11
- package/installer/skills/workflows/memtrace-codebase-exploration.md +41 -5
- package/installer/skills/workflows/memtrace-continuous-memory.md +54 -56
- package/installer/skills/workflows/memtrace-decision-memory.md +139 -0
- package/installer/skills/workflows/memtrace-episode-replay.md +87 -63
- package/installer/skills/workflows/memtrace-first.md +63 -7
- package/installer/skills/workflows/memtrace-fleet-coordination.md +21 -1
- package/installer/skills/workflows/memtrace-fleet-first.md +35 -5
- package/installer/skills/workflows/memtrace-incident-investigation.md +113 -55
- package/installer/skills/workflows/memtrace-refactoring-guide.md +31 -11
- package/installer/skills/workflows/memtrace-session-continuity.md +63 -49
- package/installer/skills/workflows/memtrace-style-fingerprint.md +27 -4
- package/package.json +7 -7
- package/skills/commands/memtrace-api-topology.md +31 -34
- package/skills/commands/memtrace-cochange.md +64 -33
- package/skills/commands/memtrace-daily.md +73 -0
- package/skills/commands/memtrace-decision-recall.md +91 -0
- package/skills/commands/memtrace-evolution.md +121 -88
- package/skills/commands/memtrace-fleet-publish-intent.md +18 -2
- package/skills/commands/memtrace-fleet-record-episode.md +23 -2
- package/skills/commands/memtrace-fleet-resolve.md +24 -1
- package/skills/commands/memtrace-graph.md +59 -41
- package/skills/commands/memtrace-impact.md +67 -19
- package/skills/commands/memtrace-index.md +20 -3
- package/skills/commands/memtrace-intent-verification.md +81 -0
- package/skills/commands/memtrace-preflight.md +85 -0
- package/skills/commands/memtrace-provenance.md +90 -0
- package/skills/commands/memtrace-quality.md +49 -32
- package/skills/commands/memtrace-relationships.md +73 -30
- package/skills/commands/memtrace-search.md +86 -61
- package/skills/workflows/memtrace-change-impact-analysis.md +32 -12
- package/skills/workflows/memtrace-code-review.md +17 -11
- package/skills/workflows/memtrace-codebase-exploration.md +41 -5
- package/skills/workflows/memtrace-continuous-memory.md +54 -56
- package/skills/workflows/memtrace-decision-memory.md +139 -0
- package/skills/workflows/memtrace-episode-replay.md +87 -63
- package/skills/workflows/memtrace-first.md +63 -7
- package/skills/workflows/memtrace-fleet-coordination.md +21 -1
- package/skills/workflows/memtrace-fleet-first.md +35 -5
- package/skills/workflows/memtrace-incident-investigation.md +113 -55
- package/skills/workflows/memtrace-refactoring-guide.md +31 -11
- package/skills/workflows/memtrace-session-continuity.md +63 -49
- package/skills/workflows/memtrace-style-fingerprint.md +27 -4
package/README.md
CHANGED
|
@@ -1,383 +1,305 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
13
|
+
Or pin Memtrace to one project so teammates use the same CLI version:
|
|
25
14
|
|
|
26
15
|
```bash
|
|
27
|
-
npm install -
|
|
28
|
-
memtrace start
|
|
16
|
+
npm install --save-dev memtrace
|
|
17
|
+
npx memtrace start
|
|
29
18
|
```
|
|
30
19
|
|
|
31
|
-
|
|
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
|
-
|
|
25
|
+
memtrace start
|
|
36
26
|
|
|
37
|
-
|
|
27
|
+
# Index your project
|
|
28
|
+
memtrace index /path/to/your/project
|
|
38
29
|
|
|
39
|
-
|
|
30
|
+
# Start the MCP server (for direct use)
|
|
31
|
+
memtrace mcp
|
|
32
|
+
```
|
|
40
33
|
|
|
41
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
47
|
+
## Claude Code Setup
|
|
55
48
|
|
|
56
|
-
|
|
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
|
-
|
|
51
|
+
If you need to set it up manually, run these three commands:
|
|
59
52
|
|
|
60
|
-
|
|
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
|
-
|
|
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
|
-
|
|
60
|
+
# 3. Register the MCP server (gives Claude access to memtrace tools)
|
|
61
|
+
claude mcp add memtrace -- memtrace mcp
|
|
62
|
+
```
|
|
70
63
|
|
|
71
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
90
|
+
## Supported Agent Integrations
|
|
82
91
|
|
|
83
|
-
|
|
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
|
-
|
|
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
|
-
|
|
106
|
+
Limit the install to one or more agents:
|
|
88
107
|
|
|
89
|
-
|
|
108
|
+
```bash
|
|
109
|
+
npx memtrace-skills install --only claude,cursor,codex,windsurf,vscode,hermes,opencode,kiro
|
|
110
|
+
```
|
|
90
111
|
|
|
91
|
-
|
|
112
|
+
Install project-local config where the provider supports it:
|
|
92
113
|
|
|
93
|
-
|
|
114
|
+
```bash
|
|
115
|
+
npx memtrace-skills install --only claude,cursor,codex,vscode,opencode,kiro --local
|
|
116
|
+
```
|
|
94
117
|
|
|
95
|
-
|
|
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
|
-
|
|
120
|
+
### Skills (Installed Automatically)
|
|
99
121
|
|
|
100
|
-
|
|
122
|
+
Memtrace ships with 18 skills that teach agents how to use the knowledge graph effectively:
|
|
101
123
|
|
|
102
|
-
|
|
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
|
-
|
|
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
|
-
|
|
138
|
+
**Workflow Skills** (multi-step orchestrations):
|
|
121
139
|
|
|
122
|
-
|
|
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
|
-
|
|
152
|
+
### Installing Skills Separately
|
|
125
153
|
|
|
126
|
-
|
|
154
|
+
If you installed memtrace via cargo or the skills weren't installed:
|
|
127
155
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
156
|
+
```bash
|
|
157
|
+
npx memtrace-skills install
|
|
158
|
+
```
|
|
131
159
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
160
|
+
To remove skills:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
npx memtrace-skills uninstall
|
|
164
|
+
```
|
|
135
165
|
|
|
136
|
-
|
|
137
|
-
- `analyze_relationships` — callers, callees, hierarchy, imports
|
|
138
|
-
- `get_symbol_context` — 360° view in one call
|
|
166
|
+
## Claude Desktop Setup
|
|
139
167
|
|
|
140
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
174
|
+
```json
|
|
175
|
+
{
|
|
176
|
+
"mcpServers": {
|
|
177
|
+
"memtrace": {
|
|
178
|
+
"command": "memtrace",
|
|
179
|
+
"args": ["mcp"]
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
```
|
|
157
184
|
|
|
158
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
175
|
-
</tr>
|
|
176
|
-
</table>
|
|
191
|
+
**Indexing:** `index_directory`, `list_indexed_repositories`, `delete_repository`, `check_job_status`, `list_jobs`
|
|
177
192
|
|
|
178
|
-
|
|
193
|
+
**Search:** `find_code` (hybrid BM25 + semantic), `find_symbol` (exact/fuzzy name match)
|
|
179
194
|
|
|
180
|
-
|
|
195
|
+
**Relationships:** `analyze_relationships` (callers, callees, hierarchy, imports), `get_symbol_context` (360° view)
|
|
181
196
|
|
|
182
|
-
|
|
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
|
-
|
|
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
|
-
|
|
201
|
+
**Quality:** `find_dead_code`, `calculate_cyclomatic_complexity`, `find_most_complex_functions`, `get_repository_stats`
|
|
256
202
|
|
|
257
|
-
|
|
203
|
+
**Graph Algorithms:** `find_bridge_symbols` (betweenness centrality), `find_central_symbols` (PageRank), `list_communities` (Louvain), `list_processes`, `get_process_flow`
|
|
258
204
|
|
|
259
|
-
|
|
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
|
-
|
|
207
|
+
**Watch:** `watch_directory` (live incremental re-indexing), `list_watched_paths`
|
|
264
208
|
|
|
265
|
-
|
|
266
|
-
npx memtrace-skills install --only cursor --local
|
|
267
|
-
```
|
|
209
|
+
**Low-level:** `execute_cypher` (read-only Cypher queries)
|
|
268
210
|
|
|
269
|
-
|
|
211
|
+
## `get_evolution` modes
|
|
270
212
|
|
|
271
|
-
|
|
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
|
-
|
|
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
|
-
|
|
221
|
+
## Performance Benchmarking
|
|
283
222
|
|
|
284
|
-
|
|
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
|
-
|
|
225
|
+
### Search Accuracy & Latency (1,000 queries)
|
|
289
226
|
|
|
290
|
-
|
|
291
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
299
|
-
{
|
|
300
|
-
"mcpServers": {
|
|
301
|
-
"memtrace": {
|
|
302
|
-
"command": "memtrace",
|
|
303
|
-
"args": ["mcp"]
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
```
|
|
243
|
+
### Token Reduction (Context Window Efficiency)
|
|
308
244
|
|
|
309
|
-
|
|
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
|
-
|
|
|
313
|
-
|
|
314
|
-
| **
|
|
315
|
-
|
|
|
316
|
-
|
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
327
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
267
|
+
## Requirements
|
|
338
268
|
|
|
339
|
-
|
|
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
|
-
|
|
273
|
+
## Development
|
|
342
274
|
|
|
343
275
|
```bash
|
|
344
|
-
#
|
|
345
|
-
|
|
276
|
+
# Build from source
|
|
277
|
+
cargo build --release --bin memtrace
|
|
346
278
|
|
|
347
|
-
#
|
|
348
|
-
memtrace
|
|
349
|
-
# or:
|
|
350
|
-
npm install -g memtrace@latest --force
|
|
279
|
+
# Run the MCP server
|
|
280
|
+
cargo run --release --bin memtrace -- mcp
|
|
351
281
|
|
|
352
|
-
#
|
|
353
|
-
|
|
282
|
+
# Run the local runtime without Docker
|
|
283
|
+
cargo run --release --bin memtrace -- start --headless
|
|
354
284
|
```
|
|
355
285
|
|
|
356
|
-
|
|
286
|
+
## Workspace-local data (`.memdb/`)
|
|
357
287
|
|
|
358
|
-
|
|
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
|
-
|
|
290
|
+
Add `.memdb/` to your project's `.gitignore` so the index doesn't end up in a commit:
|
|
361
291
|
|
|
362
|
-
|
|
292
|
+
```gitignore
|
|
293
|
+
# Memtrace MemDB on-disk index
|
|
294
|
+
.memdb/
|
|
295
|
+
```
|
|
363
296
|
|
|
364
|
-
Memtrace
|
|
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
|
-
|
|
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
|
-
|
|
301
|
+
## License
|
|
376
302
|
|
|
377
|
-
|
|
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
|
-
|
|
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 -->
|