@theihtisham/agent-shadow-brain 6.0.2 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +372 -0
- package/README.md +330 -358
- package/dist/brain/auto-update.js +1 -1
- package/dist/brain/brain-bus.d.ts +40 -0
- package/dist/brain/brain-bus.d.ts.map +1 -0
- package/dist/brain/brain-bus.js +94 -0
- package/dist/brain/brain-bus.js.map +1 -0
- package/dist/brain/brain-portability.js +3 -3
- package/dist/brain/brain-portability.js.map +1 -1
- package/dist/brain/collision-detective.d.ts.map +1 -1
- package/dist/brain/collision-detective.js +16 -0
- package/dist/brain/collision-detective.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/dream-engine.d.ts.map +1 -1
- package/dist/brain/dream-engine.js +12 -0
- package/dist/brain/dream-engine.js.map +1 -1
- package/dist/brain/forgetting-curve.d.ts.map +1 -1
- package/dist/brain/forgetting-curve.js +19 -0
- package/dist/brain/forgetting-curve.js.map +1 -1
- package/dist/brain/global-brain.d.ts +4 -0
- package/dist/brain/global-brain.d.ts.map +1 -1
- package/dist/brain/global-brain.js +61 -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-graph.d.ts +51 -0
- package/dist/brain/memory-graph.d.ts.map +1 -0
- package/dist/brain/memory-graph.js +267 -0
- package/dist/brain/memory-graph.js.map +1 -0
- 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 +349 -0
- package/dist/brain/memory-seeder.js.map +1 -0
- package/dist/brain/orchestrator.js +1 -1
- package/dist/brain/subagent-bridge.d.ts.map +1 -1
- package/dist/brain/subagent-bridge.js +12 -0
- package/dist/brain/subagent-bridge.js.map +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 +24 -0
- package/dist/dashboard/server.d.ts.map +1 -1
- package/dist/dashboard/server.js +524 -7
- 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 +2070 -213
- 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/docs/launch/RELEASE_NOTES_v6.1.0.md +38 -0
- package/docs/launch/RELEASE_NOTES_v6.2.0.md +54 -0
- package/package.json +18 -4
- package/tools/export-resume-pack.mjs +56 -0
- package/tools/record-global-memory.mjs +72 -0
package/README.md
CHANGED
|
@@ -1,455 +1,427 @@
|
|
|
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
|
-
|
|
1
|
+
# Agent Shadow Brain
|
|
2
|
+
|
|
3
|
+
Local-first memory and coordination for AI coding agents.
|
|
4
|
+
|
|
5
|
+
Version: 6.2.0
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<img src="docs/launch/agent-shadow-brain-v6.0.3-banner.png" alt="Agent Shadow Brain shared local memory layer for AI agents" width="100%">
|
|
9
|
+
</p>
|
|
10
|
+
<p align="center">
|
|
11
|
+
<a href="https://trendshift.io/repositories/20881" target="_blank"><img src="https://trendshift.io/api/badge/repositories/20881" alt="chopratejas%2Fheadroom | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
|
12
|
+
</p>
|
|
13
|
+
<p align="center">
|
|
14
|
+
<img src="docs/launch/github-trending-ready.svg" alt="GitHub Trending Ready - Agent Shadow Brain v6.0.3 live on npm" width="420">
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
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.
|
|
18
|
+
|
|
19
|
+
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.
|
|
20
|
+
|
|
21
|
+
## What's New in 6.2.0
|
|
22
|
+
|
|
23
|
+
A major dashboard upgrade focused on clarity and visibility.
|
|
24
|
+
|
|
25
|
+
- **Simple by default, Advanced on demand.** The dashboard opens with eight plain-English tabs (Home, Brain Map, Memories, Ask the Brain, Activity, Connected Tools, Brain Health, Settings). Flip to Advanced to reveal every feature — nothing was removed, just tidied.
|
|
26
|
+
- **Brain Map.** An interactive graph of everything the brain remembers — memories, projects, tools, and tags — sized by importance (PageRank) and linked by shared context. Zoom, pan, click a node for details, and watch it grow live as new memories arrive.
|
|
27
|
+
- **Realtime activity.** Memory writes, reflections, and tool events stream live over WebSocket instead of polling, with a live pulse on Home.
|
|
28
|
+
- **Live Network.** A refreshed animation of your tools talking to the brain, with flowing signal pulses.
|
|
29
|
+
- **Two-way knowledge seeding.** Quick-Save captures knowledge in one click; "Hand to Agent" generates a ready briefing to pass context back to any tool.
|
|
30
|
+
- **Plain-language everywhere.** Cryptic feature names rewritten (e.g. Calibration → Accuracy, Pre-Mortem → Risk Check, Tokens → Cost & Usage), each with a hover description.
|
|
31
|
+
|
|
32
|
+
<p align="center">
|
|
33
|
+
<img src="docs/screenshots/01-home.png" alt="Shadow Brain dashboard Home — summary of memories, connected tools, and live activity" width="100%">
|
|
34
|
+
</p>
|
|
35
|
+
<p align="center">
|
|
36
|
+
<img src="docs/screenshots/02-brain-map.png" alt="Brain Map — interactive memory constellation graph" width="100%">
|
|
37
|
+
</p>
|
|
38
|
+
<p align="center">
|
|
39
|
+
<img src="docs/screenshots/03-live-network.png" alt="Live Network — animated view of tools communicating with the brain" width="100%">
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
## What It Actually Does
|
|
43
|
+
|
|
44
|
+
- Stores cross-project and cross-agent memories in a local JSON brain at `~/.shadow-brain/global.json`.
|
|
45
|
+
- Recalls memories by project, agent, category, and keywords.
|
|
46
|
+
- Generates source-backed resume packs for fresh sessions, account switches, context compaction, and handoffs.
|
|
47
|
+
- Audits memory quality: source coverage, stale entries, duplicates, low-quality notes, recall health.
|
|
48
|
+
- Creates verified memory seed drafts from dashboard/API, then requires user, agent, or dual approval before writing to durable memory.
|
|
49
|
+
- Exports JSONL rows for evals, distillation, or local fine-tuning pipelines.
|
|
50
|
+
- Provides CLI, dashboard API, and MCP tool surfaces.
|
|
51
|
+
- Includes safety helpers such as hook audit, detach, and action firewall checks.
|
|
52
|
+
- Works without telemetry and without an API key for local memory features.
|
|
53
|
+
|
|
54
|
+
## What It Does Not Claim
|
|
55
|
+
|
|
56
|
+
- It does not secretly train GPT, Claude, Gemini, or any remote model.
|
|
57
|
+
- It does not guarantee perfect recall.
|
|
58
|
+
- It does not replace project docs, tests, source control, or human review.
|
|
59
|
+
- It does not make every listed agent automatically available. Agent support depends on local installation and hook/config compatibility.
|
|
60
|
+
- It does not publish or sync data unless you explicitly use export, sync, or other sharing commands.
|
|
61
|
+
|
|
62
|
+
## Install
|
|
56
63
|
|
|
57
64
|
```bash
|
|
58
|
-
|
|
59
|
-
|
|
65
|
+
npm install -g @theihtisham/agent-shadow-brain
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
CLI binaries:
|
|
60
69
|
|
|
61
|
-
|
|
62
|
-
|
|
70
|
+
```bash
|
|
71
|
+
shadow-brain --help
|
|
72
|
+
asb --help
|
|
63
73
|
```
|
|
64
74
|
|
|
65
|
-
|
|
75
|
+
You can also run without global install:
|
|
66
76
|
|
|
67
|
-
|
|
77
|
+
```bash
|
|
78
|
+
npx @theihtisham/agent-shadow-brain@latest --help
|
|
79
|
+
```
|
|
68
80
|
|
|
69
|
-
|
|
81
|
+
## Safe First Run
|
|
70
82
|
|
|
71
|
-
|
|
83
|
+
Start by auditing before attaching hooks:
|
|
72
84
|
|
|
73
85
|
```bash
|
|
74
|
-
|
|
75
|
-
|
|
86
|
+
shadow-brain audit-hooks .
|
|
87
|
+
shadow-brain live-brain status .
|
|
88
|
+
```
|
|
76
89
|
|
|
77
|
-
|
|
78
|
-
npm install -g @theihtisham/agent-shadow-brain
|
|
79
|
-
shadow-brain attach-all
|
|
80
|
-
shadow-brain dash . # → http://localhost:7341/
|
|
90
|
+
Only attach after you review what will be changed:
|
|
81
91
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
npx @theihtisham/agent-shadow-brain attach-all
|
|
92
|
+
```bash
|
|
93
|
+
shadow-brain attach-all .
|
|
85
94
|
```
|
|
86
95
|
|
|
87
|
-
|
|
96
|
+
Detach later if needed:
|
|
88
97
|
|
|
89
|
-
|
|
98
|
+
```bash
|
|
99
|
+
shadow-brain detach-all .
|
|
100
|
+
```
|
|
90
101
|
|
|
91
|
-
##
|
|
102
|
+
## v6.0.3: Live Brain
|
|
92
103
|
|
|
93
|
-
|
|
104
|
+
The 6.0.3 release focuses on practical long-memory improvement for agents.
|
|
94
105
|
|
|
95
|
-
###
|
|
106
|
+
### Live Brain Status
|
|
96
107
|
|
|
97
|
-
|
|
108
|
+
```bash
|
|
109
|
+
shadow-brain live-brain status .
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Shows:
|
|
113
|
+
|
|
114
|
+
- memory count
|
|
115
|
+
- average memory quality
|
|
116
|
+
- source coverage
|
|
117
|
+
- stale memories
|
|
118
|
+
- duplicate clusters
|
|
119
|
+
- recall eval score
|
|
120
|
+
- recommended cleanup actions
|
|
98
121
|
|
|
99
|
-
|
|
100
|
-
|---|---|---|
|
|
101
|
-
| 🎬 | **[Brain Replay](docs/launch/v6.0.2-samples/brain-replay-sample.svg)** | Scrubbable timeline of every brain event since day-zero. Drag the cursor, rewind to any moment. SVG export. |
|
|
102
|
-
| 🧬 | **[Brain DNA](docs/launch/v6.0.2-samples/brain-dna-sample.svg)** | Spotify-Wrapped-style fingerprint card. 8 personality archetypes (The Architect, The Debugger, …). 1080×1080 share card. |
|
|
103
|
-
| 🗳️ | **Hive Voice** | 3 local models debate-vote on every architecture question. See consensus, dissent, and confidence — live. SVG bar chart. |
|
|
104
|
-
| ⏰ | **Brain Time Capsule** | Freeze + label + resurrect brain snapshots. "Here's what we knew about React in January." Ed25519-signed bundles. |
|
|
105
|
-
| 🔬 | **Brain Diff** | Semantic diff between two brains. Venn-diagram SVG + English narrative. "What did Team A learn that Team B didn't?" |
|
|
122
|
+
JSON output:
|
|
106
123
|
|
|
107
124
|
```bash
|
|
108
|
-
shadow-brain
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
### 🎁 14 More Advanced Features
|
|
116
|
-
|
|
117
|
-
| | | | |
|
|
118
|
-
|---|---|---|---|
|
|
119
|
-
| 🎵 **Brain Cinema** — auto-procedural 60-sec SVG video | 🎼 **Brain Sonification** — your codebase as music (WAV) | 🏆 **Brain Trophies** — 25 achievements w/ share cards | 🎁 **Brain Holiday Card** — year-in-review SVG |
|
|
120
|
-
| 🧭 **Brain Coach** — 10 proactive idle-suggestion rules | 🗺️ **Brain Quest** — 5 gamified onboarding adventures | 📓 **Brain Notebook** — Jupyter-style brain explorer | ⚡ **Brain Reflex** — local-model inline completion |
|
|
121
|
-
| 🔥 **Brain Roast** — comedy code review (6 personas) | 🔮 **Brain Tarot** — 78-card divination from git+brain | 🎨 **Brain ASCII** — terminal-art brain (6 styles) | 😂 **Brain Memes** — auto-generated dev memes (10 templates) |
|
|
122
|
-
| 🌌 **Brain 3D** — rotatable Three.js graph viewer | 💞 **Brain Doppelganger** — find your codebase's twin | | |
|
|
123
|
-
|
|
124
|
-
### 🧠 10 Brain-Quality Upgrades (the engineering wins)
|
|
125
|
-
|
|
126
|
-
| Recall quality | Memory arch | Efficiency | Intelligence | Size + Learning |
|
|
127
|
-
|---|---|---|---|---|
|
|
128
|
-
| **Rerank** (BM25 + cosine hybrid) | **Memory Tiers** (episodic/semantic) | **Working Memory** (LRU + predictive prefetch) | **Contradictions** (46 polarity pairs) | **Quantize** (int8 vectors, 4× smaller, 0.000298 mean error) |
|
|
129
|
-
| **Query Expander** (synonyms + abbrev + HyDE) | **Consolidator** (dedup + abstractions) | **Recall Cache** (bloom filter, 65k bits, ~4% FP @ 10k keys) | **Graph Walker** (5 edge types, 3-hop BFS) | **Active Learner** (accept/reject feedback bias) |
|
|
130
|
-
|
|
131
|
-
### ⚙️ Production Infrastructure
|
|
132
|
-
|
|
133
|
-
- **Real ANN vector index** (`embeddings-v2.ts`) — HNSW-style graph, M=8, sub-100ms recall over 10k vectors, sharded persistence (5MB cap), auto-pulls `nomic-embed-text` from Ollama on first run
|
|
134
|
-
- **Constitution layer** — `<project>/.shadow-brain/constitution.md` parser + hot-reload + injection
|
|
135
|
-
- **Confidence Gate** — active output filter, Brier score + ECE stats
|
|
136
|
-
- **Multimodal vision** — Ollama llava / llava-llama3 / bakllava ingestion
|
|
137
|
-
- **Markdown brain export/import** — git-trackable `.shadow-brain.md` round-trip
|
|
138
|
-
- **OpenTelemetry-lite tracing** — OTel-compatible JSONL, daily rotation
|
|
139
|
-
- **LoRA distillation pipeline** (`tools/lora-pipeline/`) — turn your brain into a Qwen2.5-Coder-1.5B adapter
|
|
140
|
-
- **SWE-Bench-Lite harness** (`tools/swe-bench-lite/`) — 10 curated bugs, brain-on vs brain-off, statistical scoring
|
|
141
|
-
- **30-second demo**: `npx @theihtisham/agent-shadow-brain demo`
|
|
142
|
-
|
|
143
|
-
### 📊 v6.0.2 by the numbers
|
|
144
|
-
|
|
145
|
-
| | |
|
|
146
|
-
|---|---|
|
|
147
|
-
| New brain modules | **35** (25 features + 10 quality stack) |
|
|
148
|
-
| New CLI command groups | **27** |
|
|
149
|
-
| New LOC | **~16,000** (TypeScript) |
|
|
150
|
-
| New npm dependencies | **0** |
|
|
151
|
-
| Sample artifacts shipped | **7** (DNA card, Replay timeline, Cinema, Holiday wrapped, Tarot, Trophy wall, 3D viewer HTML) |
|
|
152
|
-
| Quantization roundtrip error | **0.000298** (16× better than spec) |
|
|
153
|
-
| TypeScript errors | **0** |
|
|
154
|
-
|
|
155
|
-
**Full release notes:** [docs/launch/RELEASE_NOTES_v6.0.2.md](docs/launch/RELEASE_NOTES_v6.0.2.md)
|
|
156
|
-
**Strategic roadmap (v7+):** [docs/ROADMAP-v7.md](docs/ROADMAP-v7.md)
|
|
157
|
-
**Launch playbook:** [docs/VIRAL-PLAYBOOK.md](docs/VIRAL-PLAYBOOK.md)
|
|
158
|
-
|
|
159
|
-
---
|
|
160
|
-
|
|
161
|
-
## 🔥 Why Shadow Brain? (the 60-second pitch)
|
|
162
|
-
|
|
163
|
-
| Without Shadow Brain | With Shadow Brain v6 |
|
|
164
|
-
|---|---|
|
|
165
|
-
| Every new session → agent starts from zero | 2K-token briefing injected **before** the first prompt |
|
|
166
|
-
| Cursor learns X → Claude doesn't know | **One singleton brain** every agent shares |
|
|
167
|
-
| Claude Task spawns sub-agent → sub-agent starts blind | **SABB** injects focused context slivers into every sub-agent |
|
|
168
|
-
| You can't explain *why* the AI made a choice | **Causal Memory Chains** render the full DAG of causes |
|
|
169
|
-
| Two agents touching the same file = merge hell | **Collision Detective** catches it in real time |
|
|
170
|
-
| Agents work, then go idle — wasted compute | **Dream Engine** reflects during idle, runs counterfactuals |
|
|
171
|
-
| No verifiable record of agent decisions | **Ed25519-signed Reputation Ledger** — tamper-proof receipts |
|
|
172
|
-
| Token bills explode across Opus / GPT / Gemini | **Token Economy** routes to cheapest model that passes confidence |
|
|
173
|
-
| Needs its own API key for everything | **Agent-proxy mode** reuses your existing Claude/Cursor/Codex config |
|
|
174
|
-
| Every tool runs hot, every key leaks | **Air-Gap mode** + ChaCha20 encryption at rest |
|
|
175
|
-
|
|
176
|
-
---
|
|
177
|
-
|
|
178
|
-
## 🌟 22 Novel Modules — None Exist in Any Other Tool
|
|
179
|
-
|
|
180
|
-
> *This isn't a wrapper around someone else's API. All 22 are first-party research-grade implementations, persisted to disk, with real tests.*
|
|
181
|
-
|
|
182
|
-
### 🧠 Cognition
|
|
183
|
-
1. **Sub-Agent Brain Bridge (SABB)** — sync brain context into Claude Task / Cursor Composer / CrewAI / LangGraph / AutoGen sub-agents
|
|
184
|
-
2. **Causal Memory Chains** — every decision links to its causes; Graphviz DOT export
|
|
185
|
-
3. **Dream Engine** — idle-time reflection: revisit / counterfactual / consolidation / contradiction / pattern-discovery
|
|
186
|
-
4. **Swarm Debate Protocol** — pro / con / arbiter sub-agents for critical decisions
|
|
187
|
-
5. **Pre-Mortem Assistant** — surfaces past failures from *your* project before you start
|
|
188
|
-
6. **Branch Brains** — git-branch-aware memory context
|
|
189
|
-
|
|
190
|
-
### 🔍 Transparency & Trust
|
|
191
|
-
7. **Agent Reputation Ledger** — Ed25519-signed receipts, portable accuracy score
|
|
192
|
-
8. **Attention Heatmap** — weighted attribution showing which memories shaped a decision
|
|
193
|
-
9. **Confidence Calibration Monitor** — Brier scores + automatic trust-weighting
|
|
194
|
-
10. **Formal Verification Bridge** — natural-language rules → ESLint / Semgrep / LSP diagnostics
|
|
195
|
-
11. **Agent Collision Detective** — real-time overlap detection with advisory locks
|
|
196
|
-
|
|
197
|
-
### 💰 Economy & Memory
|
|
198
|
-
12. **Token Economy Engine** — cross-agent spend, savings suggestions, routing advice
|
|
199
|
-
13. **Cost-Aware Sub-Agent Spawner** — auto-route trivial tasks to cheaper models
|
|
200
|
-
14. **Forgetting Curve + Sleep Consolidation** — Ebbinghaus-inspired biological memory
|
|
201
|
-
|
|
202
|
-
### 🔒 Privacy & Safety
|
|
203
|
-
15. **Air-Gap Mode** — zero outbound network, localhost-only
|
|
204
|
-
16. **E2E Encryption** — ChaCha20-Poly1305 at rest
|
|
205
|
-
17. **Hallucination Quarantine** — isolate suspect memories, auto-expire in 7 days
|
|
206
|
-
|
|
207
|
-
### ✨ Delight & Network Effects
|
|
208
|
-
18. **Voice Mode** — natural-language intent parser for transcripts
|
|
209
|
-
19. **Brain Garden** — animated visualization of memory as a living constellation
|
|
210
|
-
20. **PR Auto-Review** — GitHub PR comments citing project memories
|
|
211
|
-
21. **Team Brain Sync (WebRTC)** — peer-to-peer shared brain, no server
|
|
212
|
-
22. **Brain Exchange** — export / import curated shareable brain slices
|
|
213
|
-
|
|
214
|
-
### ⚡ Accelerators
|
|
215
|
-
- **Local-First LLM** — Ollama default; optional Anthropic / OpenAI / OpenRouter / Moonshot / Gemini / DeepSeek / Mistral
|
|
216
|
-
- **Hive Accelerator** — SSSP ([arXiv 2504.17033](https://arxiv.org/abs/2504.17033)) + TurboQuant ([ICLR 2026](https://openreview.net/forum?id=TbqSEUXWaO)) for fast causal traversal + 6× vector compression
|
|
217
|
-
|
|
218
|
-
---
|
|
219
|
-
|
|
220
|
-
## 🖥️ Complete Web Control Dashboard
|
|
221
|
-
|
|
222
|
-
Start it:
|
|
125
|
+
shadow-brain live-brain status . --json
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Agent Briefing
|
|
129
|
+
|
|
130
|
+
Generate a markdown briefing for a fresh agent session:
|
|
131
|
+
|
|
223
132
|
```bash
|
|
224
|
-
shadow-brain
|
|
225
|
-
# → http://localhost:7341/
|
|
133
|
+
shadow-brain live-brain brief . -o SHADOW_BRAIN_AGENT_BRIEF.md
|
|
226
134
|
```
|
|
227
135
|
|
|
228
|
-
|
|
136
|
+
The briefing includes:
|
|
229
137
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
| **Chat with Brain** — RAG with citations | **Memory Browser** — semantic search | **SABB** — sliver generator + quarantine |
|
|
236
|
-
|  |  |  |
|
|
237
|
-
| **Causal Chains** — traceable decisions | **Dream Engine** — reflection insights | **Reputation** — Ed25519 leaderboard |
|
|
238
|
-
|  |  |  |
|
|
239
|
-
| **Token Economy** — $ saved live | **Models & Intelligence** — 8 providers | **⌘K Command Palette** |
|
|
138
|
+
- rules for agents
|
|
139
|
+
- top source-backed memories
|
|
140
|
+
- memory warnings
|
|
141
|
+
- recall health
|
|
142
|
+
- commands agents should run next
|
|
240
143
|
|
|
241
|
-
|
|
144
|
+
### Recall Eval
|
|
242
145
|
|
|
243
|
-
|
|
146
|
+
Check whether the brain can retrieve useful memories for common agent tasks:
|
|
244
147
|
|
|
245
|
-
|
|
148
|
+
```bash
|
|
149
|
+
shadow-brain live-brain eval .
|
|
150
|
+
```
|
|
246
151
|
|
|
247
|
-
|
|
152
|
+
Custom eval queries use pipe separators:
|
|
248
153
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
| [Cursor](https://cursor.sh/) | ✅ Native | `.cursor/rules/shadow-brain.md` + MCP |
|
|
253
|
-
| [Cline](https://github.com/cline/cline) | ✅ Native | VS Code globalStorage MCP |
|
|
254
|
-
| [Codex](https://github.com/openai/codex) | ✅ Native | `~/.codex/config.json` |
|
|
255
|
-
| [GitHub Copilot](https://github.com/features/copilot) | ✅ Native | `.github/copilot-instructions.md` |
|
|
256
|
-
| [Windsurf](https://codeium.com/windsurf) | ✅ Native | `.windsurfrules` + MCP |
|
|
257
|
-
| [Kilo Code](https://kilocode.ai/) | ✅ Native | `~/.kilocode/settings.json` |
|
|
258
|
-
| [Roo Code](https://roocode.com/) | ✅ Native | `~/.roocode/mcp.json` |
|
|
259
|
-
| [OpenCode](https://github.com/opencode-ai/opencode) | ✅ Native | `AGENT.md` |
|
|
260
|
-
| [Aider](https://aider.chat/) | ✅ Native | `.aider.conf.yml` |
|
|
154
|
+
```bash
|
|
155
|
+
shadow-brain live-brain eval . --queries "current blocker|do not repeat|verified command"
|
|
156
|
+
```
|
|
261
157
|
|
|
262
|
-
|
|
158
|
+
### Memory Hygiene
|
|
263
159
|
|
|
264
|
-
|
|
160
|
+
List concrete cleanup and learning actions:
|
|
265
161
|
|
|
266
|
-
|
|
162
|
+
```bash
|
|
163
|
+
shadow-brain live-brain hygiene .
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
This highlights missing sources, stale memories, duplicates, weak recall, and missing project-scoped memories.
|
|
267
167
|
|
|
268
|
-
|
|
168
|
+
### Training/Eval Export
|
|
269
169
|
|
|
270
|
-
|
|
170
|
+
Export source-backed memories as JSONL:
|
|
271
171
|
|
|
272
|
-
|
|
172
|
+
```bash
|
|
173
|
+
shadow-brain live-brain train-pack . --out shadow-brain-training.jsonl
|
|
174
|
+
```
|
|
273
175
|
|
|
274
|
-
|
|
176
|
+
This is useful for:
|
|
275
177
|
|
|
276
|
-
|
|
178
|
+
- retrieval evals
|
|
179
|
+
- local distillation experiments
|
|
180
|
+
- supervised fine-tuning datasets
|
|
181
|
+
- memory regression tests
|
|
277
182
|
|
|
278
|
-
|
|
183
|
+
The export is only data preparation. You choose the downstream training/eval tool.
|
|
279
184
|
|
|
280
|
-
##
|
|
185
|
+
## Core Memory Commands
|
|
281
186
|
|
|
282
|
-
|
|
283
|
-
|---|---|
|
|
284
|
-
| Brain modules | **48** |
|
|
285
|
-
| CLI commands | **90+** |
|
|
286
|
-
| MCP tools | **60+** |
|
|
287
|
-
| REST endpoints | **50+** |
|
|
288
|
-
| Tests passing | **148 / 148** |
|
|
289
|
-
| TypeScript errors | **0** |
|
|
290
|
-
| Supported agents | **10** (plus custom) |
|
|
291
|
-
| Supported LLM providers | **8** (plus agent-proxy) |
|
|
292
|
-
| Novel features nobody else has | **22** |
|
|
293
|
-
| License | **MIT** |
|
|
294
|
-
| Cost to run | **$0 forever** (local-first) |
|
|
187
|
+
Recall from the global brain:
|
|
295
188
|
|
|
296
|
-
|
|
189
|
+
```bash
|
|
190
|
+
shadow-brain global recall --query "current blocker next step" --json --limit 8
|
|
191
|
+
```
|
|
297
192
|
|
|
298
|
-
|
|
193
|
+
Show global stats:
|
|
299
194
|
|
|
300
195
|
```bash
|
|
301
|
-
|
|
302
|
-
|
|
196
|
+
shadow-brain global stats
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Create a source-backed resume seed:
|
|
303
200
|
|
|
304
|
-
|
|
305
|
-
shadow-brain
|
|
306
|
-
|
|
201
|
+
```bash
|
|
202
|
+
shadow-brain resume-seed . -o SHADOW_BRAIN_RESUME_SEED.md
|
|
203
|
+
```
|
|
307
204
|
|
|
308
|
-
|
|
309
|
-
shadow-brain reputation sign --agent claude-code --ver 4.7 --project demo \
|
|
310
|
-
--decision "use bcrypt cost 12 for all password hashing" \
|
|
311
|
-
--category security --confidence 0.92
|
|
205
|
+
Show what a project has learned:
|
|
312
206
|
|
|
313
|
-
|
|
207
|
+
```bash
|
|
208
|
+
shadow-brain timeline . --limit 30
|
|
314
209
|
```
|
|
315
210
|
|
|
316
|
-
|
|
211
|
+
Create a cross-agent handoff packet:
|
|
317
212
|
|
|
318
|
-
|
|
213
|
+
```bash
|
|
214
|
+
shadow-brain handoff codex claude-code . --task "continue release verification"
|
|
215
|
+
```
|
|
319
216
|
|
|
320
|
-
|
|
217
|
+
Record a durable memory from a script:
|
|
321
218
|
|
|
322
|
-
|
|
219
|
+
```bash
|
|
220
|
+
node tools/record-global-memory.mjs ^
|
|
221
|
+
--project-dir "." ^
|
|
222
|
+
--project-name "my-project" ^
|
|
223
|
+
--agent codex ^
|
|
224
|
+
--category "project.lesson" ^
|
|
225
|
+
--importance 0.8 ^
|
|
226
|
+
--tags "memory,release" ^
|
|
227
|
+
--sources "README.md,CHANGELOG.md" ^
|
|
228
|
+
--content "Keep release notes source-backed and verify npm metadata before publish."
|
|
229
|
+
```
|
|
323
230
|
|
|
324
|
-
|
|
231
|
+
## Dashboard
|
|
325
232
|
|
|
326
|
-
|
|
233
|
+
Start the local dashboard:
|
|
327
234
|
|
|
328
|
-
|
|
235
|
+
```bash
|
|
236
|
+
shadow-brain dash . --no-open --port 7341
|
|
237
|
+
```
|
|
329
238
|
|
|
330
|
-
|
|
239
|
+
For a fast UI/API-only launch on a large repo:
|
|
331
240
|
|
|
332
241
|
```bash
|
|
333
|
-
|
|
334
|
-
shadow-brain attach-all # wire every detected agent
|
|
335
|
-
shadow-brain detach-all # remove every hook
|
|
336
|
-
shadow-brain audit-hooks # list what's installed
|
|
337
|
-
shadow-brain dash . # launch web dashboard at :7341
|
|
338
|
-
shadow-brain mcp # start MCP server at :7342
|
|
339
|
-
|
|
340
|
-
# v6 Hive Mind
|
|
341
|
-
shadow-brain hive status # cross-module status
|
|
342
|
-
shadow-brain subagent sliver --parent claude-code --task "refactor auth"
|
|
343
|
-
shadow-brain causal trace <id> # render ancestor DAG
|
|
344
|
-
shadow-brain dream run # trigger idle reflection now
|
|
345
|
-
shadow-brain debate "Redis or Postgres?" --context "10k users"
|
|
346
|
-
shadow-brain premortem "migrate auth to passkeys"
|
|
347
|
-
shadow-brain reputation sign --agent claude-code --ver 4.7 --project X \
|
|
348
|
-
--decision "..." --category security --confidence 0.92
|
|
349
|
-
shadow-brain reputation badge claude-code --ver 4.7
|
|
350
|
-
|
|
351
|
-
# Memory + analytics
|
|
352
|
-
shadow-brain global recall --keywords "auth"
|
|
353
|
-
shadow-brain tokens report # cross-agent spend + savings
|
|
354
|
-
shadow-brain forget consolidate # run sleep cycle
|
|
355
|
-
shadow-brain formal generate "always use parameterized SQL"
|
|
356
|
-
shadow-brain formal export-eslint
|
|
357
|
-
|
|
358
|
-
# Privacy + trust
|
|
359
|
-
shadow-brain airgap enable --policy strict
|
|
360
|
-
shadow-brain encrypt file ~/.shadow-brain/global.json --passphrase ...
|
|
361
|
-
shadow-brain quarantine list
|
|
362
|
-
|
|
363
|
-
# Sharing
|
|
364
|
-
shadow-brain exchange export --name "react-expert-v1" --tags react,auth
|
|
365
|
-
shadow-brain exchange import ~/brain-packs/react-expert-v1.json
|
|
366
|
-
|
|
367
|
-
# Full list
|
|
368
|
-
shadow-brain --help
|
|
242
|
+
shadow-brain dash . --no-open --no-analysis --host 127.0.0.1 --port 7341
|
|
369
243
|
```
|
|
370
244
|
|
|
371
|
-
|
|
245
|
+
Open:
|
|
246
|
+
|
|
247
|
+
```text
|
|
248
|
+
http://127.0.0.1:7341
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
The v6 dashboard includes a **Live Brain** tab for memory health, source coverage, recall evals, hygiene actions, top memories, and the generated agent briefing.
|
|
252
|
+
|
|
253
|
+
It also includes:
|
|
254
|
+
|
|
255
|
+
- **Memory Browser intelligence cards** for total memories, source coverage, fresh learning, seed queue, top categories, agent coverage, and top tags.
|
|
256
|
+
- **Memory Seeder** for controlled research-to-memory workflows. Drafts stay out of the global brain until approval is complete.
|
|
257
|
+
- **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.
|
|
258
|
+
|
|
259
|
+
### Realtime Activity (new in 6.1.0)
|
|
260
|
+
|
|
261
|
+
The dashboard now streams brain activity live over its WebSocket instead of polling. Memory writes, dreams, seed drafts/commits, collisions, sub-agent spawns, and consolidation cycles appear the instant they happen.
|
|
372
262
|
|
|
373
|
-
|
|
263
|
+
- **Live Pulse** card on the Overview with a streaming mini-feed and an events/min rate.
|
|
264
|
+
- **Activity Log** tab with filter chips, a pulsing LIVE badge, pause/resume, clear, search, and an events/min sparkline.
|
|
265
|
+
- **Connection indicator** in the header — green when the realtime socket is live, amber while reconnecting.
|
|
266
|
+
- **Cross-process aware**: a memory written by an agent in a *different* terminal is picked up by watching `~/.shadow-brain/global.json`, so the feed reflects the whole machine, not just this process.
|
|
374
267
|
|
|
375
|
-
|
|
268
|
+
Polling remains as a 15-second reconciliation fallback; live events arrive in well under a second.
|
|
376
269
|
|
|
377
|
-
|
|
270
|
+
### Intelligence Hub — Memory Constellation (new in 6.2.0)
|
|
378
271
|
|
|
379
|
-
|
|
272
|
+
A new **Intelligence** tab turns the brain into an interactive graph. Every memory, project, agent, and tag is a node in a force-directed **Memory Constellation**, sized by importance (PageRank blended with each memory's own score) and linked by project, author, tags, and shared-tag relatedness.
|
|
380
273
|
|
|
381
|
-
|
|
274
|
+
- **Interactive**: scroll to zoom, drag to pan, click a node to focus its neighborhood and open a detail drawer; hover for a tooltip.
|
|
275
|
+
- **Filters + search** by node type (memory / project / agent / tag).
|
|
276
|
+
- **Live**: new memories pulse into the graph over the realtime stream.
|
|
277
|
+
- **Analytics strip**: source-coverage gauge, agent-contribution and category charts, tag cloud, and a recent-memory feed.
|
|
278
|
+
- Works instantly on your existing `~/.shadow-brain/global.json` — no project analysis or setup step.
|
|
382
279
|
|
|
383
|
-
|
|
280
|
+
Several previously sparse tabs were also rebuilt with real visualizations: **Pre-Mortem** (risk matrix + failure cards), **Attention** (weighted heat bars), **Calibration** (Brier/trust chart), **Reputation** (trust rings), **Causal Chains** (node-link DAG), and **Branch Brains** (stat cards).
|
|
281
|
+
|
|
282
|
+
Constellation API:
|
|
283
|
+
|
|
284
|
+
```text
|
|
285
|
+
GET /api/v6/memory-graph
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
Memory seeding API:
|
|
290
|
+
|
|
291
|
+
```text
|
|
292
|
+
GET /api/v6/seed-drafts
|
|
293
|
+
POST /api/v6/seed-draft
|
|
294
|
+
POST /api/v6/seed-approve
|
|
295
|
+
POST /api/v6/seed-reject
|
|
296
|
+
POST /api/v6/seed-commit
|
|
297
|
+
GET /api/v6/memory-intelligence
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
Useful API endpoints:
|
|
301
|
+
|
|
302
|
+
```text
|
|
303
|
+
GET/POST /api/v6/live-brain
|
|
304
|
+
GET/POST /api/v6/resume-pack
|
|
305
|
+
GET/POST /api/v6/ww2br-recall
|
|
306
|
+
GET/POST /api/v6/memory-browser
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
Example:
|
|
384
310
|
|
|
385
311
|
```bash
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
312
|
+
curl "http://127.0.0.1:7341/api/v6/live-brain?projectDir=C:/path/to/project"
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
## MCP Tools
|
|
316
|
+
|
|
317
|
+
The MCP server exposes memory and agent-control tools for compatible clients.
|
|
318
|
+
|
|
319
|
+
New in 6.0.3:
|
|
320
|
+
|
|
321
|
+
- `live_brain_status`
|
|
322
|
+
- `live_brain_brief`
|
|
323
|
+
- `live_brain_train_pack`
|
|
324
|
+
|
|
325
|
+
Existing useful tools include:
|
|
326
|
+
|
|
327
|
+
- `global_recall`
|
|
328
|
+
- `global_stats`
|
|
329
|
+
- `global_timeline`
|
|
330
|
+
- `subconscious_inject`
|
|
331
|
+
- `agent_handoff`
|
|
332
|
+
- `firewall_check`
|
|
392
333
|
|
|
393
|
-
|
|
394
|
-
node tools/record-motion-explainer.mjs
|
|
334
|
+
Start MCP from the dashboard API or existing CLI/server integration, depending on your setup.
|
|
395
335
|
|
|
396
|
-
|
|
397
|
-
node tools/capture-screenshots.mjs
|
|
336
|
+
## How Agents Should Use It
|
|
398
337
|
|
|
399
|
-
|
|
400
|
-
|
|
338
|
+
Recommended workflow for complex work:
|
|
339
|
+
|
|
340
|
+
1. Run `shadow-brain live-brain status <project>`.
|
|
341
|
+
2. Generate or read a live briefing.
|
|
342
|
+
3. Verify current project docs and source files.
|
|
343
|
+
4. Work normally.
|
|
344
|
+
5. Record only durable, source-backed lessons after proof.
|
|
345
|
+
6. Run recall evals when memory quality starts to drift.
|
|
346
|
+
|
|
347
|
+
Good memories are short, action-oriented, and source-backed:
|
|
348
|
+
|
|
349
|
+
```text
|
|
350
|
+
[lesson:release-readme-v1] Before publishing, verify package.json version, package-lock root version, README install commands, build output, and npm pack contents.
|
|
351
|
+
Sources: package.json; package-lock.json; README.md
|
|
352
|
+
Tags: release,npm,verification
|
|
401
353
|
```
|
|
402
354
|
|
|
403
|
-
|
|
355
|
+
Bad memories are vague:
|
|
404
356
|
|
|
405
|
-
|
|
357
|
+
```text
|
|
358
|
+
Make project better.
|
|
359
|
+
```
|
|
406
360
|
|
|
407
|
-
##
|
|
361
|
+
## Local Data
|
|
408
362
|
|
|
409
|
-
|
|
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
|
|
363
|
+
Default global brain:
|
|
415
364
|
|
|
416
|
-
|
|
365
|
+
```text
|
|
366
|
+
~/.shadow-brain/global.json
|
|
367
|
+
```
|
|
417
368
|
|
|
418
|
-
|
|
369
|
+
Project-local generated files may include:
|
|
419
370
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
371
|
+
```text
|
|
372
|
+
SHADOW_BRAIN_AGENT_BRIEF.md
|
|
373
|
+
SHADOW_BRAIN_RESUME_SEED.md
|
|
374
|
+
shadow-brain-training.jsonl
|
|
375
|
+
```
|
|
423
376
|
|
|
424
|
-
|
|
377
|
+
Do not store secrets, API keys, passwords, private keys, or raw credentials in memory content, metadata, tags, prompts, reports, or exported training data.
|
|
425
378
|
|
|
426
|
-
|
|
379
|
+
## Development
|
|
427
380
|
|
|
428
|
-
|
|
381
|
+
```bash
|
|
382
|
+
npm install
|
|
383
|
+
npm run build
|
|
384
|
+
npm test
|
|
385
|
+
```
|
|
429
386
|
|
|
430
|
-
|
|
387
|
+
Focused tests:
|
|
431
388
|
|
|
432
|
-
|
|
389
|
+
```bash
|
|
390
|
+
npx vitest run tests/brain/live-brain.test.ts tests/brain/context-continuity.test.ts
|
|
391
|
+
```
|
|
433
392
|
|
|
434
|
-
|
|
393
|
+
On Windows PowerShell, if execution policy blocks `npm.ps1`, use:
|
|
435
394
|
|
|
436
|
-
|
|
395
|
+
```powershell
|
|
396
|
+
npm.cmd run build
|
|
397
|
+
npx.cmd vitest run tests\brain\live-brain.test.ts
|
|
398
|
+
```
|
|
437
399
|
|
|
438
|
-
|
|
400
|
+
## Release Checklist
|
|
439
401
|
|
|
440
|
-
|
|
402
|
+
For a 6.0.3 release:
|
|
441
403
|
|
|
442
|
-
|
|
404
|
+
```bash
|
|
405
|
+
npm run build
|
|
406
|
+
npm test
|
|
407
|
+
npm pack --dry-run
|
|
408
|
+
```
|
|
443
409
|
|
|
444
|
-
|
|
410
|
+
Then publish only after verifying the package contents:
|
|
445
411
|
|
|
446
|
-
|
|
447
|
-
|
|
412
|
+
```bash
|
|
413
|
+
npm publish --access public
|
|
414
|
+
```
|
|
448
415
|
|
|
449
|
-
|
|
416
|
+
GitHub release should include:
|
|
450
417
|
|
|
451
|
-
|
|
418
|
+
- this README
|
|
419
|
+
- `CHANGELOG.md`
|
|
420
|
+
- `docs/launch/RELEASE_NOTES_v6.0.3.md`
|
|
421
|
+
- `docs/launch/RELEASE_CHECKLIST_v6.0.3.md`
|
|
422
|
+
- build/test output
|
|
423
|
+
- npm package dry-run output
|
|
452
424
|
|
|
453
|
-
|
|
425
|
+
## License
|
|
454
426
|
|
|
455
|
-
|
|
427
|
+
MIT
|