fastrmemory 0.3.0 → 0.3.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/.claude-plugin/marketplace.json +14 -14
- package/.claude-plugin/plugin.json +18 -18
- package/.cursor/mcp.json +3 -1
- package/.cursor/skills/fastr-compress/SKILL.md +33 -33
- package/.cursor/skills/fastr-curate/SKILL.md +62 -62
- package/.cursor/skills/fastr-dag/SKILL.md +47 -47
- package/.cursor/skills/fastr-doctor/SKILL.md +39 -39
- package/.cursor/skills/fastr-memory/SKILL.md +51 -51
- package/.cursor/skills/fastr-plan-estimate/SKILL.md +45 -45
- package/.cursor/skills/fastr-session-commit/SKILL.md +49 -49
- package/.cursor/skills/fastr-setup/SKILL.md +45 -45
- package/.cursor/skills/fastr-trap-log/SKILL.md +39 -39
- package/.cursor/skills/fastr-vision/SKILL.md +35 -35
- package/.cursor/skills/skills.json +65 -65
- package/README.md +727 -729
- package/bin/fastr-guard.mjs +61 -0
- package/dist/bin/fastr.js +10 -9
- package/dist/bin/fastr.js.map +1 -1
- package/dist/src/bench/benchmark.js +13 -13
- package/dist/src/bench/harness.js +17 -17
- package/dist/src/bench/public-harness.js +5 -5
- package/dist/src/branch/manager.js +31 -31
- package/dist/src/ci/guardian.js +9 -9
- package/dist/src/db/doctor.js +25 -25
- package/dist/src/db/hygiene.js +23 -23
- package/dist/src/db/repository.js +283 -283
- package/dist/src/db/schema.js +268 -268
- package/dist/src/db/spool.js +4 -4
- package/dist/src/export/obsidian.js +15 -15
- package/dist/src/import/local.js +4 -4
- package/dist/src/installer/setup.d.ts +2 -0
- package/dist/src/installer/setup.d.ts.map +1 -1
- package/dist/src/installer/setup.js +24 -18
- package/dist/src/installer/setup.js.map +1 -1
- package/dist/src/mcp/server.js +25 -25
- package/dist/src/mirror/markdown-pages.js +22 -22
- package/dist/src/search/backfill.js +6 -6
- package/dist/src/search/hybrid-rrf.js +60 -60
- package/dist/src/ui/server.js +1259 -1259
- package/dist/src/vision/assets.js +6 -6
- package/dist-ui/assets/ActionsPage-B3quzFNF.js +11 -11
- package/dist-ui/assets/GraphPage-DetiATmC.js +1 -1
- package/dist-ui/assets/ObservatoryPage-QIGMwENf.js +16 -16
- package/dist-ui/assets/TreemapPage-C7uLZd37.js +2 -2
- package/dist-ui/assets/index-BJnPINTu.css +1 -1
- package/dist-ui/assets/index-DWAH--Fu.js +329 -329
- package/dist-ui/assets/maximize-2-BebkGbZA.js +6 -6
- package/dist-ui/build-manifest.json +95 -95
- package/dist-ui/index.html +26 -26
- package/llms-install.md +69 -69
- package/package.json +108 -107
- package/server.json +28 -28
- package/skills/fastr-compress/SKILL.md +33 -33
- package/skills/fastr-curate/SKILL.md +62 -62
- package/skills/fastr-dag/SKILL.md +47 -47
- package/skills/fastr-doctor/SKILL.md +39 -39
- package/skills/fastr-memory/SKILL.md +51 -51
- package/skills/fastr-plan-estimate/SKILL.md +45 -45
- package/skills/fastr-session-commit/SKILL.md +49 -49
- package/skills/fastr-setup/SKILL.md +45 -45
- package/skills/fastr-trap-log/SKILL.md +39 -39
- package/skills/fastr-vision/SKILL.md +35 -35
- package/skills/skills.json +65 -65
package/README.md
CHANGED
|
@@ -1,729 +1,727 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
|
|
3
|
-
# ⚡ FastrMemory
|
|
4
|
-
|
|
5
|
-
### High-Performance Cognitive Agent Memory Engine
|
|
6
|
-
**Zero Daemon • Native Node 22+ `node:sqlite` • Bi-Temporal Git Sync • Triple-Stream RRF • Official MCP v2**
|
|
7
|
-
|
|
8
|
-
[](https://github.com/atifjubaer/fastrmemory/actions)
|
|
9
|
-
[](LICENSE)
|
|
11
|
-
[](https://nodejs.org)
|
|
12
|
-
[](https://modelcontextprotocol.io)
|
|
13
|
-
[](CONTRIBUTING.md)
|
|
15
|
-
[](#-architecture)
|
|
16
|
-
|
|
17
|
-
> **Status (2026-10-23):** The
|
|
18
|
-
|
|
19
|
-
<p align="center">
|
|
20
|
-
<a href="#-overview">Overview</a> •
|
|
21
|
-
<a href="#-design-principles">Design Principles</a> •
|
|
22
|
-
<a href="#-retrieval-benchmark-240-synthetic-cases">Benchmarks</a> •
|
|
23
|
-
<a href="#-local-web-dashboard">Web UI</a> •
|
|
24
|
-
<a href="#-works-with-mcp--and-http-compatible-agents">Supported Agents</a> •
|
|
25
|
-
<a href="#-quick-start">Quick Start</a> •
|
|
26
|
-
<a href="#-mcp-server-tools--resources">MCP Tools</a> •
|
|
27
|
-
<a href="#-architecture">Architecture</a> •
|
|
28
|
-
<a href="ROADMAP.md">Roadmap</a> •
|
|
29
|
-
<a href="MIGRATION.md">Migration</a> •
|
|
30
|
-
<a href="SECURITY.md">Security</a> •
|
|
31
|
-
<a href="SCORECARD.md">Scorecard</a> •
|
|
32
|
-
<a href="#-contributing">Contributing</a>
|
|
33
|
-
</p>
|
|
34
|
-
|
|
35
|
-
</div>
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## Launch Status at a Glance
|
|
40
|
-
|
|
41
|
-
| Claim | Current result | Evidence |
|
|
42
|
-
|---|---|---|
|
|
43
|
-
| Install path |
|
|
44
|
-
| Synthetic retrieval | Holdout `95.8%` Hit@1, `100%` Hit@5, MRR `0.969` | `npx tsx scripts/eval-bench.ts --split all --embeddings minilm --out bench/results/minilm.json` |
|
|
45
|
-
| Test suite | `
|
|
46
|
-
| Crash safety | 10/10 runs, 0 lost, 0 duplicate ids/titles | `npm run test:crash`; `bench/results/crash-test.json` |
|
|
47
|
-
| Public retrieval (0.3.0
|
|
48
|
-
| Release score | Provisional `9.4 / 10`; `9.2` target met; Retrieval remains Partial | [SCORECARD.md](SCORECARD.md) |
|
|
49
|
-
|
|
50
|
-
The synthetic table is not SWE-bench or LongMemEval. Public numbers are retrieval-only and are not QA-leaderboard results. Full provenance is in [CLAIMS.md](CLAIMS.md).
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## 💡 Overview
|
|
55
|
-
|
|
56
|
-
AI coding agents (Claude Code, Cursor, Windsurf, Codex, Antigravity) degrade on long-running codebases when project memory is lossy or operationally heavy. Common designs make one of three trade-offs:
|
|
57
|
-
- **Decay and merge** old episodes to keep the store small, which can lose exact file paths, stack traces, and edge cases.
|
|
58
|
-
- **Run a daemon or external database**, which adds ports, containers, and setup failure modes.
|
|
59
|
-
- **Dump a static context file**, which grows without bound and is not queryable.
|
|
60
|
-
|
|
61
|
-
**FastrMemory** keeps a verbatim event log, bi-temporal memory history, and a replayable Git mirror in a **single in-process TypeScript engine** (3 runtime dependencies; local embeddings and the daemon are optional):
|
|
62
|
-
|
|
63
|
-
<table>
|
|
64
|
-
<tr>
|
|
65
|
-
<td width="33%" align="center">
|
|
66
|
-
|
|
67
|
-
### ⚡ Zero Daemon Overhead
|
|
68
|
-
Pure Node 22+ built-in `node:sqlite` in WAL mode. On the 240-case suite, engine-level recall is **0.95 ms p50 / 1.60 ms p95** with hash embeddings and **3.30 ms p50 / 5.11 ms p95** with MiniLM on the train split (CLI startup measured separately). The default CLI/MCP path has no background daemon and no open port; `daemon start` is optional. Native on Windows, macOS, and Linux (the current CI matrix uses Intel macOS; Apple Silicon is not covered); CI matrix status is reported in [Actions](https://github.com/atifjubaer/fastrmemory/actions).
|
|
69
|
-
|
|
70
|
-
</td>
|
|
71
|
-
<td width="33%" align="center">
|
|
72
|
-
|
|
73
|
-
### 🔀 Bi-Temporal Git Sync
|
|
74
|
-
Never deletes facts during consolidation (there is no destructive sleep step). Replaces half-life decay with `valid_from` / `valid_to` timestamps and auto-mirrors human-readable `.fastr/pages/*.md` files into Git.
|
|
75
|
-
|
|
76
|
-
</td>
|
|
77
|
-
<td width="33%" align="center">
|
|
78
|
-
|
|
79
|
-
### 🎯 Triple-Stream RRF ($k=20$)
|
|
80
|
-
Fuses FTS5 BM25 + optional local embeddings + file-graph links. Error traps receive a **conditional 2.0x boost** only for trap-intent or file-scoped queries, with per-ID outcome feedback (+0.2 / -0.5). Three consecutive bad outcomes move a memory to dormant; confidence tiers are `high`, `medium`, `low`, `dormant`, and `superseded`.
|
|
81
|
-
|
|
82
|
-
</td>
|
|
83
|
-
</tr>
|
|
84
|
-
</table>
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## 🧭 Design Principles
|
|
89
|
-
|
|
90
|
-
| Principle | Implementation |
|
|
91
|
-
| :--- | :--- |
|
|
92
|
-
| **Lossless by default** | Raw events, bi-temporal `valid_from` / `valid_to`, and supersession chains are retained. Nothing is destroyed by consolidation. |
|
|
93
|
-
| **Zero daemon by default** | One Node 22+ process uses built-in `node:sqlite` in WAL mode. The default CLI/MCP path opens no ports or background services; `daemon start` is optional. |
|
|
94
|
-
| **Replayable** | Git-diffable Markdown mirrors plus snapshots and rollback keep history inspectable. |
|
|
95
|
-
| **Measured, not asserted** | Public claims are tied to committed benchmark JSON with a 20% holdout; simulated baselines are labeled as simulations. |
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
---
|
|
100
|
-
|
|
101
|
-
## 🤖 Works With MCP- and HTTP-Compatible Agents
|
|
102
|
-
|
|
103
|
-
FastrMemory exposes one stdio MCP server and optional local HTTP services (dashboard and daemon). **Native installers wire Claude Code (MCP config plus lifecycle hooks), Cursor (MCP config plus skills), and,
|
|
104
|
-
|
|
105
|
-
Clients commonly used with FastrMemory include Codex CLI, Gemini CLI, OpenCode, GitHub Copilot CLI, Antigravity, Claude Desktop, Cline, Continue, Roo Code, Goose, Zed, Warp, and Aider. Listing a client does **not** imply a tested native integration.
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
## 🚀 Quick Start
|
|
110
|
-
|
|
111
|
-
### ⚡ Run Without a Global Install
|
|
112
|
-
|
|
113
|
-
The
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
#
|
|
117
|
-
npx -y fastrmemory@0.3.
|
|
118
|
-
|
|
119
|
-
#
|
|
120
|
-
npx -y
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
npx
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
npm install -g
|
|
161
|
-
fastr --version
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
-
|
|
182
|
-
-
|
|
183
|
-
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
fastrmemory import AGENTS.md --from agents-md --module rules --
|
|
227
|
-
|
|
228
|
-
#
|
|
229
|
-
fastrmemory import
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
fastrmemory
|
|
252
|
-
fastrmemory
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
fastrmemory
|
|
257
|
-
fastrmemory
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
fastrmemory
|
|
263
|
-
fastrmemory
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
fastrmemory
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
#
|
|
272
|
-
fastrmemory
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
fastrmemory
|
|
294
|
-
|
|
295
|
-
#
|
|
296
|
-
fastrmemory
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
- `fastr://
|
|
465
|
-
- `fastr://
|
|
466
|
-
- `fastr://
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
- **
|
|
487
|
-
- **
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
- **
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
- [fastr-
|
|
512
|
-
- [fastr-
|
|
513
|
-
- [fastr-
|
|
514
|
-
- [fastr-
|
|
515
|
-
- [fastr-
|
|
516
|
-
- [fastr-
|
|
517
|
-
- [fastr-
|
|
518
|
-
- [fastr-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
Query
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
```
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
**
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
|
586
|
-
|
|
|
587
|
-
| FastrMemory
|
|
588
|
-
| FastrMemory
|
|
589
|
-
|
|
|
590
|
-
|
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
```
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
- **
|
|
605
|
-
-
|
|
606
|
-
- **
|
|
607
|
-
-
|
|
608
|
-
- `/
|
|
609
|
-
- `/
|
|
610
|
-
- `/
|
|
611
|
-
- `/
|
|
612
|
-
- `/
|
|
613
|
-
- `/
|
|
614
|
-
- `/
|
|
615
|
-
- `/
|
|
616
|
-
- `/
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
- **
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
-
|
|
639
|
-
- **
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
- **PR #
|
|
653
|
-
- **PR #
|
|
654
|
-
- **PR #
|
|
655
|
-
- **PR #
|
|
656
|
-
- **PR #
|
|
657
|
-
- **PR #
|
|
658
|
-
- **PR #
|
|
659
|
-
- **PR #
|
|
660
|
-
- **PR #
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
|
669
|
-
|
|
|
670
|
-
| **
|
|
671
|
-
| **
|
|
672
|
-
| **
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
git checkout -b
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
- [ ] **
|
|
718
|
-
- [ ] **
|
|
719
|
-
- [ ] **
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
Apache License 2.0. Built by **Fastrsoft**. Free for personal and commercial use.
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# ⚡ FastrMemory
|
|
4
|
+
|
|
5
|
+
### High-Performance Cognitive Agent Memory Engine
|
|
6
|
+
**Zero Daemon • Native Node 22+ `node:sqlite` • Bi-Temporal Git Sync • Triple-Stream RRF • Official MCP v2**
|
|
7
|
+
|
|
8
|
+
[](https://github.com/atifjubaer/fastrmemory/actions)
|
|
9
|
+
[](https://www.npmjs.com/package/fastrmemory)
|
|
10
|
+
[](LICENSE)
|
|
11
|
+
[](https://nodejs.org)
|
|
12
|
+
[](https://modelcontextprotocol.io)
|
|
13
|
+
[](tests/)
|
|
14
|
+
[](CONTRIBUTING.md)
|
|
15
|
+
[](#-architecture)
|
|
16
|
+
|
|
17
|
+
> **Status (2026-10-23):** The canonical release target is **`fastrmemory@0.3.1`**. The release workflow publishes it with npm provenance and a matching GitHub Release tarball; verify with `npm view fastrmemory version` and require `latest` to be `0.3.1`. This release replaces the stale `0.3.0` npm README, fixes Windows MCP commands, pins user-scoped clients to the project root, and adds the Node runtime guard. The old scoped npm entries (`@atifjubaer/fastrmemory` and `fastrmemory@0.0.0-stage`) were removed on 2026-10-23; the GitHub `v0.2.1` tag and release remain as history. This README tracks **0.3.1**. Use the exact `0.3.1` version for reproducibility. The release post for 0.2.1 remains at [docs/blog/2026-10-21-fastrmemory-0.2.1.md](docs/blog/2026-10-21-fastrmemory-0.2.1.md). The exact release surface is in [CHANGELOG.md](CHANGELOG.md). The headline benchmark uses **240 deterministic synthetic cases with a 20% holdout**, not SWE-bench or LongMemEval. Public LongMemEval, LoCoMo, and self-repository retrieval-only results plus pinned external baselines are in [BENCHMARKS.md](BENCHMARKS.md); no QA-leaderboard parity is claimed. Performance, packaging, and retrieval claims are tracked in [CLAIMS.md](CLAIMS.md); every README section is mapped to claim IDs in the README claim trace at the end of that ledger. Methodology, caveats, and raw JSON are in [BENCHMARKS.md](BENCHMARKS.md).
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<a href="#-overview">Overview</a> •
|
|
21
|
+
<a href="#-design-principles">Design Principles</a> •
|
|
22
|
+
<a href="#-retrieval-benchmark-240-synthetic-cases">Benchmarks</a> •
|
|
23
|
+
<a href="#-local-web-dashboard">Web UI</a> •
|
|
24
|
+
<a href="#-works-with-mcp--and-http-compatible-agents">Supported Agents</a> •
|
|
25
|
+
<a href="#-quick-start">Quick Start</a> •
|
|
26
|
+
<a href="#-mcp-server-tools--resources">MCP Tools</a> •
|
|
27
|
+
<a href="#-architecture">Architecture</a> •
|
|
28
|
+
<a href="ROADMAP.md">Roadmap</a> •
|
|
29
|
+
<a href="MIGRATION.md">Migration</a> •
|
|
30
|
+
<a href="SECURITY.md">Security</a> •
|
|
31
|
+
<a href="SCORECARD.md">Scorecard</a> •
|
|
32
|
+
<a href="#-contributing">Contributing</a>
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Launch Status at a Glance
|
|
40
|
+
|
|
41
|
+
| Claim | Current result | Evidence |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| Install path | Canonical release target `fastrmemory@0.3.1`; old scoped npm entries removed | `npm view fastrmemory version` -> `0.3.1`; `npm install -g fastrmemory@0.3.1`; `fastr --version` -> `0.3.1` |
|
|
44
|
+
| Synthetic retrieval | Holdout `95.8%` Hit@1, `100%` Hit@5, MRR `0.969` | `npx tsx scripts/eval-bench.ts --split all --embeddings minilm --out bench/results/minilm.json` |
|
|
45
|
+
| Test suite | `282` tests across `52` files in `0.3.1`; v0.2.1 is `235` / `43` | `npm test` |
|
|
46
|
+
| Crash safety | 10/10 runs, 0 lost, 0 duplicate ids/titles | `npm run test:crash`; `bench/results/crash-test.json` |
|
|
47
|
+
| Public retrieval (0.3.0) | LongMemEval `+10.4pp` / `+11.0pp` Hit@5; LoCoMo `+4.4pp` / `+2.3pp` (target missed) | [docs/EXTERNAL_BASELINE.md](docs/EXTERNAL_BASELINE.md) |
|
|
48
|
+
| Release score | Provisional `9.4 / 10`; `9.2` target met; Retrieval remains Partial | [SCORECARD.md](SCORECARD.md) |
|
|
49
|
+
|
|
50
|
+
The synthetic table is not SWE-bench or LongMemEval. Public numbers are retrieval-only and are not QA-leaderboard results. Full provenance is in [CLAIMS.md](CLAIMS.md).
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 💡 Overview
|
|
55
|
+
|
|
56
|
+
AI coding agents (Claude Code, Cursor, Windsurf, Codex, Antigravity) degrade on long-running codebases when project memory is lossy or operationally heavy. Common designs make one of three trade-offs:
|
|
57
|
+
- **Decay and merge** old episodes to keep the store small, which can lose exact file paths, stack traces, and edge cases.
|
|
58
|
+
- **Run a daemon or external database**, which adds ports, containers, and setup failure modes.
|
|
59
|
+
- **Dump a static context file**, which grows without bound and is not queryable.
|
|
60
|
+
|
|
61
|
+
**FastrMemory** keeps a verbatim event log, bi-temporal memory history, and a replayable Git mirror in a **single in-process TypeScript engine** (3 runtime dependencies; local embeddings and the daemon are optional):
|
|
62
|
+
|
|
63
|
+
<table>
|
|
64
|
+
<tr>
|
|
65
|
+
<td width="33%" align="center">
|
|
66
|
+
|
|
67
|
+
### ⚡ Zero Daemon Overhead
|
|
68
|
+
Pure Node 22+ built-in `node:sqlite` in WAL mode. On the 240-case suite, engine-level recall is **0.95 ms p50 / 1.60 ms p95** with hash embeddings and **3.30 ms p50 / 5.11 ms p95** with MiniLM on the train split (CLI startup measured separately). The default CLI/MCP path has no background daemon and no open port; `daemon start` is optional. Native on Windows, macOS, and Linux (the current CI matrix uses Intel macOS; Apple Silicon is not covered); CI matrix status is reported in [Actions](https://github.com/atifjubaer/fastrmemory/actions).
|
|
69
|
+
|
|
70
|
+
</td>
|
|
71
|
+
<td width="33%" align="center">
|
|
72
|
+
|
|
73
|
+
### 🔀 Bi-Temporal Git Sync
|
|
74
|
+
Never deletes facts during consolidation (there is no destructive sleep step). Replaces half-life decay with `valid_from` / `valid_to` timestamps and auto-mirrors human-readable `.fastr/pages/*.md` files into Git.
|
|
75
|
+
|
|
76
|
+
</td>
|
|
77
|
+
<td width="33%" align="center">
|
|
78
|
+
|
|
79
|
+
### 🎯 Triple-Stream RRF ($k=20$)
|
|
80
|
+
Fuses FTS5 BM25 + optional local embeddings + file-graph links. Error traps receive a **conditional 2.0x boost** only for trap-intent or file-scoped queries, with per-ID outcome feedback (+0.2 / -0.5). Three consecutive bad outcomes move a memory to dormant; confidence tiers are `high`, `medium`, `low`, `dormant`, and `superseded`.
|
|
81
|
+
|
|
82
|
+
</td>
|
|
83
|
+
</tr>
|
|
84
|
+
</table>
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 🧭 Design Principles
|
|
89
|
+
|
|
90
|
+
| Principle | Implementation |
|
|
91
|
+
| :--- | :--- |
|
|
92
|
+
| **Lossless by default** | Raw events, bi-temporal `valid_from` / `valid_to`, and supersession chains are retained. Nothing is destroyed by consolidation. |
|
|
93
|
+
| **Zero daemon by default** | One Node 22+ process uses built-in `node:sqlite` in WAL mode. The default CLI/MCP path opens no ports or background services; `daemon start` is optional. |
|
|
94
|
+
| **Replayable** | Git-diffable Markdown mirrors plus snapshots and rollback keep history inspectable. |
|
|
95
|
+
| **Measured, not asserted** | Public claims are tied to committed benchmark JSON with a 20% holdout; simulated baselines are labeled as simulations. |
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 🤖 Works With MCP- and HTTP-Compatible Agents
|
|
102
|
+
|
|
103
|
+
FastrMemory exposes one stdio MCP server and optional local HTTP services (dashboard and daemon). **Native installers wire Claude Code (MCP config plus lifecycle hooks), Cursor (MCP config plus skills), and, since 0.3.0, Gemini CLI, GitHub Copilot CLI, and OpenCode V2** (`fastrmemory hook install`); `fastrmemory setup` also writes MCP configs for Antigravity, Claude Desktop, and Windsurf. Every other client connects through its own MCP configuration or the REST API. Integration depth varies by client - only the native installers are covered by tests in this repository.
|
|
104
|
+
|
|
105
|
+
Clients commonly used with FastrMemory include Codex CLI, Gemini CLI, OpenCode, GitHub Copilot CLI, Antigravity, Claude Desktop, Cline, Continue, Roo Code, Goose, Zed, Warp, and Aider. Listing a client does **not** imply a tested native integration.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 🚀 Quick Start
|
|
110
|
+
|
|
111
|
+
### ⚡ Run Without a Global Install
|
|
112
|
+
|
|
113
|
+
The canonical package target is unscoped `fastrmemory@0.3.1`. The old scoped npm entries were removed on 2026-10-23.
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# Canonical one-shot (pins the exact release):
|
|
117
|
+
npx -y fastrmemory@0.3.1 setup
|
|
118
|
+
|
|
119
|
+
# Or launch the local Web UI:
|
|
120
|
+
npx -y fastrmemory@0.3.1 ui
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
The GitHub source path remains available for development only: `npx github:atifjubaer/fastrmemory setup`. For a reproducible source install, pin the tag: `npx github:atifjubaer/fastrmemory#v0.3.1 setup`. Do not use either GitHub form in generated MCP or hook configs; those must pin the npm package version.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
### Install from npm
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# Canonical install (latest is 0.3.1):
|
|
131
|
+
npm install -g fastrmemory
|
|
132
|
+
fastr --version
|
|
133
|
+
|
|
134
|
+
# Exact release:
|
|
135
|
+
npm install -g fastrmemory@0.3.1
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
For a one-shot run without a global install:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
npx -y fastrmemory@0.3.1 --version
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
`0.3.1` is built from tag `v0.3.1` by `.github/workflows/release.yml`, which runs the full gate, publishes with npm provenance, and attaches the same tarball to the GitHub Release. Verify the registry result with `npm view fastrmemory@0.3.1 version` and `npm view fastrmemory dist-tags --json`; a first E404 for a few minutes is registry propagation, not a failed publish. The old scoped npm entries remain removed. Do not republish `0.3.0`.
|
|
145
|
+
|
|
146
|
+
### Install from GitHub
|
|
147
|
+
|
|
148
|
+
For a one-shot source run, pin the release tag:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
npx --yes github:atifjubaer/fastrmemory#v0.3.1 --version
|
|
152
|
+
npx --yes github:atifjubaer/fastrmemory#v0.3.1 setup
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
For a global CLI without npm's Git resolver, download the release tarball:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
curl -L -o fastrmemory-0.3.1.tgz \
|
|
159
|
+
https://github.com/atifjubaer/fastrmemory/releases/download/v0.3.1/fastrmemory-0.3.1.tgz
|
|
160
|
+
npm install -g ./fastrmemory-0.3.1.tgz
|
|
161
|
+
fastr --version
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
On Windows, download the same URL with `Invoke-WebRequest` or a browser, then run `npm install -g .\fastrmemory-0.3.1.tgz`. For a local project install, use `npm install --no-save ./fastrmemory-0.3.1.tgz` instead of the global flag.
|
|
165
|
+
|
|
166
|
+
> Git installs build from source and are slower than the npm tarball; for a global CLI, prefer the npm package or the release tarball above. `npm install -g git+https://...` is not recommended with npm 11 because the `prepare` build does not receive dev dependencies. Both `fastrmemory` and `fastr` (short alias) are executable after installation. The canonical package is unscoped `fastrmemory@0.3.1`; the old scoped npm entries are gone. Use npm for generated MCP and hook configs so installs stay reproducible.
|
|
167
|
+
|
|
168
|
+
### 2. Verify Database Health
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
fastrmemory status
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Output:
|
|
175
|
+
```text
|
|
176
|
+
=== FastrMemory Health (my-project) ===
|
|
177
|
+
- Project ID: proj_1cce2a654e3a
|
|
178
|
+
- Active Memories: 2
|
|
179
|
+
- Staging Memories: 0
|
|
180
|
+
- Superseded History: 0
|
|
181
|
+
- Ingested Events: 0
|
|
182
|
+
- Pending Spool: Clear (0)
|
|
183
|
+
- Database File: .fastr/fastr.db
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### 3. Record & Recall a Memory
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
# Record an error trap linked to an exact file:
|
|
190
|
+
fastrmemory remember "Never Use Date.now() Milliseconds for JWT Expiration" \
|
|
191
|
+
-c "JWT exp claims expect integer seconds. Always use Math.floor(Date.now() / 1000)." \
|
|
192
|
+
-m auth -k error_trap -f "src/auth/jwt.ts" --verified
|
|
193
|
+
|
|
194
|
+
# Recall with conditional 2.0x trap boost & file-graph matching:
|
|
195
|
+
fastrmemory recall "JWT expiration" -f "src/auth/jwt.ts"
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Output:
|
|
199
|
+
```text
|
|
200
|
+
=== Recalled Memories (1 results, ~46 tokens) ===
|
|
201
|
+
|
|
202
|
+
[mem_009e4a7d] [TRAP] [verified] Never Use Date.now() Milliseconds for JWT Expiration (Score: 0.08)
|
|
203
|
+
JWT exp claims expect integer seconds. Always use Math.floor(Date.now() / 1000).
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Open contradictions are marked on both sides of the recall result instead of being silently mixed into context (**0.3.0**):
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
# Inspect unresolved contradictions:
|
|
210
|
+
fastrmemory conflict list
|
|
211
|
+
|
|
212
|
+
# Keep the rule that matches the project and supersede the loser:
|
|
213
|
+
fastrmemory conflict resolve 1 --keep mem_009e4a7d --forget --reason "Seconds are the project standard"
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
#### Import Existing Local Rules (**0.3.0**)
|
|
217
|
+
|
|
218
|
+
Bring `AGENTS.md`, `CLAUDE.md`, or `.cursor/rules/*.mdc` content into memory without hand-copying every section. Level 2+ headings become memories; bullet lists and paragraphs are fallbacks. Re-importing the same file skips exact duplicates.
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
# Preview the parsed sections without writing:
|
|
222
|
+
fastrmemory import AGENTS.md --from agents-md --module rules --dry-run
|
|
223
|
+
|
|
224
|
+
# Import as staging memories for review, or verify them immediately:
|
|
225
|
+
fastrmemory import AGENTS.md --from agents-md --module rules
|
|
226
|
+
fastrmemory import AGENTS.md --from agents-md --module rules --verified
|
|
227
|
+
|
|
228
|
+
# JSONL snapshots use the same entry point:
|
|
229
|
+
fastrmemory import snapshot.jsonl --from jsonl
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### 4. Cognitive Git Blame & Memory-Aware Commit
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
# Cognitive Git Blame linking lines directly to commit, author, and governing error traps (conditional 2.0x boost):
|
|
236
|
+
fastrmemory blame src/auth/jwt.ts:42
|
|
237
|
+
|
|
238
|
+
# Pre-commit error trap validation & conventional commit synthesis:
|
|
239
|
+
fastrmemory commit
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### 5. Git Snapshots, Branches, Rollback & Background Daemon (branches are **0.3.0**)
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
# Point-in-time memory snapshot (Git for Agent Memory):
|
|
246
|
+
fastrmemory snapshot create "pre-refactor-checkpoint"
|
|
247
|
+
fastrmemory snapshot list
|
|
248
|
+
fastrmemory snapshot rollback "pre-refactor-checkpoint"
|
|
249
|
+
|
|
250
|
+
# 0.3.0: Portable backup with a sidecar provenance manifest:
|
|
251
|
+
fastrmemory backup backups/pre-upgrade.jsonl
|
|
252
|
+
fastrmemory backup --verify backups/pre-upgrade.jsonl
|
|
253
|
+
fastrmemory backup --restore backups/pre-upgrade.jsonl --dry-run
|
|
254
|
+
|
|
255
|
+
# Immutable memory branch and one-way merge with a conflict report:
|
|
256
|
+
fastrmemory branch create feature/auth
|
|
257
|
+
fastrmemory branch list
|
|
258
|
+
fastrmemory merge feature/auth
|
|
259
|
+
fastrmemory merge feature/auth --force --strategy branch
|
|
260
|
+
|
|
261
|
+
# Hybrid Background Daemon (Optional HTTP/SSE service for cross-process tools):
|
|
262
|
+
fastrmemory daemon start
|
|
263
|
+
fastrmemory daemon status
|
|
264
|
+
fastrmemory daemon stop
|
|
265
|
+
|
|
266
|
+
# Auto-wire MCP configs, lifecycle hooks, and Planetary Skills into Claude Code, Cursor,
|
|
267
|
+
# Gemini CLI, GitHub Copilot CLI, and OpenCode; setup also wires Antigravity, Claude Desktop, and Windsurf:
|
|
268
|
+
fastrmemory hook install
|
|
269
|
+
fastrmemory setup
|
|
270
|
+
|
|
271
|
+
# Mine past Git bug fixes directly into staging error traps:
|
|
272
|
+
fastrmemory learn -n 30 --days 90
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
Branches are immutable snapshot pointers. `merge` is one-way into the current active set: branch-only memories are added, target-only memories are preserved, and same-identity changes are reported as conflicts. Conflicts block writes by default; `--force` applies non-conflicting additions, and `--force --strategy branch` supersedes the target while keeping old rows in history. Branch checkout or a mutable branch working tree is not implemented.
|
|
276
|
+
|
|
277
|
+
`backup` writes the portable JSONL snapshot plus `<file>.manifest.json` with the file SHA-256, content hash, record counts, tool version, environment, and source integrity. `--restore` verifies both hashes before importing; `--dry-run` reports counts without writing. The backup scope is memories, raw events, file links, and conflicts, not a physical SQLite/WAL copy. See [MIGRATION.md](MIGRATION.md) for the full backup and rollback path.
|
|
278
|
+
|
|
279
|
+
### 6. Token Compression, Database Doctor & Vision Search
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
# Compress markdown docs & LLM prompt context to reduce token usage:
|
|
283
|
+
fastrmemory compress docs/architecture.md --dry-run
|
|
284
|
+
|
|
285
|
+
# Run deep health check across SQLite, FTS5 indices, file links, and task DAGs:
|
|
286
|
+
fastrmemory diagnose
|
|
287
|
+
|
|
288
|
+
# Auto-repair FTS5 indices, orphaned file links, and WAL fragmentation:
|
|
289
|
+
fastrmemory heal
|
|
290
|
+
|
|
291
|
+
# 0.3.0: Report orphaned records, duplicate active memories, and stale rows:
|
|
292
|
+
fastrmemory hygiene
|
|
293
|
+
fastrmemory hygiene --stale-days 30 --json --fail-on-issues
|
|
294
|
+
|
|
295
|
+
# Tag a UI screenshot or architecture diagram with OCR & 384-dim vector indexing:
|
|
296
|
+
fastrmemory vision tag screenshots/modal-error.png --desc "Modal error 401 alert" --ocr "HTTP 401"
|
|
297
|
+
|
|
298
|
+
# Semantic search across tagged screenshots and visual diagrams:
|
|
299
|
+
fastrmemory vision search "modal error 401"
|
|
300
|
+
|
|
301
|
+
# Pre-merge CI/CD gate checking PR diffs against active error traps:
|
|
302
|
+
fastrmemory guard --strict
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
`fastrmemory hygiene` reports orphaned file links, conflict rows, and feedback rows; duplicate active memories by normalized title or exact content; and stale unpinned active memories (default 90 days since the last recall or creation). `npm run check:hygiene` runs the same inspector against a deterministic fixture inside `check:ci`; it does not mutate a project database. Use `--fail-on-issues` when a script should exit nonzero on findings.
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## 🔌 One-Click Agent MCP Configuration
|
|
310
|
+
|
|
311
|
+
Use the installer when possible. `fastr setup` writes the platform-correct command (`node` with an absolute CLI path, or `cmd /c npx` where needed) and pins user-scoped clients to the project root. `fastr hook install` writes project-scoped configs and lifecycle hooks. The manual snippets below use `npx` for project-scoped clients; for user-scoped clients (Claude Desktop, Antigravity, Windsurf, and the Claude Code entry in `~/.claude.json`), append `--project /absolute/path/to/repo`.
|
|
312
|
+
|
|
313
|
+
### Claude Code (`~/.claude.json`, user-scoped)
|
|
314
|
+
```json
|
|
315
|
+
{
|
|
316
|
+
"mcpServers": {
|
|
317
|
+
"fastrmemory": {
|
|
318
|
+
"command": "npx",
|
|
319
|
+
"args": ["-y", "fastrmemory@0.3.1", "mcp", "--project", "/absolute/path/to/your/repo"]
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### Cursor (`.cursor/mcp.json`, project-scoped)
|
|
326
|
+
```json
|
|
327
|
+
{
|
|
328
|
+
"mcpServers": {
|
|
329
|
+
"fastrmemory": {
|
|
330
|
+
"command": "npx",
|
|
331
|
+
"args": ["-y", "fastrmemory@0.3.1", "mcp"]
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### Gemini CLI (`.gemini/settings.json`, project-scoped, 0.3.0)
|
|
338
|
+
```json
|
|
339
|
+
{
|
|
340
|
+
"mcpServers": {
|
|
341
|
+
"fastrmemory": {
|
|
342
|
+
"command": "npx",
|
|
343
|
+
"args": ["-y", "fastrmemory@0.3.1", "mcp"]
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
`fastrmemory hook install` also merges `SessionStart`, `BeforeTool` (`write_file|replace`), `PreCompress`, and `SessionEnd` hooks into the same project settings file. Gemini CLI requires strict JSON on hook stdout, so the generated commands pass `--format gemini`. Google is transitioning users from Gemini CLI to Antigravity CLI; this integration targets the still-documented `.gemini/settings.json` contract.
|
|
350
|
+
|
|
351
|
+
### GitHub Copilot CLI (`.github/mcp.json`, project-scoped, 0.3.0)
|
|
352
|
+
```json
|
|
353
|
+
{
|
|
354
|
+
"mcpServers": {
|
|
355
|
+
"fastrmemory": {
|
|
356
|
+
"type": "local",
|
|
357
|
+
"command": "npx",
|
|
358
|
+
"args": ["-y", "fastrmemory@0.3.1", "mcp"]
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
`fastrmemory hook install` also merges `.github/hooks/fastrmemory.json` with `sessionStart`, `preToolUse` (`edit|create|str_replace_editor|apply_patch`), `preCompact`, and `sessionEnd` hooks. Copilot has no model-facing advisory field for `preToolUse`, so an active trap returns `permissionDecision: "ask"` with the warning; autopilot/non-interactive mode treats `ask` as deny. The shared `AGENTS.md` written by the installer supplies repository instructions.
|
|
365
|
+
|
|
366
|
+
### OpenCode V2 (`opencode.json`, project-scoped, 0.3.0)
|
|
367
|
+
```json
|
|
368
|
+
{
|
|
369
|
+
"mcp": {
|
|
370
|
+
"servers": {
|
|
371
|
+
"fastrmemory": {
|
|
372
|
+
"type": "local",
|
|
373
|
+
"command": ["npx", "-y", "fastrmemory@0.3.1", "mcp"]
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
`fastrmemory hook install` also writes `.opencode/plugins/fastrmemory/index.ts`, which injects the session-start handoff and critical rules into model context and captures a snapshot before compaction. Existing `opencode.json(c)` settings are preserved; JSONC configs are left untouched and reported for manual wiring.
|
|
381
|
+
|
|
382
|
+
> **Native Windows:** clients that cannot launch the `npx.cmd` shim directly should use `"command": "cmd"` and `"args": ["/c", "npx", "-y", "fastrmemory@0.3.1", "mcp"]` (add `--project` for user-scoped clients). `fastr setup` writes the absolute `node` path automatically and is the recommended path.
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
## 🛠️ MCP Server: Tools & Resources
|
|
387
|
+
|
|
388
|
+
Built using the official **v2 `@modelcontextprotocol/server`** SDK. The tool list below describes **0.3.1** (unchanged from 0.3.0); the v0.2.1 release has 4 resources.
|
|
389
|
+
|
|
390
|
+
### 41 MCP Tools
|
|
391
|
+
|
|
392
|
+
The default **full profile** exposes all 41 tools. For a smaller schema, start the **core profile** with `fastrmemory mcp --profile core` or `FASTR_MCP_PROFILE=core`; it exposes the 12-tool daily loop: `fastr_recall`, `fastr_remember`, `fastr_handoff`, `fastr_trap_recall`, `fastr_trap_log`, `fastr_status`, `fastr_get`, `fastr_timeline`, `fastr_diff`, `fastr_replay`, `fastr_compress`, and `fastr_diagnose`. Resources and prompts are the same in both profiles. Pass `--project /absolute/path/to/repo` when the host starts the server outside the repository, so memory is written to the intended `.fastr/fastr.db`.
|
|
393
|
+
|
|
394
|
+
#### Cognitive Retrieval & Memory Core
|
|
395
|
+
1. `fastr_recall`: Triple-stream hybrid search (BM25 + Vector + Spreading Activation Graph) with progressive L0–L3 token budgeting and air-gapped offline vector fallback.
|
|
396
|
+
2. `fastr_get`: Retrieves complete memory details (including status, timestamps, reward scores, and full content) by memory ID.
|
|
397
|
+
3. `fastr_list`: Lists memories with bounded filtering by module, kind, status, limit, and offset.
|
|
398
|
+
4. `fastr_drill`: Resolves `source_event_ids` to retrieve untruncated verbatim stack traces, diffs, and tool outputs from `raw_events`.
|
|
399
|
+
5. `fastr_file_history`: Returns active rules, `[TRAP]` warnings, and past supersessions for a specific file path.
|
|
400
|
+
6. `fastr_remember`: Records new rules, decisions, or traps. Automatically extracts NER entities, scrubs secrets, and re-renders Markdown mirrors. Supports `scope: 'project' | 'global'`.
|
|
401
|
+
7. `fastr_pin`: Pins critical rules so they are permanently preserved and prioritized in L0 assembly without time decay.
|
|
402
|
+
8. `fastr_forget`: Tombstones and deactivates an outdated memory cleanly with audit logging.
|
|
403
|
+
9. `fastr_supersede`: Retires an outdated rule (`valid_to = now`), records the rationale, and inserts a replacement verified rule.
|
|
404
|
+
10. `fastr_feedback`: Updates `reward_score` and the confidence tier on one memory ID (+0.2 good, -0.5 bad). Three consecutive bad outcomes make it dormant; never penalizes innocent memories.
|
|
405
|
+
11. `fastr_handoff`: Saves or retrieves cross-agent session milestones and promotes staging memories to verified.
|
|
406
|
+
12. `fastr_status`: Returns active/staging counts, spool health, and embedding coverage %.
|
|
407
|
+
13. `fastr_graph_query`: Explores 1-hop and 2-hop structural file-link dependencies, entity links, and connected error traps.
|
|
408
|
+
14. `fastr_timeline`: Chronological audit trail of memory events, newly verified rules, error traps, and historical supersessions.
|
|
409
|
+
|
|
410
|
+
#### Versioning & Error Traps
|
|
411
|
+
15. `fastr_snapshot`: Creates named point-in-time memory snapshots for branch tracking and experiment safety.
|
|
412
|
+
16. `fastr_rollback`: Instant Git-like rollback to any previous memory snapshot.
|
|
413
|
+
17. `fastr_trap_log`: One-line rapid logging of error traps and bug solutions with a conditional 2.0x recall boost.
|
|
414
|
+
18. `fastr_trap_recall`: Targeted lookup of high-priority error traps protecting specific target files before editing.
|
|
415
|
+
|
|
416
|
+
#### Proactive Contradiction Detection & Resolution
|
|
417
|
+
19. `fastr_conflicts`: Proactive contradiction detection using Jaccard token overlap (minimum 0.35) and 50-word opposing-polarity analysis.
|
|
418
|
+
20. `fastr_resolve`: Resolves contradictions by keeping preferred rule and superseding or weakening the loser.
|
|
419
|
+
|
|
420
|
+
#### Kahneman Planning Fallacy & Base-Rate Calibrator
|
|
421
|
+
21. `fastr_predict`: Records effort/time/risk predictions and closes predictions with actual empirical outcomes.
|
|
422
|
+
22. `fastr_predict_baserate`: Computes historical reference-class statistics (Mean, Median p50 ratio, MAE) to debias agent estimates.
|
|
423
|
+
|
|
424
|
+
#### Multi-Agent Action DAG & Frontier
|
|
425
|
+
23. `fastr_action_create`: Creates structured work item actions with prerequisite (`requires`) and conflict (`conflicts_with`) constraints.
|
|
426
|
+
24. `fastr_action_update`: Updates task lifecycle (`pending`, `active`, `done`, `blocked`), assignments, and memory crystallization.
|
|
427
|
+
25. `fastr_frontier`: Computes unblocked, ready-to-execute frontier actions with satisfied dependencies.
|
|
428
|
+
26. `fastr_next`: Atomically claims and returns the highest-priority frontier action for autonomous worker agents.
|
|
429
|
+
|
|
430
|
+
#### Bounded Working Memory & Obsidian Vault Export
|
|
431
|
+
27. `fastr_slot_get`: Retrieves bounded working memory slot (e.g. `current_goal`, `user_preferences`, `active_hypothesis`).
|
|
432
|
+
28. `fastr_slot_set`: Updates working memory slot with hard character ceiling enforcement to prevent context bloat.
|
|
433
|
+
29. `fastr_slot_list`: Lists all working memory slots and active character usage.
|
|
434
|
+
30. `fastr_obsidian_export`: Exports all memories, entities, and relationships into an Obsidian-compatible markdown vault with YAML frontmatter, `[[wikilinks]]`, and `MOC.md`.
|
|
435
|
+
|
|
436
|
+
#### Multi-Repository Federation & Context Assembly
|
|
437
|
+
31. `fastr_federate`: Manages cross-repository organization-wide shared rules and error traps via SQLite native `ATTACH DATABASE` (`~/.fastr/global.db`).
|
|
438
|
+
32. `fastr_assemble`: Dynamically formats and packs high-density structured prompt context (`<fastr_context>`) with token budgeting.
|
|
439
|
+
33. `fastr_risk_predict`: Computes historical failure probability and active trap hazard score for target codebase files.
|
|
440
|
+
34. `fastr_verify_provenance`: Cryptographically verifies SHA-256 provenance hashes for recorded agent attribution.
|
|
441
|
+
|
|
442
|
+
#### Token Compression & Autonomous Doctor
|
|
443
|
+
35. `fastr_compress`: Compresses markdown files or prompt context while strictly preserving headings, URLs, and code blocks with `.original.md` backup.
|
|
444
|
+
36. `fastr_diagnose`: Deep health audit of SQLite B-Tree integrity, FTS5 BM25 search indices, orphaned file links, and task DAGs.
|
|
445
|
+
37. `fastr_heal`: Automatic repair of database indices, dangling edges, and WAL page reclamation.
|
|
446
|
+
|
|
447
|
+
#### Memory Replay & Diff
|
|
448
|
+
38. `fastr_replay`: Reconstructs memory state at a timestamp and returns the active snapshot for audit or recovery.
|
|
449
|
+
39. `fastr_diff`: Compares two snapshots and reports added, superseded, and removed memories.
|
|
450
|
+
|
|
451
|
+
#### Multimodal Visual Memory
|
|
452
|
+
40. `fastr_vision_tag`: Tags screenshots, UI diagrams, and wireframes with OCR and semantic descriptions with 384-dim embeddings.
|
|
453
|
+
41. `fastr_vision_search`: Hybrid vector and keyword search across stored visual assets for multimodal coding agents.
|
|
454
|
+
|
|
455
|
+
### 2 MCP Prompt Templates
|
|
456
|
+
|
|
457
|
+
- `pre-edit-check`: Given file paths, instructs the agent to check traps and relevant rules before editing.
|
|
458
|
+
- `session-wrap-up`: End-of-session checklist for logging traps, superseding stale rules, scoring memories, and saving a handoff.
|
|
459
|
+
|
|
460
|
+
### 5 MCP Resources (0.3.0; v0.2.1 has 4)
|
|
461
|
+
|
|
462
|
+
- `fastr://project/overview`: L0 project summary containing active counts and storage location.
|
|
463
|
+
- `fastr://project/traps`: All active `[TRAP]` warnings for immediate bug avoidance.
|
|
464
|
+
- `fastr://session/handoff`: Latest cross-agent handoff milestone.
|
|
465
|
+
- `fastr://memory/{id}` (resource template): Full JSON for a single memory, including linked files and its validity window.
|
|
466
|
+
- `fastr://memory/{id}/envelope` (resource template): Metadata, cryptographic provenance, file/graph links, and open/resolved conflict state for one memory.
|
|
467
|
+
|
|
468
|
+
---
|
|
469
|
+
|
|
470
|
+
## 📄 Two-Zone Git-Diffable Mirror
|
|
471
|
+
|
|
472
|
+
Every write to the local SQLite database automatically synchronizes human-readable markdown files in `.fastr/pages/<module>.md`. This allows developers to review AI memories directly in GitHub Pull Requests:
|
|
473
|
+
|
|
474
|
+
```markdown
|
|
475
|
+
# Module: auth
|
|
476
|
+
|
|
477
|
+
> Auto-generated by FastrMemory. Active rules are at the top; superseded history is preserved below for Git diffs.
|
|
478
|
+
|
|
479
|
+
---
|
|
480
|
+
|
|
481
|
+
## Compiled Truth (Active Rules & Traps)
|
|
482
|
+
|
|
483
|
+
### [mem_009e4a7d] [TRAP] Never Use Date.now() Milliseconds for JWT Expiration
|
|
484
|
+
- **Kind**: `error_trap`
|
|
485
|
+
- **Status**: `verified` (Reward Score: 1)
|
|
486
|
+
- **Linked Files**: `src/auth/jwt.ts`
|
|
487
|
+
- **Active Since**: `2026-10-18T21:46:20Z`
|
|
488
|
+
|
|
489
|
+
JWT exp claims expect integer seconds. Always use Math.floor(Date.now() / 1000).
|
|
490
|
+
|
|
491
|
+
---
|
|
492
|
+
|
|
493
|
+
## Append-Only Timeline (History & Superseded)
|
|
494
|
+
|
|
495
|
+
### [EXPIRED 2026-10-18T20:00:00Z -> 2026-10-18T21:46:20Z] [mem_abc123] Token Signing
|
|
496
|
+
- **Superseded By**: `[mem_009e4a7d]`
|
|
497
|
+
- **Reason**: Standardized on integer seconds
|
|
498
|
+
- **Historical Status**: `superseded`
|
|
499
|
+
|
|
500
|
+
> Old implementation used milliseconds which failed expiration validation.
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
---
|
|
504
|
+
|
|
505
|
+
## 🧠 Planetary Agent Skills Suite
|
|
506
|
+
|
|
507
|
+
FastrMemory ships 10 Agent Skills (in `skills/`, mirrored to `.cursor/skills/`) that tell agents *when* to use each memory tool. Install them as a Claude Code plugin (`.claude-plugin/`) or copy them with `fastrmemory setup`:
|
|
508
|
+
|
|
509
|
+
- [fastr-memory](skills/fastr-memory/SKILL.md): At the start of a task and before editing files: `fastr_trap_recall`, then `fastr_recall` / `fastr_assemble`.
|
|
510
|
+
- [fastr-trap-log](skills/fastr-trap-log/SKILL.md): The moment a failure is diagnosed: record it with `fastr_trap_log`.
|
|
511
|
+
- [fastr-session-commit](skills/fastr-session-commit/SKILL.md): When a task is done and tests pass: supersede, rate memories, and `fastr_handoff` with `verifyStaging`.
|
|
512
|
+
- [fastr-curate](skills/fastr-curate/SKILL.md): When storing durable lessons or fixing contradictions: dedupe, remember, supersede, resolve conflicts, snapshot/rollback.
|
|
513
|
+
- [fastr-setup](skills/fastr-setup/SKILL.md): When FastrMemory is not wired into Claude Code: `fastrmemory hook install`, `claude mcp add`, verify with `fastrmemory status`.
|
|
514
|
+
- [fastr-plan-estimate](skills/fastr-plan-estimate/SKILL.md): When estimating effort or risk: base rates, file risk, and closing predictions.
|
|
515
|
+
- [fastr-dag](skills/fastr-dag/SKILL.md): When work has dependent steps or several agents share a backlog.
|
|
516
|
+
- [fastr-doctor](skills/fastr-doctor/SKILL.md): When recall misses memories or the database looks unhealthy: diagnose, then heal.
|
|
517
|
+
- [fastr-compress](skills/fastr-compress/SKILL.md): When a doc or context block exceeds its token budget.
|
|
518
|
+
- [fastr-vision](skills/fastr-vision/SKILL.md): When screenshots or diagrams should be remembered or searched.
|
|
519
|
+
|
|
520
|
+
Run `npm run check:skills` to validate every tool call in the skills against `src/mcp/server.ts`.
|
|
521
|
+
|
|
522
|
+
---
|
|
523
|
+
|
|
524
|
+
## 🏗️ Architecture
|
|
525
|
+
|
|
526
|
+
```mermaid
|
|
527
|
+
flowchart TD
|
|
528
|
+
subgraph Ingestion["1. Lossless Ingestion & Spool"]
|
|
529
|
+
Agent["AI Coding Agent\n(Claude Code, Cursor, Antigravity)"] --> Scrubber["Secret Scrubber\n(API Keys, Bearer, PEM)"]
|
|
530
|
+
Scrubber --> Spool{"SQLite Busy?"}
|
|
531
|
+
Spool -- Yes --> SpoolFile[".fastr/spool/pending.jsonl\n(async fallback)"]
|
|
532
|
+
Spool -- No --> DB
|
|
533
|
+
end
|
|
534
|
+
|
|
535
|
+
subgraph Storage["2. Bi-Temporal Storage & Git Mirror"]
|
|
536
|
+
DB[("Node 22 node:sqlite (WAL)\nraw_events | memories\nfile_links | handoffs")]
|
|
537
|
+
DB --> Mirror["Markdown Mirror Engine"]
|
|
538
|
+
Mirror --> Pages[".fastr/pages/<module>.md\nTop: ## Compiled Truth\nBottom: ## Append-Only Timeline"]
|
|
539
|
+
end
|
|
540
|
+
|
|
541
|
+
subgraph Search["3. Triple-Stream Hybrid Retrieval"]
|
|
542
|
+
Query["Recall / File Query"] --> FTS["Stream A: FTS5 BM25\n(Sub-millisecond)"]
|
|
543
|
+
Query --> Vec["Stream B: Xenova Vectors\n(all-MiniLM-L6-v2)"]
|
|
544
|
+
Query --> Graph["Stream C: file_links Graph\n(1-2 Hop Structural Match)"]
|
|
545
|
+
FTS & Vec & Graph --> RRF["RRF Fusion (k=20)\n+ Conditional 2.0x Error Trap Multiplier\n+ 1.25x Verified Multiplier"]
|
|
546
|
+
RRF --> Budget["Progressive Token Packer\nL0 (150t) | L1 (500t) | L2 (1500t) | L3 (4000t)"]
|
|
547
|
+
end
|
|
548
|
+
|
|
549
|
+
subgraph Protocol["4. Official MCP Protocol"]
|
|
550
|
+
Budget --> MCPServer["Official MCP v2 Server\n(@modelcontextprotocol/server)"]
|
|
551
|
+
MCPServer --> Tools["41 tools • 2 prompts • 5 resources"]
|
|
552
|
+
Tools --> Agent
|
|
553
|
+
end
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
---
|
|
557
|
+
|
|
558
|
+
## 🧪 Testing & Verification
|
|
559
|
+
|
|
560
|
+
Run the comprehensive unit test suite:
|
|
561
|
+
|
|
562
|
+
```bash
|
|
563
|
+
npm test
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
All **282 tests pass** across **52 test files** in 0.3.1 (the v0.2.1 release has **235 tests / 43 files**) covering database schema, WAL locking, offline spooling, bi-temporal supersession, secret scrubbing, two-zone rendering, automated benchmarks, snapshots/rollback, branch merge conflict reports, replay/diff, memory envelopes, confidence tiers and 3-bad dormancy, memory hygiene checks, Memory CI, conflict-aware recall, portable backup manifests and verified restore, local rule import, OpenCode V2, Gemini CLI, and Copilot CLI wiring, git-learner, cognitive blame, commit synthesis, hybrid background daemon, token compression, self-healing doctor, multimodal vision, web dashboard server, pre-merge trap guardian, UI loopback security boundaries, and atomic installer configuration safety.
|
|
567
|
+
|
|
568
|
+
**CI performance gates:** `check:query-plans`, `check:recall-latency`, and `check:install-size` run inside `check:ci`. CI executes them on the canonical Ubuntu/Node 24 job; other matrix jobs set `FASTR_PERF_GATE=0` because timing is runner-sensitive, while functional tests still run on every matrix entry.
|
|
569
|
+
|
|
570
|
+
**Crash-safety evidence:** `npm run test:crash` kills the writer at randomized points across 10 runs, then reopens the WAL database. The committed report at [`bench/results/crash-test.json`](bench/results/crash-test.json) records **10,718 acknowledged writes**, **10,727 committed rows**, **0 lost**, **0 duplicate ids/titles**, and `PRAGMA integrity_check = ok`; methodology is in [`docs/audit/2026-10-21-crash-test.md`](docs/audit/2026-10-21-crash-test.md). `npm run check:crash` validates the report during `check:ci`. This is a process-crash test (`taskkill /F`), not a power-loss test; SQLite runs with `synchronous=NORMAL` in WAL mode.
|
|
571
|
+
|
|
572
|
+
---
|
|
573
|
+
|
|
574
|
+
## Retrieval Benchmark (240 synthetic cases)
|
|
575
|
+
|
|
576
|
+
Generated from [`bench/results/minilm.json`](bench/results/minilm.json) on **2026-10-20** at benchmark commit `562f461`. The corpus is deterministic: 120 memories and 240 queries, split into **192 train / 48 holdout (20%)**. The holdout was fixed before tuning and is reported separately. Reproduce with:
|
|
577
|
+
|
|
578
|
+
```bash
|
|
579
|
+
npx tsx scripts/eval-bench.ts --split all --embeddings minilm --out bench/results/minilm.json
|
|
580
|
+
npx tsx scripts/eval-bench.ts --split all --embeddings hash --out bench/results/hash.json
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
| Configuration | Split | Cases | Hit@1 | Hit@3 | Hit@5 | MRR | nDCG@10 | Context tokens | p50 |
|
|
584
|
+
| :--- | :--- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
|
|
585
|
+
| FastrMemory + MiniLM | Train | 192 | 96.4% | 99.0% | 100% | 0.976 | 0.982 | 208 | 3.30 ms |
|
|
586
|
+
| FastrMemory + MiniLM | **Holdout** | 48 | **95.8%** | **97.9%** | **100%** | **0.969** | **0.977** | 209 | 3.41 ms |
|
|
587
|
+
| FastrMemory BM25-only | Train | 192 | 79.7% | 90.6% | 100% | 0.868 | 0.900 | 203 | 0.48 ms |
|
|
588
|
+
| FastrMemory BM25-only | Holdout | 48 | 77.1% | 77.1% | 93.8% | 0.804 | 0.835 | 204 | 0.60 ms |
|
|
589
|
+
| Static dump - simulated baseline | Train | 192 | 2.1% | 6.3% | 8.3% | 0.055 | 0.081 | 3652 | 0.00 ms |
|
|
590
|
+
| Static dump - simulated baseline | Holdout | 48 | 0.0% | 0.0% | 8.3% | 0.025 | 0.056 | 3652 | 0.00 ms |
|
|
591
|
+
|
|
592
|
+
> **Caveats:** this is a deterministic synthetic corpus, not SWE-bench or LongMemEval. The static-dump row is a simulation implemented in this repository, not an external project. Separate public retrieval-only external baselines are documented in [docs/EXTERNAL_BASELINE.md](docs/EXTERNAL_BASELINE.md); the synthetic table does not measure them. Context tokens are the compact prompt text under a 250-token budget; the ranked result objects retain full memory content. Methodology, per-category breakdowns, ablations, and confidence intervals are in [BENCHMARKS.md](BENCHMARKS.md) and [docs/benchmark-report.md](docs/benchmark-report.md).
|
|
593
|
+
|
|
594
|
+
## 🖥️ Local Web Dashboard v2 & 3D Brain Observatory
|
|
595
|
+
|
|
596
|
+
Visualize active rules, error traps, timeline audits, and interactive 3D memory constellations directly in your browser from bundled UI assets (no external service or database):
|
|
597
|
+
|
|
598
|
+
```bash
|
|
599
|
+
fastrmemory ui
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
- **Live URL**: `http://localhost:4242`
|
|
603
|
+
- **Dashboard v2 Architecture**: Built with **shadcn/ui**, **Tailwind CSS v4**, and **TanStack Query**, with SSE updates plus version polling for cross-process writes.
|
|
604
|
+
- **12 Focused Route Workspaces (0.3.0 adds `/replay`)**:
|
|
605
|
+
- `/`: Real-time system vitals, active trap alerts, recent memory feed, and quick-action shortcuts.
|
|
606
|
+
- `/memories`: Search, filter, and inspect memories with the slide-out **Memory Detail Sheet**, status toggles, pin, and 1-click forget.
|
|
607
|
+
- `/traps`: Dedicated **Error Trap Quarantine** displaying governing files, conditional boost conditions, and verified mitigation lessons.
|
|
608
|
+
- `/conflicts`: Proactive bi-temporal contradiction detection with side-by-side **Word Diff** and 1-click resolution (`Keep A`, `Keep B`, `Keep Both`).
|
|
609
|
+
- `/actions`: Real-time interactive **Action DAG Canvas** tracking task dependencies, worker assignments, and glowing unblocked frontier aura.
|
|
610
|
+
- `/graph`: Interactive file and entity relationship graph with 1-hop/2-hop inspection and memory drill-down.
|
|
611
|
+
- `/observatory`: High-performance **Three.js 3D Constellation Galaxy** with a smooth lerp camera, celestial star dust, glowing amber trap halos, and memory inspect modals.
|
|
612
|
+
- `/treemap`: Interactive high-DPI squarified treemap visualising memory strength bands and module density.
|
|
613
|
+
- `/search`: **Search Lab** evaluating triple-stream RRF retrieval with latency waterfall breakdown (BM25 vs Vector vs Graph).
|
|
614
|
+
- `/replay` (**0.3.0**): **Replay & Diff** workspace reconstructing the active set at two timestamps with snapshot metrics and added/superseded/changed/conflict review.
|
|
615
|
+
- `/health`: Autonomous SQLite self-healing Doctor with 1-click integrity diagnosis, FTS5 rebuild, and vacuum.
|
|
616
|
+
- `/settings`: Live database path, project configuration, and export controls.
|
|
617
|
+
- **Memory CI**: The PR diff workflow and comment lifecycle are documented in [docs/MEMORY_CI.md](docs/MEMORY_CI.md).
|
|
618
|
+
- **Dual Theme Support**: Light, dark, and system-preference modes.
|
|
619
|
+
- **Default Zero-Daemon Path**: The dashboard is served by the in-process Node.js HTTP server and embedded SQLite WAL mode; `fastrmemory daemon start` is an optional local REST/SSE service.
|
|
620
|
+
|
|
621
|
+
---
|
|
622
|
+
|
|
623
|
+
## 🧩 Native VS Code & Cursor Extension
|
|
624
|
+
|
|
625
|
+
Package and install the native FastrMemory Guardian extension for **VS Code** and **Cursor**:
|
|
626
|
+
|
|
627
|
+
```bash
|
|
628
|
+
# Compile and package extension
|
|
629
|
+
npm run build:extension
|
|
630
|
+
npx @vscode/vsce package --no-dependencies
|
|
631
|
+
|
|
632
|
+
# Install into Cursor or VS Code
|
|
633
|
+
cursor --install-extension fastrmemory-vscode-0.1.0.vsix
|
|
634
|
+
```
|
|
635
|
+
|
|
636
|
+
- **⚡ Status Bar Pill**: Displays active trap count in the status bar (`⚡ 3 Traps Active` or `⚡ 1 Trap on File`). Clicking opens an interactive QuickPick listing all active traps.
|
|
637
|
+
- **Amber Underlines**: Trapped files are underlined in amber with full hover mitigation instructions and conditional 2.0x boost conditions.
|
|
638
|
+
- **Problems Tab Integration**: Active error traps populate the IDE Problems panel as non-blocking warning diagnostics.
|
|
639
|
+
- **Zero Daemons**: Reads directly from `.fastr/fastr.db` via `node:sqlite`.
|
|
640
|
+
|
|
641
|
+
---
|
|
642
|
+
|
|
643
|
+
## 🤝 Contributing & Pull Request Roadmap
|
|
644
|
+
|
|
645
|
+
We warmly welcome contributions from the open-source community! Whether you are adding a new AI coding agent hook, integrating local embedding backends, or crafting 3D visualizations, your pull requests are valued and reviewed promptly.
|
|
646
|
+
|
|
647
|
+
### 🏆 Contributor Wall of Fame
|
|
648
|
+
|
|
649
|
+
Special thanks to **[@the-arizul](https://github.com/the-arizul)** for architecting PRs #1 through #11:
|
|
650
|
+
- **PR #1**: Loopback security boundaries, DNS rebinding lockdown, and `dist-ui` package resolution.
|
|
651
|
+
- **PR #2**: Safe atomic JSON config merges, nested Claude Code hook schemas, and sandboxed installer tests.
|
|
652
|
+
- **PR #3**: Hardened GitHub Actions fork PR comment safety.
|
|
653
|
+
- **PR #4**: Core SQLite B-tree heal, BUSY spool fallback, ATTACH injection prevention, and atomic claim/supersede.
|
|
654
|
+
- **PR #5**: Git security hardening (zero shell interpolation, confined paths, and high-entropy secret scrubbing).
|
|
655
|
+
- **PR #6**: Triple-stream RRF recall ranking calibration, zero irrelevant results, and Unicode query normalization.
|
|
656
|
+
- **PR #7**: MCP server hardening (`isError` handling, bounded inputs, parameter annotations, prompts, and new tools: `fastr_get`, `fastr_list`, `fastr_pin`, `fastr_forget`).
|
|
657
|
+
- **PR #8**: Skills suite consolidation, plugin manifest, and CI validation runner.
|
|
658
|
+
- **PR #9**: VS Code extension headless activation fallback and staging trap decorations.
|
|
659
|
+
- **PR #10**: Isolated benchmark database harnesses and calibrated baselines.
|
|
660
|
+
- **PR #11**: Planetary Dashboard v2 overhaul with shadcn/ui, Tailwind CSS v4, and live cross-process sync.
|
|
661
|
+
|
|
662
|
+
---
|
|
663
|
+
|
|
664
|
+
### 🗺️ Open Contribution Roadmap
|
|
665
|
+
|
|
666
|
+
| Domain / Focus Area | What Needs Building | Difficulty | Reference Location | Target PR Scope |
|
|
667
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
668
|
+
| **Agent Hook Installers** | Auto-wire hooks & skills for Windsurf, Roo Code, Continue, and Warp | `good first issue` | [src/installer/setup.ts](src/installer/setup.ts) | `feat(installer)` |
|
|
669
|
+
| **Local Embedding Providers** | Optional on-device backends (Ollama, llama.cpp, WebGPU) with air-gapped fallback | Intermediate | [src/search/embeddings.ts](src/search/embeddings.ts) | `feat(embeddings)` |
|
|
670
|
+
| **IDE Extensions** | JetBrains (IntelliJ / WebStorm) and Neovim Lua plugin with status bar pill & trap underlines | Advanced | [extensions/vscode/](extensions/vscode/) | `feat(ide)` |
|
|
671
|
+
| **Benchmark Runners** | SWE-bench and additional public QA scenario runners; LongMemEval and LoCoMo retrieval harnesses already exist | `good first issue` | [src/bench/benchmark.ts](src/bench/benchmark.ts) | `feat(bench)` |
|
|
672
|
+
| **UI Visualizations** | Custom Three.js shaders, Treemap color palettes, and SVG/PNG graph exports | Intermediate | [ui/src/components/](ui/src/components/) | `feat(ui)` |
|
|
673
|
+
|
|
674
|
+
---
|
|
675
|
+
|
|
676
|
+
### 🚀 Pull Request Workflow
|
|
677
|
+
|
|
678
|
+
1. **Fork & Clone Repository**:
|
|
679
|
+
```bash
|
|
680
|
+
git clone https://github.com/<your-username>/fastrmemory.git
|
|
681
|
+
cd fastrmemory
|
|
682
|
+
```
|
|
683
|
+
|
|
684
|
+
2. **Install Dependencies & Verify Test Suite (282 Tests Passing)**:
|
|
685
|
+
```bash
|
|
686
|
+
npm install
|
|
687
|
+
npm test
|
|
688
|
+
```
|
|
689
|
+
|
|
690
|
+
3. **Create a Feature Branch**:
|
|
691
|
+
```bash
|
|
692
|
+
git checkout -b feat/add-windsurf-hooks
|
|
693
|
+
# or for bug fixes:
|
|
694
|
+
git checkout -b fix/sqlite-busy-retry
|
|
695
|
+
```
|
|
696
|
+
|
|
697
|
+
4. **Implement Changes & Verify All Packages Compile**:
|
|
698
|
+
```bash
|
|
699
|
+
# Compiles backend, React UI, and VS Code extension
|
|
700
|
+
npm run build:all
|
|
701
|
+
npm test
|
|
702
|
+
```
|
|
703
|
+
|
|
704
|
+
5. **Commit with DCO Sign-off (`-s`) & Open Pull Request**:
|
|
705
|
+
```bash
|
|
706
|
+
git commit -s -m "feat(installer): add windsurf auto-hook integration"
|
|
707
|
+
git push origin feat/add-windsurf-hooks
|
|
708
|
+
```
|
|
709
|
+
|
|
710
|
+
---
|
|
711
|
+
|
|
712
|
+
### 📋 Pull Request Quality Checklist
|
|
713
|
+
|
|
714
|
+
Before submitting your PR, verify:
|
|
715
|
+
- [ ] **Strict TypeScript**: `npm run build:all` passes without type errors.
|
|
716
|
+
- [ ] **Zero External Daemons**: Engine runs in-process via Node.js WAL SQLite.
|
|
717
|
+
- [ ] **100% Test Green**: `npm test` passes all 282 unit tests across 52 files.
|
|
718
|
+
- [ ] **DCO Sign-off**: All commits signed off using `git commit -s` ([Developer Certificate of Origin](https://developercertificate.org/)).
|
|
719
|
+
- [ ] **Pre-Merge Trap Guardian**: Run `fastrmemory guard --strict` to verify no active error traps are violated.
|
|
720
|
+
|
|
721
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for full architectural guidelines, secret scrubbing rules, and local development environment setup.
|
|
722
|
+
|
|
723
|
+
---
|
|
724
|
+
|
|
725
|
+
## 📄 License
|
|
726
|
+
|
|
727
|
+
Apache License 2.0. Built by **Fastrsoft**. Free for personal and commercial use.
|