remem-mcp 0.6.2 → 0.6.4
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 +85 -125
- package/dist/chunk-FA324IBN.js +903 -0
- package/dist/chunk-FA324IBN.js.map +1 -0
- package/dist/{chunk-ULMM6LKD.js → chunk-X4ECGLYH.js} +60 -16
- package/dist/chunk-X4ECGLYH.js.map +1 -0
- package/dist/chunk-XK4Y53J2.js +54 -0
- package/dist/chunk-XK4Y53J2.js.map +1 -0
- package/dist/{engine-EIOBO7ZE.js → engine-LVKGZHBY.js} +5 -2
- package/dist/index.js +1234 -185
- package/dist/index.js.map +1 -1
- package/dist/resolver-AVK7XKX7.js +300 -0
- package/dist/resolver-AVK7XKX7.js.map +1 -0
- package/dist/sdk.js +3 -2
- package/dist/storage/schema.sql +6 -2
- package/package.json +1 -2
- package/scripts/dogfood-claude-cli.sh +156 -0
- package/scripts/dogfood-codex.sh +145 -0
- package/skills/remem-mcp/SKILL.md +45 -91
- package/dist/chunk-SHLLMMMU.js +0 -480
- package/dist/chunk-SHLLMMMU.js.map +0 -1
- package/dist/chunk-ULMM6LKD.js.map +0 -1
- /package/dist/{engine-EIOBO7ZE.js.map → engine-LVKGZHBY.js.map} +0 -0
package/README.md
CHANGED
|
@@ -11,37 +11,84 @@ Local memory that survives context compaction — learns from every error, injec
|
|
|
11
11
|
|
|
12
12
|
**One command setup. No API key. No cloud. No database server. Just a SQLite file.**
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
---
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
## Install
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
```bash
|
|
19
|
+
npx remem-mcp setup
|
|
20
|
+
```
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
|---|---|---|
|
|
22
|
-
|  |  |  |
|
|
22
|
+
Auto-detects Claude Code, Cursor, Devin, Codex. Registers MCP server + hooks. Restart your agent.
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
```bash
|
|
25
|
+
npx remem-mcp demo # Live demo: real build, real errors, real hooks
|
|
26
|
+
npx remem-mcp demo-codegraph # Live CodeGraph demo on facebook/react
|
|
27
|
+
npx remem-mcp status # One dashboard: everything at a glance
|
|
28
|
+
```
|
|
27
29
|
|
|
28
30
|
---
|
|
29
31
|
|
|
30
|
-
##
|
|
32
|
+
## Quick start (after install)
|
|
33
|
+
|
|
34
|
+
**Nothing.** Just use your agent normally. No commands, no setup, no init.
|
|
35
|
+
|
|
36
|
+
Memory works automatically:
|
|
37
|
+
- **Session start** → past errors, decisions, and persona injected into agent context
|
|
38
|
+
- **Each prompt** → matching memory injected (you'll see `[remem-mcp]` at the top)
|
|
39
|
+
- **Session end** → worker auto-extracts facts, consolidates summaries, updates persona
|
|
31
40
|
|
|
32
41
|
```bash
|
|
33
|
-
npx remem-mcp
|
|
42
|
+
npx remem-mcp status # verify: hooks ✓, DB ✓, CodeGraph ✓
|
|
34
43
|
```
|
|
35
44
|
|
|
36
|
-
|
|
45
|
+
---
|
|
37
46
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
## What it does
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
┌─────────────────────────────────────────────────┐
|
|
51
|
+
│ AI Agent │
|
|
52
|
+
│ (Claude Code / Devin / Cursor) │
|
|
53
|
+
└────────┬──────────────────────────┬──────────────┘
|
|
54
|
+
│ MCP tools (15) │ Hooks (auto)
|
|
55
|
+
▼ ▼
|
|
56
|
+
┌──────────────────┐ ┌────────────────────┐
|
|
57
|
+
│ recall() │ │ SessionStart │──▶ inject L2/L3 + skills
|
|
58
|
+
│ capture() │ │ UserPromptSubmit │──▶ inject BM25 match
|
|
59
|
+
│ codegraph_* │ │ Stop │──▶ spawn worker
|
|
60
|
+
│ wiki_* │ │ PostCompact │──▶ save checkpoint
|
|
61
|
+
└────────┬─────────┘ └─────────┬──────────┘
|
|
62
|
+
│ │
|
|
63
|
+
▼ ▼
|
|
64
|
+
┌─────────────────────────────────────────────────┐
|
|
65
|
+
│ SQLite (memory.db) │
|
|
66
|
+
│ │
|
|
67
|
+
│ L0 captures ──▶ L1 atoms ──▶ L2 scenarios ──▶ L3 persona
|
|
68
|
+
│ (raw) (facts) (summaries) (preferences)
|
|
69
|
+
│ │
|
|
70
|
+
│ CodeGraph: symbols + calls + imports │
|
|
71
|
+
│ Wiki: markdown docs + ADRs │
|
|
72
|
+
└───────────────────────────────────────────────────┘
|
|
42
73
|
```
|
|
43
74
|
|
|
44
|
-
|
|
75
|
+
### Memory pipeline (L0 → L3)
|
|
76
|
+
|
|
77
|
+
- **L0 captures** — raw content from agent sessions (errors, decisions, patterns)
|
|
78
|
+
- **L1 atoms** — distilled facts with confidence scores (agent writes or worker extracts)
|
|
79
|
+
- **L2 scenarios** — auto-consolidated summaries when 5+ atoms share a topic
|
|
80
|
+
- **L3 persona** — user preferences auto-detected from repeated tags (2+ occurrences)
|
|
81
|
+
|
|
82
|
+
All runs **without LLM API key** — rule-based extraction + keyword grouping.
|
|
83
|
+
|
|
84
|
+
### CodeGraph
|
|
85
|
+
|
|
86
|
+
Structural code indexing via tree-sitter (9 languages: TS/JS/Python/Go/Rust/Java/C/C++/C#).
|
|
87
|
+
|
|
88
|
+
- **6-strategy call resolution**: import-map (0.95) → same-module (0.90) → unique-name (0.75) → suffix (0.55) → fuzzy (0.35)
|
|
89
|
+
- **Call types**: direct (`foo()`), method (`obj.method()`), JSX (`<Component/>`)
|
|
90
|
+
- **Stdlib filter**: skips `fmt.Printf`, `console.log`, `print()` — reduces noise
|
|
91
|
+
- **Tools**: `codegraph_search`, `codegraph_callers`, `codegraph_callees`, `codegraph_impact`, `codegraph_detect_changes`
|
|
45
92
|
|
|
46
93
|
---
|
|
47
94
|
|
|
@@ -49,12 +96,11 @@ The demo creates a real TypeScript project, runs real `npm run build`, captures
|
|
|
49
96
|
|
|
50
97
|
| | remem-mcp | Mem0 | Claude MEMORY.md | Mneme |
|
|
51
98
|
|---|---|---|---|---|
|
|
52
|
-
| **Survives compaction** | Yes — PreCompact hook
|
|
53
|
-
| **Learns from errors** | Yes — auto-
|
|
54
|
-
| **Semantic search** | Hybrid BM25 + sqlite-vec | Vector only | No
|
|
55
|
-
| **
|
|
56
|
-
| **
|
|
57
|
-
| **Team sharing** | Git-native (commit, diff, merge) | Cloud sync | Copy-paste | Manual |
|
|
99
|
+
| **Survives compaction** | Yes — PreCompact hook | Yes — cloud | No — 200-line cap | Yes — PreCompact hook |
|
|
100
|
+
| **Learns from errors** | Yes — auto-capture + inject | No | No | No |
|
|
101
|
+
| **Semantic search** | Hybrid BM25 + sqlite-vec | Vector only | No | Vector + graph |
|
|
102
|
+
| **CodeGraph** | Yes — 6-strategy call resolution | No | No | No |
|
|
103
|
+
| **Setup** | 1 command | API key + cloud | Built-in | Build from source |
|
|
58
104
|
| **API key** | No | Yes | No | No |
|
|
59
105
|
| **Cost** | Free | $19–249/mo | Free | Free |
|
|
60
106
|
|
|
@@ -103,83 +149,22 @@ Add to `~/.codex/config.toml`:
|
|
|
103
149
|
[mcp_servers.remem-mcp]
|
|
104
150
|
command = "npx"
|
|
105
151
|
args = ["-y", "remem-mcp"]
|
|
106
|
-
|
|
107
|
-
[mcp_servers.remem-mcp.env]
|
|
108
|
-
REMEM_GLOBAL_SESSION_KEY = "global"
|
|
109
152
|
```
|
|
110
|
-
|
|
111
153
|
Then run `npx remem-mcp install-hooks`.
|
|
112
|
-
> MCP tools require `sandbox_mode = "danger-full-access"`.
|
|
113
154
|
</details>
|
|
114
155
|
|
|
115
156
|
---
|
|
116
157
|
|
|
117
|
-
## How it works
|
|
118
|
-
|
|
119
|
-
Memory lives in a local SQLite database — outside the agent's context window. When the agent compacts or starts a new session, memory is re-injected automatically. No more re-explaining what you already told it yesterday.
|
|
120
|
-
|
|
121
|
-
**PreCompact hook**: when the agent is about to compact context, remem-mcp saves a checkpoint (decisions made, approaches tried, what's verified working) to the DB. After compaction, the agent recalls it — so the compact doesn't destroy your session's learnings.
|
|
122
|
-
|
|
123
|
-
Two layers: **automatic** (runs via hooks, zero tool calls) and **on-demand** (you call when you need deeper context).
|
|
124
|
-
|
|
125
|
-
### Automatic — three learning loops + compaction survival
|
|
126
|
-
|
|
127
|
-
All run via lifecycle hooks. The agent doesn't need to call any tool.
|
|
128
|
-
|
|
129
|
-
1. **Error learning** — command fails → capture → inject fix before next attempt → succeed → upvote.
|
|
130
|
-
|
|
131
|
-
2. **Decision learning** — `npm install`, `git commit`, config → auto-capture → inject past decisions before similar commands.
|
|
132
|
-
|
|
133
|
-
3. **Pattern learning** — Write/Edit → auto-capture code patterns → inject same-language patterns before editing.
|
|
134
|
-
|
|
135
|
-
4. **Compaction survival** — PreCompact hook fires before context compaction → saves checkpoint → agent recalls after compact. Memory survives.
|
|
136
|
-
|
|
137
|
-
### On-demand — CodeGraph, Wiki, Search
|
|
138
|
-
|
|
139
|
-
When the automatic loops aren't enough, use these for deeper code navigation.
|
|
140
|
-
|
|
141
|
-
**CodeGraph** — symbol search, callers/callees, impact analysis. **Auto-indexes on first use** — just call `codegraph_search` and it indexes `src/` automatically. No manual `codegraph_index` needed.
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
# Search symbols (auto-indexes src/ on first call)
|
|
145
|
-
npx remem-mcp search-code --query "parseTar"
|
|
146
|
-
# → parseTar at src/parse.ts:22
|
|
147
|
-
|
|
148
|
-
# List symbols in a file
|
|
149
|
-
npx remem-mcp list-code src/reporters/fancy.ts
|
|
150
|
-
# → Class L49-135 FancyReporter
|
|
151
|
-
# → Method L86-134 formatLogObj
|
|
152
|
-
|
|
153
|
-
# Trace callers / callees / impact (use symbol ID from search)
|
|
154
|
-
npx remem-mcp callers 01KZXPPHF93TS4HV8FWCSSK36A
|
|
155
|
-
npx remem-mcp impact 01KZXPPHF93TS4HV8FWCSSK36A
|
|
156
|
-
|
|
157
|
-
# Manual re-index (only needed after major changes)
|
|
158
|
-
npx remem-mcp index --path src --repo .
|
|
159
|
-
|
|
160
|
-
# Wiki + viewer
|
|
161
|
-
npx remem-mcp wiki ingest --path docs # Index markdown docs + ADRs
|
|
162
|
-
npx remem-mcp wiki outdated # Find outdated wiki pages
|
|
163
|
-
npx remem-mcp viewer # Web UI at localhost:7331
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
- **CodeGraph** — symbol search, callers/callees, impact analysis. Auto-indexes on first `codegraph_search` call. Auto-scoped to your project.
|
|
167
|
-
- **Wiki** — markdown docs, ADRs, outdated detection.
|
|
168
|
-
- **Search** — hybrid BM25 + sqlite-vec vector search with RRF fusion. `explain_recall` shows scores.
|
|
169
|
-
|
|
170
|
-

|
|
171
|
-
|
|
172
|
-
---
|
|
173
|
-
|
|
174
158
|
## Daily commands
|
|
175
159
|
|
|
176
160
|
```bash
|
|
177
161
|
npx remem-mcp status # Everything at a glance
|
|
178
162
|
npx remem-mcp viewer # Web UI at localhost:7331
|
|
179
163
|
npx remem-mcp errors # Error dashboard
|
|
180
|
-
npx remem-mcp decisions # Decision dashboard
|
|
181
|
-
npx remem-mcp patterns # Pattern dashboard
|
|
182
164
|
npx remem-mcp recent [N] # Recent captures
|
|
165
|
+
npx remem-mcp search-code --query "parseTar" # CodeGraph search
|
|
166
|
+
npx remem-mcp callers <id> # Who calls this symbol?
|
|
167
|
+
npx remem-mcp impact <id> # Blast radius analysis
|
|
183
168
|
npx remem-mcp help all # Full list of 40+ subcommands
|
|
184
169
|
```
|
|
185
170
|
|
|
@@ -193,50 +178,21 @@ All settings have defaults. Config file is optional: `~/.config/remem-mcp/config
|
|
|
193
178
|
|---|---|---|
|
|
194
179
|
| DB path | `REMEM_DB_PATH` | `~/.local/share/remem-mcp/memory.db` |
|
|
195
180
|
| Cross-project memory | `REMEM_GLOBAL_SESSION_KEY` | _(unset)_ |
|
|
196
|
-
| Cross-project errors | `REMEM_GLOBAL_ERRORS` | _(unset, set to `1`)_ |
|
|
197
|
-
| Auto-global classification | `auto_global=true` on capture | _(off)_ |
|
|
198
181
|
| Suppress hook feedback | `REMEM_QUIET` | _(unset, set to `1`)_ |
|
|
199
|
-
|
|
|
200
|
-
| Core-only mode (disable advanced tools) | `REMEM_CORE_ONLY` | _(unset, set to `1`)_ |
|
|
201
|
-
| LLM API key (pipeline) | `REMEM_LLM_API_KEY` | _(unset)_ |
|
|
202
|
-
|
|
203
|
-
**Team sharing** — `npx remem-mcp sync-export` writes `.remem-mcp/memory-export.jsonl`. Commit it to git. Team members get the same memory on `git pull` (auto-imports on startup).
|
|
204
|
-
|
|
205
|
-
---
|
|
182
|
+
| LLM API key (optional) | `REMEM_LLM_API_KEY` | _(unset)_ |
|
|
206
183
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
```ts
|
|
210
|
-
import { Memory } from "remem-mcp";
|
|
211
|
-
|
|
212
|
-
const memory = new Memory();
|
|
213
|
-
await memory.capture("We chose SQLite for storage.", "decision", ["arch"]);
|
|
214
|
-
const results = await memory.recall("storage decision");
|
|
215
|
-
```
|
|
184
|
+
**Team sharing** — `npx remem-mcp sync-export` writes `.remem-mcp/memory-export.jsonl`. Commit it to git. Team members get the same memory on `git pull`.
|
|
216
185
|
|
|
217
186
|
---
|
|
218
187
|
|
|
219
188
|
## Benchmark
|
|
220
189
|
|
|
221
|
-
remem-mcp
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
|
226
|
-
|
|
227
|
-
| **AMB Layer 1** (basic recall) | **100** | — | — | — |
|
|
228
|
-
| **AMB Layer 2** (multi-session) | **100** | — | — | — |
|
|
229
|
-
| **AMB Layer 3** (scale + distractors) | **100** | — | — | — |
|
|
230
|
-
| **LoCoMo** (long conversation QA) | **95** | — | 92.5 | — |
|
|
231
|
-
| **PersonaMem** (personalization) | **100** | 76 | — | 48 |
|
|
232
|
-
| **LongMemEval** (long-term memory, ICLR 2025) | **96** | — | 94.4 | — |
|
|
233
|
-
|
|
234
|
-
- **PersonaMem** — [bowen-upenn/PersonaMem](https://github.com/bowen-upenn/PersonaMem) (588 questions, 20 personas, multiple-choice QA). TencentDB reports 76% with memory enabled, 48% without. remem-mcp scores **100%** using a search-recall proxy (no LLM API key needed).
|
|
235
|
-
- **LoCoMo** — long conversation multi-hop QA (19 sessions, 400+ turns). Mem0 reports 92.5%. remem-mcp scores **95%** with keyword + semantic-similarity scoring.
|
|
236
|
-
- **AMB** — Agent Memory Benchmark (L1: 56 recall tests, L2: 5 multi-session scenarios, L3: 1K+ memories with distractors). remem-mcp scores **100/100/100** using the official AMB CLI.
|
|
237
|
-
- **LongMemEval** — [xiaowu0162/LongMemEval](https://github.com/xiaowu0162/LongMemEval) (ICLR 2025, 500 questions, 5 memory abilities: temporal reasoning, multi-session, knowledge update, single-session recall, abstention). Mem0 reports 94.4%. remem-mcp scores **96%** on the oracle variant.
|
|
238
|
-
|
|
239
|
-
Run the benchmarks:
|
|
190
|
+
| Benchmark | remem-mcp | Mem0 | Without memory |
|
|
191
|
+
|---|---|---|---|
|
|
192
|
+
| **AMB** (L1/L2/L3) | **100/100/100** | — | — |
|
|
193
|
+
| **LoCoMo** (long conversation QA) | **95** | 92.5 | — |
|
|
194
|
+
| **PersonaMem** (personalization) | **100** | — | 48 |
|
|
195
|
+
| **LongMemEval** (ICLR 2025) | **96** | 94.4 | — |
|
|
240
196
|
|
|
241
197
|
```bash
|
|
242
198
|
bash scripts/bench-all.sh # Full: AMB + LoCoMo + PersonaMem (~5 min)
|
|
@@ -245,9 +201,13 @@ bash scripts/bench-all.sh --quick # AMB only (~2 min)
|
|
|
245
201
|
|
|
246
202
|
---
|
|
247
203
|
|
|
204
|
+
## Architecture
|
|
205
|
+
|
|
206
|
+
See [ARCHITECTURE.md](./ARCHITECTURE.md) for full system diagrams, schema, and performance benchmarks.
|
|
207
|
+
|
|
248
208
|
## Credits
|
|
249
209
|
|
|
250
|
-
Core based on [TencentDB Agent Memory](https://github.com/TencentCloud/TencentDB-Agent-Memory) (MIT, Tencent 2026).
|
|
210
|
+
Core based on [TencentDB Agent Memory](https://github.com/TencentCloud/TencentDB-Agent-Memory) (MIT, Tencent 2026). CodeGraph call resolution adapted from Codebase-Memory (arXiv:2603.27277).
|
|
251
211
|
|
|
252
212
|
## License
|
|
253
213
|
|