@theihtisham/agent-shadow-brain 6.0.2 → 6.0.3
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/CHANGELOG.md +372 -0
- package/README.md +366 -455
- package/dist/brain/auto-update.js +1 -1
- package/dist/brain/brain-portability.js +3 -3
- package/dist/brain/brain-portability.js.map +1 -1
- package/dist/brain/context-continuity.d.ts +78 -0
- package/dist/brain/context-continuity.d.ts.map +1 -0
- package/dist/brain/context-continuity.js +341 -0
- package/dist/brain/context-continuity.js.map +1 -0
- package/dist/brain/global-brain.d.ts.map +1 -1
- package/dist/brain/global-brain.js +35 -9
- package/dist/brain/global-brain.js.map +1 -1
- package/dist/brain/live-brain.d.ts +119 -0
- package/dist/brain/live-brain.d.ts.map +1 -0
- package/dist/brain/live-brain.js +405 -0
- package/dist/brain/live-brain.js.map +1 -0
- package/dist/brain/mcp-server.d.ts +4 -0
- package/dist/brain/mcp-server.d.ts.map +1 -1
- package/dist/brain/mcp-server.js +81 -5
- package/dist/brain/mcp-server.js.map +1 -1
- package/dist/brain/memory-seeder.d.ts +78 -0
- package/dist/brain/memory-seeder.d.ts.map +1 -0
- package/dist/brain/memory-seeder.js +326 -0
- package/dist/brain/memory-seeder.js.map +1 -0
- package/dist/brain/orchestrator.js +1 -1
- package/dist/brain/token-economy.d.ts +2 -0
- package/dist/brain/token-economy.d.ts.map +1 -1
- package/dist/brain/token-economy.js +80 -24
- package/dist/brain/token-economy.js.map +1 -1
- package/dist/cli.js +240 -31
- package/dist/cli.js.map +1 -1
- package/dist/dashboard/server.d.ts +5 -0
- package/dist/dashboard/server.d.ts.map +1 -1
- package/dist/dashboard/server.js +355 -2
- package/dist/dashboard/server.js.map +1 -1
- package/dist/dashboard/v6-dashboard-html.d.ts +1 -1
- package/dist/dashboard/v6-dashboard-html.d.ts.map +1 -1
- package/dist/dashboard/v6-dashboard-html.js +755 -85
- package/dist/dashboard/v6-dashboard-html.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +17 -12
- package/dist/types.d.ts.map +1 -1
- package/docs/launch/README.md +61 -0
- package/docs/launch/RELEASE_CHECKLIST_v6.0.3.md +102 -0
- package/docs/launch/RELEASE_NOTES_v6.0.3.md +111 -0
- package/package.json +25 -13
- package/tools/export-resume-pack.mjs +56 -0
- package/tools/record-global-memory.mjs +72 -0
package/README.md
CHANGED
|
@@ -1,455 +1,366 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
##
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
161
|
-
|
|
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
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
shadow-brain
|
|
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
|
-
# Full list
|
|
368
|
-
shadow-brain --help
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
---
|
|
372
|
-
|
|
373
|
-
## 🎯 Tweetable Talking Points
|
|
374
|
-
|
|
375
|
-
> *"Shadow Brain is the first open-source brain that works with sub-agents. Claude Task, Cursor Composer, CrewAI, LangGraph, AutoGen — all finally share context. One `npx` command. Zero API keys."*
|
|
376
|
-
|
|
377
|
-
> *"Every AI decision Shadow Brain makes is Ed25519-signed. Every cause is traced. Every collision is caught before it happens. Free forever."*
|
|
378
|
-
|
|
379
|
-
> *"22 novel features nobody else has. Free. Open source. Local-first. `npx @theihtisham/agent-shadow-brain`."*
|
|
380
|
-
|
|
381
|
-
---
|
|
382
|
-
|
|
383
|
-
## 🛠️ For Contributors
|
|
384
|
-
|
|
385
|
-
```bash
|
|
386
|
-
git clone https://github.com/theihtisham/agent-shadow-brain.git
|
|
387
|
-
cd agent-shadow-brain
|
|
388
|
-
npm install
|
|
389
|
-
npm run build
|
|
390
|
-
npm test # 148/148 tests
|
|
391
|
-
npm run dev # ts-node dev mode
|
|
392
|
-
|
|
393
|
-
# Rebuild the explainer video
|
|
394
|
-
node tools/record-motion-explainer.mjs
|
|
395
|
-
|
|
396
|
-
# Capture fresh dashboard screenshots
|
|
397
|
-
node tools/capture-screenshots.mjs
|
|
398
|
-
|
|
399
|
-
# Seed the brain with demo data
|
|
400
|
-
node tools/seed-brain.mjs
|
|
401
|
-
```
|
|
402
|
-
|
|
403
|
-
Issues, PRs, discussions welcome. See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
404
|
-
|
|
405
|
-
---
|
|
406
|
-
|
|
407
|
-
## 📚 Documentation
|
|
408
|
-
|
|
409
|
-
- **[CHANGELOG.md](CHANGELOG.md)** — release notes
|
|
410
|
-
- **[docs/versions/v6.0.0.md](docs/versions/v6.0.0.md)** — v6 release details
|
|
411
|
-
- **[docs/launch/HIVEMIND_VIDEO.md](docs/launch/HIVEMIND_VIDEO.md)** — video production pipeline
|
|
412
|
-
- **[docs/launch/screenshots/](docs/launch/screenshots/)** — all 29 dashboard screenshots
|
|
413
|
-
- **[SECURITY.md](SECURITY.md)** — security policy
|
|
414
|
-
- **[CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)** — community guidelines
|
|
415
|
-
|
|
416
|
-
---
|
|
417
|
-
|
|
418
|
-
## 💬 Community
|
|
419
|
-
|
|
420
|
-
- **[GitHub Issues](https://github.com/theihtisham/agent-shadow-brain/issues)** — bug reports, feature requests
|
|
421
|
-
- **[GitHub Discussions](https://github.com/theihtisham/agent-shadow-brain/discussions)** — questions, ideas, show-and-tell
|
|
422
|
-
- **[GitHub Releases](https://github.com/theihtisham/agent-shadow-brain/releases)** — download the explainer MP4 + release assets
|
|
423
|
-
|
|
424
|
-
**If Shadow Brain makes your AI agents smarter, star the repo ⭐**
|
|
425
|
-
|
|
426
|
-
---
|
|
427
|
-
|
|
428
|
-
## ⭐ Stargazers Over Time
|
|
429
|
-
|
|
430
|
-
[](https://star-history.com/#theihtisham/agent-shadow-brain&Date)
|
|
431
|
-
|
|
432
|
-
---
|
|
433
|
-
|
|
434
|
-
## 📜 License
|
|
435
|
-
|
|
436
|
-
**MIT** — see [LICENSE](LICENSE).
|
|
437
|
-
|
|
438
|
-
Free to use, modify, fork, commercialize. Local-first by default. Works offline, in air-gapped environments, in privacy-constrained enterprises. No telemetry. No phone-home. No trial expiration.
|
|
439
|
-
|
|
440
|
-
---
|
|
441
|
-
|
|
442
|
-
<div align="center">
|
|
443
|
-
|
|
444
|
-
### Built by [@theihtisham](https://github.com/theihtisham)
|
|
445
|
-
|
|
446
|
-
<a href="https://github.com/theihtisham"><img src="https://img.shields.io/badge/GitHub-theihtisham-181717?style=for-the-badge&logo=github" alt="GitHub"></a>
|
|
447
|
-
<a href="https://www.npmjs.com/~theihtisham"><img src="https://img.shields.io/badge/npm-@theihtisham-CB3837?style=for-the-badge&logo=npm" alt="npm"></a>
|
|
448
|
-
|
|
449
|
-
### The Hive Mind for every AI coding agent on your machine.
|
|
450
|
-
|
|
451
|
-
**`npx @theihtisham/agent-shadow-brain@latest attach-all`**
|
|
452
|
-
|
|
453
|
-
<sub>Topics: `ai` · `llm` · `claude-code` · `cursor` · `cline` · `codex` · `copilot` · `hive-mind` · `sub-agent` · `sabb` · `causal-chains` · `dream-engine` · `reputation-ledger` · `swarm-debate` · `pre-mortem` · `branch-brain` · `attention-heatmap` · `token-economy` · `forgetting-curve` · `formal-verification` · `calibration-monitor` · `air-gap` · `e2e-encryption` · `hallucination-quarantine` · `voice-mode` · `brain-garden` · `pr-review` · `team-brain` · `brain-exchange` · `local-first` · `ollama` · `anthropic` · `openai` · `openrouter` · `gemini` · `deepseek` · `moonshot` · `mistral` · `mcp-server` · `model-context-protocol` · `lsp-server` · `cross-agent` · `multi-agent` · `autonomous-agents` · `agentic-ai` · `vibe-coding` · `cursor-ai` · `developer-tools` · `developer-productivity` · `coding-assistant` · `ai-coding` · `code-review` · `static-analysis` · `knowledge-graph` · `semantic-search` · `vector-embeddings` · `prompt-caching` · `json-mode` · `chat-with-memory` · `ed25519` · `chacha20-poly1305` · `sssp` · `turboquant` · `iclr-2026` · `arxiv` · `zero-config` · `typescript` · `open-source` · `free-forever` · `mit-license`</sub>
|
|
454
|
-
|
|
455
|
-
</div>
|
|
1
|
+
# Agent Shadow Brain
|
|
2
|
+
|
|
3
|
+
Local-first memory and coordination for AI coding agents.
|
|
4
|
+
|
|
5
|
+
Version: 6.0.3
|
|
6
|
+
|
|
7
|
+
Agent Shadow Brain gives tools like Codex, Claude Code, Cursor, Cline, OpenCode, Aider, and related MCP clients a shared local memory layer. It stores compact, source-backed lessons about projects, recalls them later, generates fresh-session briefings, audits memory quality, and exports JSONL training/eval packs.
|
|
8
|
+
|
|
9
|
+
It does not change model weights by itself. It helps agents work better by giving them relevant, current, source-linked context before and during complex work.
|
|
10
|
+
|
|
11
|
+
## What It Actually Does
|
|
12
|
+
|
|
13
|
+
- Stores cross-project and cross-agent memories in a local JSON brain at `~/.shadow-brain/global.json`.
|
|
14
|
+
- Recalls memories by project, agent, category, and keywords.
|
|
15
|
+
- Generates source-backed resume packs for fresh sessions, account switches, context compaction, and handoffs.
|
|
16
|
+
- Audits memory quality: source coverage, stale entries, duplicates, low-quality notes, recall health.
|
|
17
|
+
- Creates verified memory seed drafts from dashboard/API, then requires user, agent, or dual approval before writing to durable memory.
|
|
18
|
+
- Exports JSONL rows for evals, distillation, or local fine-tuning pipelines.
|
|
19
|
+
- Provides CLI, dashboard API, and MCP tool surfaces.
|
|
20
|
+
- Includes safety helpers such as hook audit, detach, and action firewall checks.
|
|
21
|
+
- Works without telemetry and without an API key for local memory features.
|
|
22
|
+
|
|
23
|
+
## What It Does Not Claim
|
|
24
|
+
|
|
25
|
+
- It does not secretly train GPT, Claude, Gemini, or any remote model.
|
|
26
|
+
- It does not guarantee perfect recall.
|
|
27
|
+
- It does not replace project docs, tests, source control, or human review.
|
|
28
|
+
- It does not make every listed agent automatically available. Agent support depends on local installation and hook/config compatibility.
|
|
29
|
+
- It does not publish or sync data unless you explicitly use export, sync, or other sharing commands.
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install -g @theihtisham/agent-shadow-brain
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
CLI binaries:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
shadow-brain --help
|
|
41
|
+
asb --help
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
You can also run without global install:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npx @theihtisham/agent-shadow-brain@latest --help
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Safe First Run
|
|
51
|
+
|
|
52
|
+
Start by auditing before attaching hooks:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
shadow-brain audit-hooks .
|
|
56
|
+
shadow-brain live-brain status .
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Only attach after you review what will be changed:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
shadow-brain attach-all .
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Detach later if needed:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
shadow-brain detach-all .
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## v6.0.3: Live Brain
|
|
72
|
+
|
|
73
|
+
The 6.0.3 release focuses on practical long-memory improvement for agents.
|
|
74
|
+
|
|
75
|
+
### Live Brain Status
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
shadow-brain live-brain status .
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Shows:
|
|
82
|
+
|
|
83
|
+
- memory count
|
|
84
|
+
- average memory quality
|
|
85
|
+
- source coverage
|
|
86
|
+
- stale memories
|
|
87
|
+
- duplicate clusters
|
|
88
|
+
- recall eval score
|
|
89
|
+
- recommended cleanup actions
|
|
90
|
+
|
|
91
|
+
JSON output:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
shadow-brain live-brain status . --json
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Agent Briefing
|
|
98
|
+
|
|
99
|
+
Generate a markdown briefing for a fresh agent session:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
shadow-brain live-brain brief . -o SHADOW_BRAIN_AGENT_BRIEF.md
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
The briefing includes:
|
|
106
|
+
|
|
107
|
+
- rules for agents
|
|
108
|
+
- top source-backed memories
|
|
109
|
+
- memory warnings
|
|
110
|
+
- recall health
|
|
111
|
+
- commands agents should run next
|
|
112
|
+
|
|
113
|
+
### Recall Eval
|
|
114
|
+
|
|
115
|
+
Check whether the brain can retrieve useful memories for common agent tasks:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
shadow-brain live-brain eval .
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Custom eval queries use pipe separators:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
shadow-brain live-brain eval . --queries "current blocker|do not repeat|verified command"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Memory Hygiene
|
|
128
|
+
|
|
129
|
+
List concrete cleanup and learning actions:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
shadow-brain live-brain hygiene .
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
This highlights missing sources, stale memories, duplicates, weak recall, and missing project-scoped memories.
|
|
136
|
+
|
|
137
|
+
### Training/Eval Export
|
|
138
|
+
|
|
139
|
+
Export source-backed memories as JSONL:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
shadow-brain live-brain train-pack . --out shadow-brain-training.jsonl
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
This is useful for:
|
|
146
|
+
|
|
147
|
+
- retrieval evals
|
|
148
|
+
- local distillation experiments
|
|
149
|
+
- supervised fine-tuning datasets
|
|
150
|
+
- memory regression tests
|
|
151
|
+
|
|
152
|
+
The export is only data preparation. You choose the downstream training/eval tool.
|
|
153
|
+
|
|
154
|
+
## Core Memory Commands
|
|
155
|
+
|
|
156
|
+
Recall from the global brain:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
shadow-brain global recall --query "current blocker next step" --json --limit 8
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Show global stats:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
shadow-brain global stats
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Create a source-backed resume seed:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
shadow-brain resume-seed . -o SHADOW_BRAIN_RESUME_SEED.md
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Show what a project has learned:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
shadow-brain timeline . --limit 30
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Create a cross-agent handoff packet:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
shadow-brain handoff codex claude-code . --task "continue release verification"
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Record a durable memory from a script:
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
node tools/record-global-memory.mjs ^
|
|
190
|
+
--project-dir "." ^
|
|
191
|
+
--project-name "my-project" ^
|
|
192
|
+
--agent codex ^
|
|
193
|
+
--category "project.lesson" ^
|
|
194
|
+
--importance 0.8 ^
|
|
195
|
+
--tags "memory,release" ^
|
|
196
|
+
--sources "README.md,CHANGELOG.md" ^
|
|
197
|
+
--content "Keep release notes source-backed and verify npm metadata before publish."
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Dashboard
|
|
201
|
+
|
|
202
|
+
Start the local dashboard:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
shadow-brain dash . --no-open --port 7341
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
For a fast UI/API-only launch on a large repo:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
shadow-brain dash . --no-open --no-analysis --host 127.0.0.1 --port 7341
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Open:
|
|
215
|
+
|
|
216
|
+
```text
|
|
217
|
+
http://127.0.0.1:7341
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
The v6 dashboard includes a **Live Brain** tab for memory health, source coverage, recall evals, hygiene actions, top memories, and the generated agent briefing.
|
|
221
|
+
|
|
222
|
+
It also includes:
|
|
223
|
+
|
|
224
|
+
- **Memory Browser intelligence cards** for total memories, source coverage, fresh learning, seed queue, top categories, agent coverage, and top tags.
|
|
225
|
+
- **Memory Seeder** for controlled research-to-memory workflows. Drafts stay out of the global brain until approval is complete.
|
|
226
|
+
- **Token Economy accuracy split**: current runtime agent is shown separately from historical model spend, so old Claude/Cursor spend records do not imply the dashboard is running that agent.
|
|
227
|
+
|
|
228
|
+
Memory seeding API:
|
|
229
|
+
|
|
230
|
+
```text
|
|
231
|
+
GET /api/v6/seed-drafts
|
|
232
|
+
POST /api/v6/seed-draft
|
|
233
|
+
POST /api/v6/seed-approve
|
|
234
|
+
POST /api/v6/seed-reject
|
|
235
|
+
POST /api/v6/seed-commit
|
|
236
|
+
GET /api/v6/memory-intelligence
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Useful API endpoints:
|
|
240
|
+
|
|
241
|
+
```text
|
|
242
|
+
GET/POST /api/v6/live-brain
|
|
243
|
+
GET/POST /api/v6/resume-pack
|
|
244
|
+
GET/POST /api/v6/ww2br-recall
|
|
245
|
+
GET/POST /api/v6/memory-browser
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Example:
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
curl "http://127.0.0.1:7341/api/v6/live-brain?projectDir=C:/path/to/project"
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
## MCP Tools
|
|
255
|
+
|
|
256
|
+
The MCP server exposes memory and agent-control tools for compatible clients.
|
|
257
|
+
|
|
258
|
+
New in 6.0.3:
|
|
259
|
+
|
|
260
|
+
- `live_brain_status`
|
|
261
|
+
- `live_brain_brief`
|
|
262
|
+
- `live_brain_train_pack`
|
|
263
|
+
|
|
264
|
+
Existing useful tools include:
|
|
265
|
+
|
|
266
|
+
- `global_recall`
|
|
267
|
+
- `global_stats`
|
|
268
|
+
- `global_timeline`
|
|
269
|
+
- `subconscious_inject`
|
|
270
|
+
- `agent_handoff`
|
|
271
|
+
- `firewall_check`
|
|
272
|
+
|
|
273
|
+
Start MCP from the dashboard API or existing CLI/server integration, depending on your setup.
|
|
274
|
+
|
|
275
|
+
## How Agents Should Use It
|
|
276
|
+
|
|
277
|
+
Recommended workflow for complex work:
|
|
278
|
+
|
|
279
|
+
1. Run `shadow-brain live-brain status <project>`.
|
|
280
|
+
2. Generate or read a live briefing.
|
|
281
|
+
3. Verify current project docs and source files.
|
|
282
|
+
4. Work normally.
|
|
283
|
+
5. Record only durable, source-backed lessons after proof.
|
|
284
|
+
6. Run recall evals when memory quality starts to drift.
|
|
285
|
+
|
|
286
|
+
Good memories are short, action-oriented, and source-backed:
|
|
287
|
+
|
|
288
|
+
```text
|
|
289
|
+
[lesson:release-readme-v1] Before publishing, verify package.json version, package-lock root version, README install commands, build output, and npm pack contents.
|
|
290
|
+
Sources: package.json; package-lock.json; README.md
|
|
291
|
+
Tags: release,npm,verification
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
Bad memories are vague:
|
|
295
|
+
|
|
296
|
+
```text
|
|
297
|
+
Make project better.
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
## Local Data
|
|
301
|
+
|
|
302
|
+
Default global brain:
|
|
303
|
+
|
|
304
|
+
```text
|
|
305
|
+
~/.shadow-brain/global.json
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
Project-local generated files may include:
|
|
309
|
+
|
|
310
|
+
```text
|
|
311
|
+
SHADOW_BRAIN_AGENT_BRIEF.md
|
|
312
|
+
SHADOW_BRAIN_RESUME_SEED.md
|
|
313
|
+
shadow-brain-training.jsonl
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
Do not store secrets, API keys, passwords, private keys, or raw credentials in memory content, metadata, tags, prompts, reports, or exported training data.
|
|
317
|
+
|
|
318
|
+
## Development
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
npm install
|
|
322
|
+
npm run build
|
|
323
|
+
npm test
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
Focused tests:
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
npx vitest run tests/brain/live-brain.test.ts tests/brain/context-continuity.test.ts
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
On Windows PowerShell, if execution policy blocks `npm.ps1`, use:
|
|
333
|
+
|
|
334
|
+
```powershell
|
|
335
|
+
npm.cmd run build
|
|
336
|
+
npx.cmd vitest run tests\brain\live-brain.test.ts
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
## Release Checklist
|
|
340
|
+
|
|
341
|
+
For a 6.0.3 release:
|
|
342
|
+
|
|
343
|
+
```bash
|
|
344
|
+
npm run build
|
|
345
|
+
npm test
|
|
346
|
+
npm pack --dry-run
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
Then publish only after verifying the package contents:
|
|
350
|
+
|
|
351
|
+
```bash
|
|
352
|
+
npm publish --access public
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
GitHub release should include:
|
|
356
|
+
|
|
357
|
+
- this README
|
|
358
|
+
- `CHANGELOG.md`
|
|
359
|
+
- `docs/launch/RELEASE_NOTES_v6.0.3.md`
|
|
360
|
+
- `docs/launch/RELEASE_CHECKLIST_v6.0.3.md`
|
|
361
|
+
- build/test output
|
|
362
|
+
- npm package dry-run output
|
|
363
|
+
|
|
364
|
+
## License
|
|
365
|
+
|
|
366
|
+
MIT
|