@theihtisham/agent-shadow-brain 5.1.1 → 6.0.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/README.md +355 -1095
- package/dist/adapters/copilot.d.ts +14 -0
- package/dist/adapters/copilot.d.ts.map +1 -0
- package/dist/adapters/copilot.js +93 -0
- package/dist/adapters/copilot.js.map +1 -0
- package/dist/adapters/cursor.d.ts +13 -0
- package/dist/adapters/cursor.d.ts.map +1 -0
- package/dist/adapters/cursor.js +96 -0
- package/dist/adapters/cursor.js.map +1 -0
- package/dist/adapters/index.d.ts +4 -1
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +7 -3
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/windsurf.d.ts +14 -0
- package/dist/adapters/windsurf.d.ts.map +1 -0
- package/dist/adapters/windsurf.js +107 -0
- package/dist/adapters/windsurf.js.map +1 -0
- package/dist/brain/agent-firewall.d.ts +7 -0
- package/dist/brain/agent-firewall.d.ts.map +1 -0
- package/dist/brain/agent-firewall.js +152 -0
- package/dist/brain/agent-firewall.js.map +1 -0
- package/dist/brain/agent-handoff.d.ts +19 -0
- package/dist/brain/agent-handoff.d.ts.map +1 -0
- package/dist/brain/agent-handoff.js +127 -0
- package/dist/brain/agent-handoff.js.map +1 -0
- package/dist/brain/air-gap.d.ts +23 -0
- package/dist/brain/air-gap.d.ts.map +1 -0
- package/dist/brain/air-gap.js +137 -0
- package/dist/brain/air-gap.js.map +1 -0
- package/dist/brain/attention-heatmap.d.ts +24 -0
- package/dist/brain/attention-heatmap.d.ts.map +1 -0
- package/dist/brain/attention-heatmap.js +108 -0
- package/dist/brain/attention-heatmap.js.map +1 -0
- package/dist/brain/auto-setup.js +19 -14
- package/dist/brain/auto-setup.js.map +1 -1
- package/dist/brain/auto-update.js +1 -1
- package/dist/brain/brain-chat.d.ts +42 -0
- package/dist/brain/brain-chat.d.ts.map +1 -0
- package/dist/brain/brain-chat.js +162 -0
- package/dist/brain/brain-chat.js.map +1 -0
- package/dist/brain/brain-encryption.d.ts +14 -0
- package/dist/brain/brain-encryption.d.ts.map +1 -0
- package/dist/brain/brain-encryption.js +68 -0
- package/dist/brain/brain-encryption.js.map +1 -0
- package/dist/brain/brain-exchange.d.ts +30 -0
- package/dist/brain/brain-exchange.d.ts.map +1 -0
- package/dist/brain/brain-exchange.js +106 -0
- package/dist/brain/brain-exchange.js.map +1 -0
- package/dist/brain/brain-garden.d.ts +18 -0
- package/dist/brain/brain-garden.d.ts.map +1 -0
- package/dist/brain/brain-garden.js +81 -0
- package/dist/brain/brain-garden.js.map +1 -0
- package/dist/brain/brain-portability.js +1 -1
- package/dist/brain/branch-brain.d.ts +23 -0
- package/dist/brain/branch-brain.d.ts.map +1 -0
- package/dist/brain/branch-brain.js +159 -0
- package/dist/brain/branch-brain.js.map +1 -0
- package/dist/brain/calibration-monitor.d.ts +20 -0
- package/dist/brain/calibration-monitor.d.ts.map +1 -0
- package/dist/brain/calibration-monitor.js +144 -0
- package/dist/brain/calibration-monitor.js.map +1 -0
- package/dist/brain/causal-chains.d.ts +37 -0
- package/dist/brain/causal-chains.d.ts.map +1 -0
- package/dist/brain/causal-chains.js +250 -0
- package/dist/brain/causal-chains.js.map +1 -0
- package/dist/brain/collision-detective.d.ts +32 -0
- package/dist/brain/collision-detective.d.ts.map +1 -0
- package/dist/brain/collision-detective.js +233 -0
- package/dist/brain/collision-detective.js.map +1 -0
- package/dist/brain/cost-aware-spawner.d.ts +7 -0
- package/dist/brain/cost-aware-spawner.d.ts.map +1 -0
- package/dist/brain/cost-aware-spawner.js +77 -0
- package/dist/brain/cost-aware-spawner.js.map +1 -0
- package/dist/brain/dream-engine.d.ts +35 -0
- package/dist/brain/dream-engine.d.ts.map +1 -0
- package/dist/brain/dream-engine.js +273 -0
- package/dist/brain/dream-engine.js.map +1 -0
- package/dist/brain/embeddings.d.ts +27 -0
- package/dist/brain/embeddings.d.ts.map +1 -0
- package/dist/brain/embeddings.js +175 -0
- package/dist/brain/embeddings.js.map +1 -0
- package/dist/brain/forgetting-curve.d.ts +21 -0
- package/dist/brain/forgetting-curve.d.ts.map +1 -0
- package/dist/brain/forgetting-curve.js +174 -0
- package/dist/brain/forgetting-curve.js.map +1 -0
- package/dist/brain/formal-verification-bridge.d.ts +26 -0
- package/dist/brain/formal-verification-bridge.d.ts.map +1 -0
- package/dist/brain/formal-verification-bridge.js +219 -0
- package/dist/brain/formal-verification-bridge.js.map +1 -0
- package/dist/brain/global-brain.d.ts +63 -0
- package/dist/brain/global-brain.d.ts.map +1 -0
- package/dist/brain/global-brain.js +348 -0
- package/dist/brain/global-brain.js.map +1 -0
- package/dist/brain/hallucination-quarantine.d.ts +26 -0
- package/dist/brain/hallucination-quarantine.d.ts.map +1 -0
- package/dist/brain/hallucination-quarantine.js +135 -0
- package/dist/brain/hallucination-quarantine.js.map +1 -0
- package/dist/brain/hive-accelerator.d.ts +39 -0
- package/dist/brain/hive-accelerator.d.ts.map +1 -0
- package/dist/brain/hive-accelerator.js +152 -0
- package/dist/brain/hive-accelerator.js.map +1 -0
- package/dist/brain/json-output.d.ts +26 -0
- package/dist/brain/json-output.d.ts.map +1 -0
- package/dist/brain/json-output.js +112 -0
- package/dist/brain/json-output.js.map +1 -0
- package/dist/brain/l0-cache.d.ts +40 -0
- package/dist/brain/l0-cache.d.ts.map +1 -0
- package/dist/brain/l0-cache.js +176 -0
- package/dist/brain/l0-cache.js.map +1 -0
- package/dist/brain/local-llm.d.ts +20 -0
- package/dist/brain/local-llm.d.ts.map +1 -0
- package/dist/brain/local-llm.js +132 -0
- package/dist/brain/local-llm.js.map +1 -0
- package/dist/brain/mcp-server.d.ts +44 -0
- package/dist/brain/mcp-server.d.ts.map +1 -1
- package/dist/brain/mcp-server.js +486 -12
- package/dist/brain/mcp-server.js.map +1 -1
- package/dist/brain/model-registry.d.ts +96 -0
- package/dist/brain/model-registry.d.ts.map +1 -0
- package/dist/brain/model-registry.js +585 -0
- package/dist/brain/model-registry.js.map +1 -0
- package/dist/brain/orchestrator.js +1 -1
- package/dist/brain/pr-auto-review.d.ts +17 -0
- package/dist/brain/pr-auto-review.d.ts.map +1 -0
- package/dist/brain/pr-auto-review.js +73 -0
- package/dist/brain/pr-auto-review.js.map +1 -0
- package/dist/brain/pre-mortem.d.ts +21 -0
- package/dist/brain/pre-mortem.d.ts.map +1 -0
- package/dist/brain/pre-mortem.js +210 -0
- package/dist/brain/pre-mortem.js.map +1 -0
- package/dist/brain/prompt-cache.d.ts +54 -0
- package/dist/brain/prompt-cache.d.ts.map +1 -0
- package/dist/brain/prompt-cache.js +105 -0
- package/dist/brain/prompt-cache.js.map +1 -0
- package/dist/brain/reputation-ledger.d.ts +42 -0
- package/dist/brain/reputation-ledger.d.ts.map +1 -0
- package/dist/brain/reputation-ledger.js +326 -0
- package/dist/brain/reputation-ledger.js.map +1 -0
- package/dist/brain/session-hooks.d.ts +47 -0
- package/dist/brain/session-hooks.d.ts.map +1 -0
- package/dist/brain/session-hooks.js +706 -0
- package/dist/brain/session-hooks.js.map +1 -0
- package/dist/brain/subagent-bridge.d.ts +46 -0
- package/dist/brain/subagent-bridge.d.ts.map +1 -0
- package/dist/brain/subagent-bridge.js +364 -0
- package/dist/brain/subagent-bridge.js.map +1 -0
- package/dist/brain/subconscious.d.ts +34 -0
- package/dist/brain/subconscious.d.ts.map +1 -0
- package/dist/brain/subconscious.js +275 -0
- package/dist/brain/subconscious.js.map +1 -0
- package/dist/brain/swarm-debate.d.ts +22 -0
- package/dist/brain/swarm-debate.d.ts.map +1 -0
- package/dist/brain/swarm-debate.js +134 -0
- package/dist/brain/swarm-debate.js.map +1 -0
- package/dist/brain/team-brain-sync.d.ts +22 -0
- package/dist/brain/team-brain-sync.d.ts.map +1 -0
- package/dist/brain/team-brain-sync.js +132 -0
- package/dist/brain/team-brain-sync.js.map +1 -0
- package/dist/brain/token-economy.d.ts +25 -0
- package/dist/brain/token-economy.d.ts.map +1 -0
- package/dist/brain/token-economy.js +216 -0
- package/dist/brain/token-economy.js.map +1 -0
- package/dist/brain/voice-mode.d.ts +15 -0
- package/dist/brain/voice-mode.d.ts.map +1 -0
- package/dist/brain/voice-mode.js +97 -0
- package/dist/brain/voice-mode.js.map +1 -0
- package/dist/cli.js +990 -6
- package/dist/cli.js.map +1 -1
- package/dist/dashboard/server.d.ts +6 -0
- package/dist/dashboard/server.d.ts.map +1 -1
- package/dist/dashboard/server.js +1118 -368
- package/dist/dashboard/server.js.map +1 -1
- package/dist/dashboard/v6-dashboard-html.d.ts +2 -0
- package/dist/dashboard/v6-dashboard-html.d.ts.map +1 -0
- package/dist/dashboard/v6-dashboard-html.js +2474 -0
- package/dist/dashboard/v6-dashboard-html.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +644 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +77 -12
package/README.md
CHANGED
|
@@ -1,1095 +1,355 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[
|
|
8
|
-
|
|
9
|
-
[](https://github.com/theihtisham/agent-shadow-brain/stargazers)
|
|
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
|
-
shadow-brain
|
|
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
|
-
shadow-brain
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
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
|
-
shadow-brain review . --show-fixes # + fix suggestions
|
|
357
|
-
shadow-brain review . --output json # JSON for scripting
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
---
|
|
361
|
-
|
|
362
|
-
## Web Dashboard
|
|
363
|
-
|
|
364
|
-
The v5.1.1 dashboard provides a real-time view into your brain:
|
|
365
|
-
|
|
366
|
-
```
|
|
367
|
-
┌──────────────────────────────────────────────────────────────────────────┐
|
|
368
|
-
│ Shadow Brain v5.1.1 [Analyze] [↻] │
|
|
369
|
-
├──────────────────────────────────────────────────────────────────────────┤
|
|
370
|
-
│ Insights: 142 │ Fixes: 38 │ Memory: 247KB │ Modules: 22/22 │ ... │
|
|
371
|
-
├──────────────┬─────────────────────────────────────┬───────────────────┤
|
|
372
|
-
│ Health: 87% │ Live Insights Stream │ AI Tools │
|
|
373
|
-
│ ████████░░ │ ● [HIGH] SQL injection in login.ts │ ● Claude Code ✓ │
|
|
374
|
-
│ Security: A │ ● [MED] Missing error handling │ ● Cursor ✓ │
|
|
375
|
-
│ Quality: B+ │ ● [LOW] Unused import in utils │ ● Kilo Code ✓ │
|
|
376
|
-
│ Perf: A- │ ● [CRIT] Exposed API key │ ● Cline — │
|
|
377
|
-
│ Arch: B │ │ ● OpenCode — │
|
|
378
|
-
│ Maintain: A ├─────────────────────────────────────┤ ● Codex — │
|
|
379
|
-
│ Tests: C+ │ Smart Fixes │ ● Aider — │
|
|
380
|
-
│ │ 1. Add parameterized query... │ ● Windsurf — │
|
|
381
|
-
├──────────────┤ 2. Wrap in try/catch with... ├───────────────────┤
|
|
382
|
-
│ Memory Tiers │ 3. Remove unused import on L42 │ Brain Modules │
|
|
383
|
-
│ Raw: 8421 │ │ ● Hierarchical ✓ │
|
|
384
|
-
│ Summ: 1203 │ │ ● TurboMemory ✓ │
|
|
385
|
-
│ Patt: 187 │ │ ● Consensus ✓ │
|
|
386
|
-
│ Princ: 24 │ │ ● Swarm ✓ │
|
|
387
|
-
│ Turbo: 6.2x │ │ ● Evolution ✓ │
|
|
388
|
-
│ │ │ ● Adversarial ✓ │
|
|
389
|
-
└──────────────┴─────────────────────────────────────┴───────────────────┘
|
|
390
|
-
```
|
|
391
|
-
|
|
392
|
-
---
|
|
393
|
-
|
|
394
|
-
## v5.0.0 Infinite Intelligence Engine
|
|
395
|
-
|
|
396
|
-
### 4 Breakthrough Modules
|
|
397
|
-
|
|
398
|
-
<table>
|
|
399
|
-
<tr>
|
|
400
|
-
<td width="50%">
|
|
401
|
-
|
|
402
|
-
### Infinite Memory Layer
|
|
403
|
-
|
|
404
|
-
**Hierarchical Memory Compression** — 4-tier pyramid that never forgets.
|
|
405
|
-
|
|
406
|
-
Knowledge flows through compression tiers as it ages:
|
|
407
|
-
- **Raw** (50K entries) — full detail, hot path
|
|
408
|
-
- **Summary** (10K) — condensed key points
|
|
409
|
-
- **Pattern** (2K) — recurring patterns extracted
|
|
410
|
-
- **Principle** (500) — timeless design rules
|
|
411
|
-
|
|
412
|
-
Drill-down and drill-up between tiers. Older knowledge compresses, never deletes.
|
|
413
|
-
|
|
414
|
-
```bash
|
|
415
|
-
shadow-brain memory stats # 4 tiers | 12,847 entries
|
|
416
|
-
shadow-brain memory store "..." # Store new knowledge
|
|
417
|
-
shadow-brain memory search "auth" # Cross-tier semantic search
|
|
418
|
-
```
|
|
419
|
-
|
|
420
|
-
**Context-Triggered Associative Recall** — memories that activate themselves.
|
|
421
|
-
|
|
422
|
-
Instead of requiring explicit search queries, this engine monitors your current work context and automatically surfaces relevant past knowledge:
|
|
423
|
-
- File path pattern matching (editing `auth/*.ts` → security memories)
|
|
424
|
-
- Keyword detection (typing "database" → SQL pattern memories)
|
|
425
|
-
- Category association (bug-fix context → past fix patterns)
|
|
426
|
-
- Co-occurrence networks (memories activated together strengthen their link)
|
|
427
|
-
- Learned trigger patterns that improve with use
|
|
428
|
-
|
|
429
|
-
```bash
|
|
430
|
-
shadow-brain recall . --file src/auth/login.ts --keywords "jwt,session"
|
|
431
|
-
# → Activates 8 memories | Top: "JWT rotation pattern (92%)"
|
|
432
|
-
```
|
|
433
|
-
|
|
434
|
-
</td>
|
|
435
|
-
<td width="50%">
|
|
436
|
-
|
|
437
|
-
### Multi-Agent Intelligence Layer
|
|
438
|
-
|
|
439
|
-
**Consensus Engine** — voting, trust scoring, conflict resolution.
|
|
440
|
-
|
|
441
|
-
When multiple AI agents observe the same codebase, they may produce conflicting insights. This engine:
|
|
442
|
-
1. Collects proposals from agents
|
|
443
|
-
2. Opens voting windows (agree/disagree/abstain with confidence)
|
|
444
|
-
3. Computes trust-weighted agreement scores
|
|
445
|
-
4. Resolves conflicts via confidence intervals
|
|
446
|
-
5. Tracks long-term agent trust based on proposal accuracy
|
|
447
|
-
|
|
448
|
-
```bash
|
|
449
|
-
shadow-brain consensus status
|
|
450
|
-
shadow-brain consensus propose "Use bcrypt for all password hashing" security 0.95
|
|
451
|
-
shadow-brain consensus vote <id> agree 0.9 "Industry standard"
|
|
452
|
-
shadow-brain consensus results
|
|
453
|
-
```
|
|
454
|
-
|
|
455
|
-
**Collective Learning** — discoveries flow across all projects.
|
|
456
|
-
|
|
457
|
-
When you discover a pattern in Project A, it becomes a verified rule available in Project B:
|
|
458
|
-
- Rule proposal with evidence and verification
|
|
459
|
-
- Viral propagation across connected brain instances
|
|
460
|
-
- Accuracy tracking per rule (tested vs. false positive)
|
|
461
|
-
- Category-based organization (security, performance, architecture...)
|
|
462
|
-
- Trust scores for rule sources
|
|
463
|
-
|
|
464
|
-
```bash
|
|
465
|
-
shadow-brain collective status
|
|
466
|
-
shadow-brain collective propose "Always validate file upload MIME types" security
|
|
467
|
-
shadow-brain collective search performance
|
|
468
|
-
```
|
|
469
|
-
|
|
470
|
-
</td>
|
|
471
|
-
</tr>
|
|
472
|
-
</table>
|
|
473
|
-
|
|
474
|
-
---
|
|
475
|
-
|
|
476
|
-
## v4.0.0 Hyper-Intelligence Engine
|
|
477
|
-
|
|
478
|
-
### 8 Breakthrough Modules (included in v5.1.1)
|
|
479
|
-
|
|
480
|
-
<table>
|
|
481
|
-
<tr>
|
|
482
|
-
<td width="50%">
|
|
483
|
-
|
|
484
|
-
### Quantum Memory Layer
|
|
485
|
-
|
|
486
|
-
**TurboQuant Infinite Memory** — never forget anything, ever.
|
|
487
|
-
|
|
488
|
-
Based on Google Research's **TurboQuant** (ICLR 2026):
|
|
489
|
-
- **PolarQuant**: 2 bits per dimension (polar coordinate quantization)
|
|
490
|
-
- **QJL Residual**: 1 bit per dimension (random rotation + sign)
|
|
491
|
-
- **Total**: 3 bits/dim = **6x compression** with <1% accuracy loss
|
|
492
|
-
- **Result**: Infinite retention — old knowledge is compressed, never deleted
|
|
493
|
-
|
|
494
|
-
```bash
|
|
495
|
-
shadow-brain turbo stats
|
|
496
|
-
shadow-brain turbo search "authentication patterns"
|
|
497
|
-
```
|
|
498
|
-
|
|
499
|
-
**SSSP Quantum Router** — deterministic shortest-path message routing.
|
|
500
|
-
|
|
501
|
-
Based on **"Breaking the Sorting Barrier"** (arXiv 2504.17033, Duan et al.):
|
|
502
|
-
- **BMSSP Algorithm**: O(m log<sup>2/3</sup> n) — breaks the sorting barrier
|
|
503
|
-
- **Deterministic**: No randomization, provably correct
|
|
504
|
-
|
|
505
|
-
```bash
|
|
506
|
-
shadow-brain route status
|
|
507
|
-
shadow-brain route find node-A node-B
|
|
508
|
-
```
|
|
509
|
-
|
|
510
|
-
</td>
|
|
511
|
-
<td width="50%">
|
|
512
|
-
|
|
513
|
-
### Self-Evolution Layer
|
|
514
|
-
|
|
515
|
-
**Genetic Algorithm Self-Evolution** — rules that write themselves.
|
|
516
|
-
|
|
517
|
-
- **Population**: 50 genetic rule chromosomes
|
|
518
|
-
- **Selection**: Tournament (k=5) — survival of the fittest
|
|
519
|
-
- **Crossover**: Single-point recombination
|
|
520
|
-
- **Mutation**: Gaussian noise (Box-Muller transform, sigma=0.1)
|
|
521
|
-
- **Fitness**: accuracy x coverage x (1 / falsePositiveRate)
|
|
522
|
-
|
|
523
|
-
```bash
|
|
524
|
-
shadow-brain evolve status
|
|
525
|
-
shadow-brain evolve run
|
|
526
|
-
shadow-brain evolve best-rules security
|
|
527
|
-
```
|
|
528
|
-
|
|
529
|
-
**Cross-Agent Intelligence Protocol (CAIP)** — agents that talk to each other.
|
|
530
|
-
|
|
531
|
-
Your Claude Code session learns what your Cursor session discovered:
|
|
532
|
-
- Zero-config broadcast protocol
|
|
533
|
-
- Agent identification + insight tagging
|
|
534
|
-
- Multi-agent consensus building
|
|
535
|
-
|
|
536
|
-
```bash
|
|
537
|
-
shadow-brain caip status
|
|
538
|
-
shadow-brain caip broadcast "Security pattern detected"
|
|
539
|
-
```
|
|
540
|
-
|
|
541
|
-
</td>
|
|
542
|
-
</tr>
|
|
543
|
-
<tr>
|
|
544
|
-
<td width="50%">
|
|
545
|
-
|
|
546
|
-
### Defense & Trust Layer
|
|
547
|
-
|
|
548
|
-
**Adversarial Hallucination Defense** — trust nothing, verify everything.
|
|
549
|
-
|
|
550
|
-
- Cross-reference every critical insight against actual code
|
|
551
|
-
- Evidence scoring with confidence thresholds
|
|
552
|
-
- Verdict: `real` | `hallucinated` | `uncertain`
|
|
553
|
-
|
|
554
|
-
```bash
|
|
555
|
-
shadow-brain defense status
|
|
556
|
-
shadow-brain defense scan "This API endpoint exists at /api/v2/users"
|
|
557
|
-
```
|
|
558
|
-
|
|
559
|
-
**Swarm Intelligence** — Ant Colony Optimization for file prioritization.
|
|
560
|
-
|
|
561
|
-
- Pheromone deposit: +3 for critical, +2 for high, +1 for medium
|
|
562
|
-
- Evaporation: decay over time to avoid staleness
|
|
563
|
-
|
|
564
|
-
```bash
|
|
565
|
-
shadow-brain swarm status
|
|
566
|
-
shadow-brain swarm priorities
|
|
567
|
-
```
|
|
568
|
-
|
|
569
|
-
</td>
|
|
570
|
-
<td width="50%">
|
|
571
|
-
|
|
572
|
-
### Analytics & Prediction Layer
|
|
573
|
-
|
|
574
|
-
**Knowledge Graph + PageRank** — code impact radar.
|
|
575
|
-
|
|
576
|
-
- Identify high-impact files (change one, break many)
|
|
577
|
-
- Cycle detection in dependency graphs
|
|
578
|
-
- Entity extraction with file/line tracking
|
|
579
|
-
|
|
580
|
-
```bash
|
|
581
|
-
shadow-brain graph build .
|
|
582
|
-
shadow-brain graph pagerank
|
|
583
|
-
shadow-brain graph cycles
|
|
584
|
-
```
|
|
585
|
-
|
|
586
|
-
**Predictive Engine** — predict bugs before they happen.
|
|
587
|
-
|
|
588
|
-
- Bug risk scoring: `low` | `medium` | `high` | `critical`
|
|
589
|
-
- Technical debt forecasting
|
|
590
|
-
- Anomaly detection in change patterns
|
|
591
|
-
|
|
592
|
-
```bash
|
|
593
|
-
shadow-brain predict bugs .
|
|
594
|
-
```
|
|
595
|
-
|
|
596
|
-
</td>
|
|
597
|
-
</tr>
|
|
598
|
-
</table>
|
|
599
|
-
|
|
600
|
-
---
|
|
601
|
-
|
|
602
|
-
## Algorithms & Research
|
|
603
|
-
|
|
604
|
-
Shadow Brain v5.1.1 implements algorithms from **peer-reviewed research**:
|
|
605
|
-
|
|
606
|
-
| Algorithm | Paper / Origin | Application | Complexity |
|
|
607
|
-
|---|---|---|---|
|
|
608
|
-
| **Hierarchical Compression** | Novel 4-tier system | Infinite memory with drill-down | O(n) per tier |
|
|
609
|
-
| **Associative Recall** | Spreading activation model | Context-triggered memory activation | O(n x k) |
|
|
610
|
-
| **Consensus Protocol** | Byzantine fault tolerance | Multi-agent agreement with trust | O(v x log v) |
|
|
611
|
-
| **TurboQuant** | Google Research, ICLR 2026 | Vector compression (PolarQuant + QJL) | O(n) per vector |
|
|
612
|
-
| **BMSSP (SSSP)** | arXiv 2504.17033, Duan et al. | Neural mesh message routing | O(m log<sup>2/3</sup> n) |
|
|
613
|
-
| **Shannon Entropy** | Claude Shannon, 1948 | Cross-project insight relevance scoring | O(n) |
|
|
614
|
-
| **Bayesian Inference** | Thomas Bayes, 1763 | Confidence updating, meta-learning | O(1) per update |
|
|
615
|
-
| **Cosine Similarity** | Vector space model | Knowledge deduplication | O(d) per pair |
|
|
616
|
-
| **PageRank** | Brin & Page, 1998 | Code entity impact analysis | O(V + E) per iteration |
|
|
617
|
-
| **Tarjan's SCC** | Robert Tarjan, 1972 | Dependency cycle detection | O(V + E) |
|
|
618
|
-
| **Winnowing** | Schleimer et al., 2003 | Code duplicate fingerprinting | O(n) |
|
|
619
|
-
| **Box-Muller** | Box & Muller, 1958 | Gaussian mutation in genetic algorithm | O(1) per sample |
|
|
620
|
-
| **Ant Colony (ACO)** | Dorigo, 1992 | File priority pheromone system | O(n x m) |
|
|
621
|
-
| **Tournament Selection** | Goldberg, 1989 | Genetic rule selection (k=5) | O(k) per selection |
|
|
622
|
-
|
|
623
|
-
### TurboQuant Pipeline Detail
|
|
624
|
-
|
|
625
|
-
```
|
|
626
|
-
Input Vector (64-dim, float64)
|
|
627
|
-
|
|
|
628
|
-
v
|
|
629
|
-
+-------------+
|
|
630
|
-
| PolarQuant |-- Cartesian -> Polar coordinates
|
|
631
|
-
| 2 bits/dim |-- Quantize angles to 4 levels (2 bits each)
|
|
632
|
-
+------+-------+ Pack into Uint8Array
|
|
633
|
-
|
|
|
634
|
-
v
|
|
635
|
-
+-------------+
|
|
636
|
-
| QJL Residual|-- Random rotation (Hadamard-like)
|
|
637
|
-
| 1 bit/dim |-- Sign extraction (1 bit per dim)
|
|
638
|
-
+------+-------+ Pack into Uint8Array
|
|
639
|
-
|
|
|
640
|
-
v
|
|
641
|
-
TurboVector { polar: Uint8Array, qjl: Uint8Array, dim: number, radius: number }
|
|
642
|
-
= 3 bits/dim total = 6x compression from float64
|
|
643
|
-
= ZERO FORGETTING -- compressed knowledge stays searchable forever
|
|
644
|
-
```
|
|
645
|
-
|
|
646
|
-
---
|
|
647
|
-
|
|
648
|
-
## Features
|
|
649
|
-
|
|
650
|
-
<table>
|
|
651
|
-
<tr>
|
|
652
|
-
<td width="20%">
|
|
653
|
-
|
|
654
|
-
### Hyper-Cognitive (v5.1.1)
|
|
655
|
-
- Built-in LSP Server
|
|
656
|
-
- Custom LLM Fine-Tuning
|
|
657
|
-
- Smart Cache (3-tier)
|
|
658
|
-
- Intent Engine (NLP)
|
|
659
|
-
- Code DNA Fingerprinting
|
|
660
|
-
- Temporal Intelligence
|
|
661
|
-
|
|
662
|
-
</td>
|
|
663
|
-
<td width="20%">
|
|
664
|
-
|
|
665
|
-
### Zero Config (v5.0.1)
|
|
666
|
-
- Auto-detect project + tools
|
|
667
|
-
- MCP for ALL AI tools
|
|
668
|
-
- Rich web dashboard
|
|
669
|
-
- Natural language queries
|
|
670
|
-
- Plugin system
|
|
671
|
-
- Brain export/import
|
|
672
|
-
- Git hook auto-install
|
|
673
|
-
|
|
674
|
-
</td>
|
|
675
|
-
<td width="20%">
|
|
676
|
-
|
|
677
|
-
### Infinite Intelligence (v5)
|
|
678
|
-
- 4-tier hierarchical memory
|
|
679
|
-
- Context-triggered recall
|
|
680
|
-
- Multi-agent consensus
|
|
681
|
-
- Collective cross-project learning
|
|
682
|
-
|
|
683
|
-
</td>
|
|
684
|
-
<td width="20%">
|
|
685
|
-
|
|
686
|
-
### Hyper-Intelligence (v4)
|
|
687
|
-
- TurboQuant infinite memory
|
|
688
|
-
- SSSP quantum routing
|
|
689
|
-
- Self-evolving genetic rules
|
|
690
|
-
- Cross-agent protocol (CAIP)
|
|
691
|
-
- Adversarial defense
|
|
692
|
-
- Swarm intelligence (ACO)
|
|
693
|
-
- Knowledge Graph + PageRank
|
|
694
|
-
- Predictive bug forecasting
|
|
695
|
-
|
|
696
|
-
</td>
|
|
697
|
-
<td width="20%">
|
|
698
|
-
|
|
699
|
-
### Developer Experience
|
|
700
|
-
- **60+ CLI commands**
|
|
701
|
-
- MCP Server (19 tools)
|
|
702
|
-
- Built-in LSP Server
|
|
703
|
-
- Web dashboard (real-time)
|
|
704
|
-
- Terminal UI (Ink/React)
|
|
705
|
-
- Pre-commit hooks
|
|
706
|
-
- GitHub Actions CI
|
|
707
|
-
- Plugin architecture
|
|
708
|
-
|
|
709
|
-
</td>
|
|
710
|
-
</tr>
|
|
711
|
-
</table>
|
|
712
|
-
|
|
713
|
-
---
|
|
714
|
-
|
|
715
|
-
## Architecture
|
|
716
|
-
|
|
717
|
-
### v5.1.1 Module Map (22 modules)
|
|
718
|
-
|
|
719
|
-
| Module | File | What It Does | Since |
|
|
720
|
-
|---|---|---|---|
|
|
721
|
-
| **LSP Server** | `brain/lsp-server.ts` | Built-in Language Server Protocol (stdio+TCP) | v5.1.1 |
|
|
722
|
-
| **Fine-Tuning Engine** | `brain/fine-tuning-engine.ts` | Custom LLM training data generation | v5.1.1 |
|
|
723
|
-
| **Smart Cache** | `brain/smart-cache.ts` | Multi-tier caching with predictive prefetch | v5.1.1 |
|
|
724
|
-
| **Intent Engine** | `brain/intent-engine.ts` | Natural language command understanding | v5.1.1 |
|
|
725
|
-
| **Code DNA** | `brain/code-dna.ts` | 9-gene code fingerprinting + similarity | v5.1.1 |
|
|
726
|
-
| **Temporal Intelligence** | `brain/temporal-intelligence.ts` | Velocity tracking, heatmaps, bug prediction | v5.1.1 |
|
|
727
|
-
| **Auto Setup** | `brain/auto-setup.ts` | Zero-config project + tool detection | v5.0.1 |
|
|
728
|
-
| **MCP Server** | `brain/mcp-server.ts` | 19-tool MCP server for all AI tools | v5.0.1 |
|
|
729
|
-
| **Plugin System** | `brain/plugin-system.ts` | Hookable analysis pipeline | v5.0.1 |
|
|
730
|
-
| **Brain Portability** | `brain/brain-portability.ts` | Export/import brain state | v5.0.1 |
|
|
731
|
-
| **Dashboard** | `dashboard/server.ts` | Real-time WebSocket dashboard | v5.0.1 |
|
|
732
|
-
| **Hierarchical Memory** | `brain/hierarchical-memory.ts` | 4-tier infinite memory | v5.0.0 |
|
|
733
|
-
| **Context Recall** | `brain/context-recall.ts` | Associative memory activation | v5.0.0 |
|
|
734
|
-
| **Consensus Engine** | `brain/consensus-engine.ts` | Multi-agent voting + trust | v5.0.0 |
|
|
735
|
-
| **Collective Learning** | `brain/collective-learning.ts` | Cross-project rule sharing | v5.0.0 |
|
|
736
|
-
| **TurboMemory** | `brain/turbo-memory.ts` | 6x compressed infinite memory | v4.0.0 |
|
|
737
|
-
| **SSSP Router** | `brain/sssp-router.ts` | Sub-sorting routing | v4.0.0 |
|
|
738
|
-
| **Self-Evolution** | `brain/self-evolution.ts` | Genetic rule optimization | v4.0.0 |
|
|
739
|
-
| **Cross-Agent** | `brain/cross-agent-protocol.ts` | Multi-agent broadcast | v4.0.0 |
|
|
740
|
-
| **Adversarial** | `brain/adversarial-defense.ts` | Hallucination detection | v4.0.0 |
|
|
741
|
-
| **Swarm** | `brain/swarm-intelligence.ts` | File priority pheromones | v4.0.0 |
|
|
742
|
-
| **Knowledge Graph** | `brain/knowledge-graph.ts` | PageRank impact analysis | v4.0.0 |
|
|
743
|
-
| **Predictive** | `brain/predictive-engine.ts` | Bug risk & debt forecasting | v4.0.0 |
|
|
744
|
-
|
|
745
|
-
---
|
|
746
|
-
|
|
747
|
-
## CLI Reference
|
|
748
|
-
|
|
749
|
-
### Core Commands
|
|
750
|
-
|
|
751
|
-
| Command | Description |
|
|
752
|
-
|---|---|
|
|
753
|
-
| `shadow-brain start [dir]` | Start real-time watching + dashboard + MCP |
|
|
754
|
-
| `shadow-brain off` | Clean shutdown |
|
|
755
|
-
| `shadow-brain review [dir]` | One-shot code analysis |
|
|
756
|
-
| `shadow-brain health [dir]` | Health score (A-F grading) |
|
|
757
|
-
| `shadow-brain fix [dir]` | Smart fix suggestions |
|
|
758
|
-
| `shadow-brain report [dir]` | HTML/MD/JSON reports |
|
|
759
|
-
| `shadow-brain metrics [dir]` | Code metrics |
|
|
760
|
-
| `shadow-brain scan [dir]` | Vulnerability scanner |
|
|
761
|
-
| `shadow-brain pr [dir]` | Generate PR description |
|
|
762
|
-
| `shadow-brain commit-msg [dir]` | Generate commit message |
|
|
763
|
-
| `shadow-brain ci [dir]` | GitHub Actions workflow |
|
|
764
|
-
| `shadow-brain hook [dir]` | Pre-commit hook |
|
|
765
|
-
| `shadow-brain dash [dir]` | Web dashboard |
|
|
766
|
-
| `shadow-brain mcp` | MCP server mode |
|
|
767
|
-
| `shadow-brain inject <msg>` | Inject into agent memory |
|
|
768
|
-
| `shadow-brain status` | Current configuration |
|
|
769
|
-
| `shadow-brain setup` | Interactive setup wizard |
|
|
770
|
-
| `shadow-brain doctor` | Health check & diagnostics |
|
|
771
|
-
| `shadow-brain ask <question>` | Natural language brain query |
|
|
772
|
-
|
|
773
|
-
### v5.1.1 Hyper-Cognitive Commands (NEW)
|
|
774
|
-
|
|
775
|
-
| Command | Description |
|
|
776
|
-
|---|---|
|
|
777
|
-
| `shadow-brain lsp [--stdio\|--tcp PORT]` | Start built-in LSP server |
|
|
778
|
-
| `shadow-brain fine-tune status` | Fine-tuning training data stats |
|
|
779
|
-
| `shadow-brain fine-tune generate [dir]` | Generate training pairs from code |
|
|
780
|
-
| `shadow-brain fine-tune export [path]` | Export JSONL dataset for fine-tuning |
|
|
781
|
-
| `shadow-brain cache stats` | Smart cache hit rate, tier sizes, memory |
|
|
782
|
-
| `shadow-brain cache clear` | Clear all cache tiers |
|
|
783
|
-
| `shadow-brain intent <text>` | Parse natural language intent |
|
|
784
|
-
| `shadow-brain dna analyze [dir]` | Generate Code DNA profiles |
|
|
785
|
-
| `shadow-brain dna compare <f1> <f2>` | Compare two file fingerprints |
|
|
786
|
-
| `shadow-brain dna similar <file>` | Find structurally similar files |
|
|
787
|
-
| `shadow-brain temporal stats` | Velocity, anomalies, predictions |
|
|
788
|
-
| `shadow-brain temporal hot` | Top 10 hottest files by churn |
|
|
789
|
-
| `shadow-brain temporal predict` | Bug risk predictions |
|
|
790
|
-
| `shadow-brain temporal timeline` | Recent event timeline |
|
|
791
|
-
|
|
792
|
-
### v5.0.1 Commands
|
|
793
|
-
|
|
794
|
-
| Command | Description |
|
|
795
|
-
|---|---|
|
|
796
|
-
| `shadow-brain off` | Clean shutdown of all brain processes |
|
|
797
|
-
| `shadow-brain ask <question>` | Natural language query to the brain |
|
|
798
|
-
| `shadow-brain export [-o dir]` | Export full brain state to JSON |
|
|
799
|
-
| `shadow-brain import <file> [--merge]` | Import brain state |
|
|
800
|
-
| `shadow-brain plugin list` | List installed plugins |
|
|
801
|
-
| `shadow-brain plugin create <name>` | Create plugin from template |
|
|
802
|
-
| `shadow-brain plugin stats` | Plugin system statistics |
|
|
803
|
-
|
|
804
|
-
### v5.0.0 Infinite Intelligence Commands
|
|
805
|
-
|
|
806
|
-
| Command | Description |
|
|
807
|
-
|---|---|
|
|
808
|
-
| `shadow-brain memory stats` | 4-tier hierarchical memory stats |
|
|
809
|
-
| `shadow-brain memory store <text>` | Store knowledge at raw tier |
|
|
810
|
-
| `shadow-brain memory search <query>` | Cross-tier semantic search |
|
|
811
|
-
| `shadow-brain recall . --file <f>` | Context-triggered associative recall |
|
|
812
|
-
| `shadow-brain consensus status` | Multi-agent consensus stats |
|
|
813
|
-
| `shadow-brain consensus propose <text> <cat> <conf>` | Submit proposal for voting |
|
|
814
|
-
| `shadow-brain consensus vote <id> <vote> <conf> <reason>` | Vote on a proposal |
|
|
815
|
-
| `shadow-brain consensus results` | All resolved proposals |
|
|
816
|
-
| `shadow-brain collective status` | Cross-project rule stats |
|
|
817
|
-
| `shadow-brain collective propose <text> <cat>` | Propose a collective rule |
|
|
818
|
-
| `shadow-brain collective search <cat>` | Search collective rules by category |
|
|
819
|
-
| `shadow-brain v5 [dir]` | Run ALL v5.0.0 analyses |
|
|
820
|
-
|
|
821
|
-
### v4.0.0 Hyper-Intelligence Commands
|
|
822
|
-
|
|
823
|
-
| Command | Description |
|
|
824
|
-
|---|---|
|
|
825
|
-
| `shadow-brain turbo stats` | TurboQuant infinite memory stats |
|
|
826
|
-
| `shadow-brain turbo search <q>` | Semantic search compressed memory |
|
|
827
|
-
| `shadow-brain route status` | SSSP routing status |
|
|
828
|
-
| `shadow-brain route find <from> <to>` | Shortest path query |
|
|
829
|
-
| `shadow-brain caip status` | Cross-agent protocol status |
|
|
830
|
-
| `shadow-brain caip broadcast <msg>` | Broadcast to all agents |
|
|
831
|
-
| `shadow-brain evolve status` | Genetic algorithm generation stats |
|
|
832
|
-
| `shadow-brain evolve run` | Trigger evolution cycle |
|
|
833
|
-
| `shadow-brain evolve best-rules [cat]` | Top evolved rules by category |
|
|
834
|
-
| `shadow-brain predict bugs [dir]` | Bug risk prediction |
|
|
835
|
-
| `shadow-brain graph build [dir]` | Build knowledge graph + PageRank |
|
|
836
|
-
| `shadow-brain swarm status` | Swarm convergence + priorities |
|
|
837
|
-
| `shadow-brain swarm priorities` | File hotspot ranking |
|
|
838
|
-
| `shadow-brain defense status` | Adversarial defense statistics |
|
|
839
|
-
| `shadow-brain defense scan <text>` | Scan text for hallucination patterns |
|
|
840
|
-
| `shadow-brain v4 [dir]` | Run ALL v4.0.0 analyses |
|
|
841
|
-
|
|
842
|
-
---
|
|
843
|
-
|
|
844
|
-
## Programmatic API
|
|
845
|
-
|
|
846
|
-
```typescript
|
|
847
|
-
import {
|
|
848
|
-
Orchestrator,
|
|
849
|
-
// v5.1.1 — Hyper-Cognitive modules
|
|
850
|
-
LSPServer,
|
|
851
|
-
FineTuningEngine,
|
|
852
|
-
SmartCache,
|
|
853
|
-
IntentEngine,
|
|
854
|
-
CodeDNA,
|
|
855
|
-
TemporalIntelligence,
|
|
856
|
-
// v5.0.1 — Zero-Config modules
|
|
857
|
-
AutoSetup,
|
|
858
|
-
PluginSystem,
|
|
859
|
-
BrainPortability,
|
|
860
|
-
// v5.0.0 — Infinite Intelligence modules
|
|
861
|
-
HierarchicalMemory,
|
|
862
|
-
ContextRecall,
|
|
863
|
-
ConsensusEngine,
|
|
864
|
-
CollectiveLearning,
|
|
865
|
-
// v4.0.0 — Hyper-Intelligence modules
|
|
866
|
-
TurboMemory,
|
|
867
|
-
SSSPRouter,
|
|
868
|
-
SelfEvolution,
|
|
869
|
-
CrossAgentProtocol,
|
|
870
|
-
AdversarialDefense,
|
|
871
|
-
SwarmIntelligence,
|
|
872
|
-
KnowledgeGraph,
|
|
873
|
-
PredictiveEngine,
|
|
874
|
-
NeuralMesh,
|
|
875
|
-
} from '@theihtisham/agent-shadow-brain';
|
|
876
|
-
|
|
877
|
-
// v5.1.1 — Built-in LSP server
|
|
878
|
-
const lsp = new LSPServer('./my-project');
|
|
879
|
-
lsp.start({ mode: 'tcp', port: 2087 }); // or { mode: 'stdio' }
|
|
880
|
-
|
|
881
|
-
// v5.1.1 — Smart Cache
|
|
882
|
-
const cache = new SmartCache({ maxHotEntries: 200, enablePrefetch: true });
|
|
883
|
-
cache.set('analysis:auth', analysisResult, { ttl: 300_000, tags: ['security'] });
|
|
884
|
-
const cached = cache.get('analysis:auth');
|
|
885
|
-
|
|
886
|
-
// v5.1.1 — Temporal Intelligence
|
|
887
|
-
const temporal = new TemporalIntelligence('./my-project');
|
|
888
|
-
temporal.recordCommit(['src/auth.ts'], 'fix: JWT rotation');
|
|
889
|
-
const velocity = temporal.getVelocity(); // { daily, weekly, trend: 'accelerating' }
|
|
890
|
-
const bugRisks = temporal.predictBugs(10);
|
|
891
|
-
|
|
892
|
-
// v5.1.1 — Code DNA
|
|
893
|
-
const dna = new CodeDNA('./my-project');
|
|
894
|
-
const profile = await dna.analyze('src/auth.ts');
|
|
895
|
-
const similar = await dna.findSimilar('src/auth.ts', 5);
|
|
896
|
-
|
|
897
|
-
// v5.0.1 — Zero-config auto-setup
|
|
898
|
-
const setup = new AutoSetup('./my-project');
|
|
899
|
-
const config = await setup.detect();
|
|
900
|
-
// → { projectType: 'fullstack', languages: ['typescript','python'], frameworks: ['next.js'], aiTools: [...] }
|
|
901
|
-
await setup.installMCPForTools(['Claude Code', 'Cursor']);
|
|
902
|
-
await setup.installGitHooks();
|
|
903
|
-
|
|
904
|
-
// Create the brain
|
|
905
|
-
const brain = new Orchestrator({
|
|
906
|
-
provider: 'anthropic',
|
|
907
|
-
projectDir: './my-project',
|
|
908
|
-
agents: ['claude-code', 'cursor', 'cline'],
|
|
909
|
-
watchMode: true,
|
|
910
|
-
autoInject: true,
|
|
911
|
-
brainPersonality: 'balanced',
|
|
912
|
-
});
|
|
913
|
-
|
|
914
|
-
// v5.0.1 — Plugin system
|
|
915
|
-
const plugins = new PluginSystem('./my-project');
|
|
916
|
-
await plugins.loadAll();
|
|
917
|
-
await plugins.preAnalysis({ files: ['src/auth.ts'], projectDir: './my-project' });
|
|
918
|
-
|
|
919
|
-
// v5.0.1 — Brain portability
|
|
920
|
-
const porter = new BrainPortability('./my-project');
|
|
921
|
-
const { filePath, sizeBytes, checksum } = await porter.exportBrain();
|
|
922
|
-
|
|
923
|
-
// v5.0.0 — Infinite Intelligence
|
|
924
|
-
const hmem = new HierarchicalMemory();
|
|
925
|
-
await hmem.store('JWT rotation pattern: rotate every 24h with refresh tokens', 'security', 0.9);
|
|
926
|
-
const results = hmem.search('jwt');
|
|
927
|
-
|
|
928
|
-
const recall = new ContextRecall(hmem);
|
|
929
|
-
const activated = recall.recall({
|
|
930
|
-
currentFile: 'src/auth/login.ts',
|
|
931
|
-
currentCategory: 'security',
|
|
932
|
-
recentEdits: ['src/auth/login.ts', 'src/middleware/auth.ts'],
|
|
933
|
-
projectType: 'node',
|
|
934
|
-
keywords: ['jwt', 'authentication', 'session'],
|
|
935
|
-
});
|
|
936
|
-
|
|
937
|
-
const consensus = new ConsensusEngine('my-agent');
|
|
938
|
-
const proposalId = consensus.propose('Use bcrypt cost factor 12', 'security', 0.95);
|
|
939
|
-
|
|
940
|
-
// Start everything
|
|
941
|
-
await brain.start();
|
|
942
|
-
```
|
|
943
|
-
|
|
944
|
-
---
|
|
945
|
-
|
|
946
|
-
## Health Score System
|
|
947
|
-
|
|
948
|
-
| Dimension | Weight | Checks |
|
|
949
|
-
|---|---|---|
|
|
950
|
-
| Security | 25% | Vulnerabilities, secrets, exposed keys |
|
|
951
|
-
| Quality | 25% | Code smells, anti-patterns, complexity |
|
|
952
|
-
| Performance | 15% | N+1 queries, memory leaks, blocking ops |
|
|
953
|
-
| Architecture | 15% | Coupling, cohesion, dependencies |
|
|
954
|
-
| Maintainability | 10% | Duplication, file sizes, comments |
|
|
955
|
-
| Test Coverage | 10% | Test presence, assertion quality |
|
|
956
|
-
|
|
957
|
-
---
|
|
958
|
-
|
|
959
|
-
## Version History
|
|
960
|
-
|
|
961
|
-
### v5.1.1 — Hyper-Cognitive Intelligence Edition (Current)
|
|
962
|
-
- **Built-in LSP Server** — pure Node.js Language Server Protocol with stdio + TCP modes, diagnostics, hover, code actions
|
|
963
|
-
- **Custom LLM Fine-Tuning Engine** — automatic training data generation from code changes, JSONL export for fine-tuning
|
|
964
|
-
- **Smart Cache** — 3-tier (hot/warm/cold) LRU cache with predictive prefetch, co-access graph, tag-based invalidation
|
|
965
|
-
- **Intent Engine** — multi-strategy NLP command understanding with keyword, fuzzy, and context-aware matching
|
|
966
|
-
- **Code DNA Fingerprinting** — 9-gene structural analysis (structure, complexity, style, dependency, evolution genes)
|
|
967
|
-
- **Temporal Intelligence** — velocity metrics, file heatmaps, 5-factor bug prediction, anomaly detection, peak analysis
|
|
968
|
-
- **6 new CLI commands** — lsp, fine-tune, cache, intent, dna, temporal
|
|
969
|
-
- **22 brain modules total** — 6 new + 16 existing from v5.0.1
|
|
970
|
-
- All v5.0.1, v5.0.0, and v4.0.0 features included and enhanced
|
|
971
|
-
|
|
972
|
-
### v5.0.1 — Zero-Config Intelligence Edition
|
|
973
|
-
- **Zero-Config Auto-Setup** — auto-detect project, AI tools, languages, frameworks; auto-install MCP config + git hooks
|
|
974
|
-
- **MCP Server** — 19-tool Model Context Protocol server for Claude Code, Cursor, and all AI tools
|
|
975
|
-
- **Rich Web Dashboard** — real-time WebSocket dashboard with 8 panels (health, memory tiers, insights, fixes, AI tools, modules, stats, controls)
|
|
976
|
-
- **Natural Language Queries** — `shadow-brain ask "..."` for plain-English brain interaction
|
|
977
|
-
- **Plugin System** — hookable analysis pipeline with npm plugin discovery
|
|
978
|
-
- **Brain Export/Import** — full brain state portability for team sync and backup
|
|
979
|
-
- **5 new CLI commands** — off, ask, export, import, plugin
|
|
980
|
-
- **Cursor MCP Compatibility** — root path POST + /v1/chat endpoint support
|
|
981
|
-
- **Postinstall Auto-Setup** — runs automatically after npm install
|
|
982
|
-
- **50+ npm keywords** for discoverability
|
|
983
|
-
- All v5.0.0 and v4.0.0 features included and enhanced
|
|
984
|
-
|
|
985
|
-
### v5.0.0 — Infinite Intelligence Edition
|
|
986
|
-
- **Hierarchical Memory Compression** — 4-tier pyramid (raw -> summary -> pattern -> principle) with drill-down/up
|
|
987
|
-
- **Context-Triggered Associative Recall** — automatic memory activation based on file paths, keywords, categories
|
|
988
|
-
- **Multi-Agent Consensus Protocol** — trust-weighted voting, confidence intervals, conflict resolution
|
|
989
|
-
- **Collective Cross-Project Learning** — verified rule sharing, viral propagation, accuracy tracking
|
|
990
|
-
- **5 new CLI commands** — memory, recall, consensus, collective, v5
|
|
991
|
-
|
|
992
|
-
### v4.0.0 — Hyper-Intelligence Edition
|
|
993
|
-
- **TurboQuant Infinite Memory** — 6x compression, zero forgetting (Google Research, ICLR 2026)
|
|
994
|
-
- **SSSP BMSSP Routing** — O(m log<sup>2/3</sup>n) deterministic routing (arXiv 2504.17033)
|
|
995
|
-
- **Self-Evolving Genetic Rules** — tournament selection, Gaussian mutation, Bayesian meta-learning
|
|
996
|
-
- **Cross-Agent Intelligence Protocol** — 7 agents share insights in real-time
|
|
997
|
-
- **Adversarial Hallucination Defense** — cross-reference verification, evidence scoring
|
|
998
|
-
- **Swarm Intelligence** — Ant Colony pheromone file prioritization
|
|
999
|
-
- **Knowledge Graph + PageRank** — code impact radar with d=0.85 damping
|
|
1000
|
-
- **Predictive Engine** — bug risk scoring, debt forecasting, anomaly detection
|
|
1001
|
-
|
|
1002
|
-
### v3.0.0 — Hyper-Intelligence Edition
|
|
1003
|
-
- Cognitive load analysis, security audit engine, influence map
|
|
1004
|
-
|
|
1005
|
-
### v2.1.0 — Quantum Neural Mesh
|
|
1006
|
-
- Cross-session shared intelligence, Shannon entropy, cosine similarity, Bayesian confidence
|
|
1007
|
-
|
|
1008
|
-
### v2.0.0 — Super-Intelligence Edition
|
|
1009
|
-
- Semantic analyzer, dependency graph, code similarity, MCP Server, team mode
|
|
1010
|
-
|
|
1011
|
-
### v1.x — Foundation
|
|
1012
|
-
- 7 agent adapters, health scoring, smart fixes, vulnerability scanning, CI/CD
|
|
1013
|
-
|
|
1014
|
-
---
|
|
1015
|
-
|
|
1016
|
-
## Supported Agents & Tools
|
|
1017
|
-
|
|
1018
|
-
| Agent | Status | MCP Support | Injection Target |
|
|
1019
|
-
|---|---|---|---|
|
|
1020
|
-
| [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | Full Support | Auto-install | `CLAUDE.md`, `.claude/` |
|
|
1021
|
-
| [Cursor](https://cursor.sh/) | Full Support | Auto-install | `.cursor/mcp.json` |
|
|
1022
|
-
| [Kilo Code](https://kilocode.ai/) | Full Support | Auto-install | `.kilocode/rules.md` |
|
|
1023
|
-
| [Cline](https://github.com/cline/cline) | Full Support | Auto-install | `.clinerules` |
|
|
1024
|
-
| [OpenCode](https://github.com/opencode-ai/opencode) | Full Support | Yes | `AGENT.md` |
|
|
1025
|
-
| [Codex](https://github.com/openai/codex) | Full Support | Yes | `AGENTS.md` |
|
|
1026
|
-
| [Roo Code](https://roocode.com/) | Full Support | Yes | `.roo/rules.md` |
|
|
1027
|
-
| [Aider](https://aider.chat/) | Full Support | Yes | `.aider.conf.yml` |
|
|
1028
|
-
| [Windsurf](https://codeium.com/windsurf) | Detection | Yes | `.windsurfrules` |
|
|
1029
|
-
|
|
1030
|
-
---
|
|
1031
|
-
|
|
1032
|
-
## Development
|
|
1033
|
-
|
|
1034
|
-
```bash
|
|
1035
|
-
git clone https://github.com/theihtisham/agent-shadow-brain.git
|
|
1036
|
-
cd agent-shadow-brain
|
|
1037
|
-
npm install
|
|
1038
|
-
npm run build
|
|
1039
|
-
npm test
|
|
1040
|
-
```
|
|
1041
|
-
|
|
1042
|
-
---
|
|
1043
|
-
|
|
1044
|
-
## Roadmap
|
|
1045
|
-
|
|
1046
|
-
- [x] ~~MCP Server, multi-project, team mode~~ (v2.0)
|
|
1047
|
-
- [x] ~~Cross-session neural mesh~~ (v2.1)
|
|
1048
|
-
- [x] ~~TurboQuant infinite memory~~ (v4.0)
|
|
1049
|
-
- [x] ~~SSSP quantum routing~~ (v4.0)
|
|
1050
|
-
- [x] ~~Self-evolving rules~~ (v4.0)
|
|
1051
|
-
- [x] ~~Cross-agent protocol~~ (v4.0)
|
|
1052
|
-
- [x] ~~Adversarial hallucination defense~~ (v4.0)
|
|
1053
|
-
- [x] ~~Hierarchical memory compression~~ (v5.0)
|
|
1054
|
-
- [x] ~~Context-triggered associative recall~~ (v5.0)
|
|
1055
|
-
- [x] ~~Multi-agent consensus protocol~~ (v5.0)
|
|
1056
|
-
- [x] ~~Collective cross-project learning~~ (v5.0)
|
|
1057
|
-
- [x] ~~Zero-config auto-setup~~ (v5.0.1)
|
|
1058
|
-
- [x] ~~MCP server for Cursor + all tools~~ (v5.0.1)
|
|
1059
|
-
- [x] ~~Rich web dashboard with real-time WebSocket~~ (v5.0.1)
|
|
1060
|
-
- [x] ~~Plugin system + brain export/import~~ (v5.0.1)
|
|
1061
|
-
- [x] ~~Custom LLM fine-tuning~~ (v5.1.1)
|
|
1062
|
-
- [x] ~~Language server (LSP)~~ (v5.1.1)
|
|
1063
|
-
- [x] ~~Web dashboard v3~~ (v5.1.1)
|
|
1064
|
-
- [ ] **Visual Studio Code integration** — inline insight overlays
|
|
1065
|
-
- [ ] **Multi-model orchestration** — route insights through multiple LLMs
|
|
1066
|
-
- [ ] **Real-time collaboration** — team brain with live cursors
|
|
1067
|
-
|
|
1068
|
-
---
|
|
1069
|
-
|
|
1070
|
-
## License
|
|
1071
|
-
|
|
1072
|
-
MIT License — see [LICENSE](LICENSE) for details.
|
|
1073
|
-
|
|
1074
|
-
---
|
|
1075
|
-
|
|
1076
|
-
## Author
|
|
1077
|
-
|
|
1078
|
-
**theihtisham**
|
|
1079
|
-
|
|
1080
|
-
[](https://github.com/theihtisham)
|
|
1081
|
-
[](https://www.npmjs.com/~theihtisham)
|
|
1082
|
-
|
|
1083
|
-
---
|
|
1084
|
-
|
|
1085
|
-
<div align="center">
|
|
1086
|
-
|
|
1087
|
-
### If Shadow Brain makes your AI agents smarter, give it a star
|
|
1088
|
-
|
|
1089
|
-
[](https://star-history.com/#theihtisham/agent-shadow-brain&Date)
|
|
1090
|
-
|
|
1091
|
-
**Built with brains by [theihtisham](https://github.com/theihtisham)**
|
|
1092
|
-
|
|
1093
|
-
**Topics:** `ai` `artificial-intelligence` `llm` `claude-code` `cursor` `cline` `kilo-code` `codex` `roo-code` `aider` `opencode` `windsurf` `code-review` `static-analysis` `developer-tools` `npm-package` `typescript` `ollama` `openai` `anthropic` `code-quality` `security-scanner` `health-score` `smart-fix` `vulnerability-scanner` `pattern-learning` `agent-tools` `ai-agent` `code-metrics` `pre-commit-hook` `github-actions` `developer-productivity` `neural-mesh` `quantum-computing` `shannon-entropy` `bayesian-inference` `mcp-server` `model-context-protocol` `semantic-analysis` `dependency-graph` `turboquant` `sssp-algorithm` `genetic-algorithm` `swarm-intelligence` `pagerank` `knowledge-graph` `hallucination-detection` `cross-agent` `self-evolving` `predictive-engine` `ant-colony` `infinite-memory` `vector-compression` `iclr-2026` `arxiv` `super-intelligence` `hyper-intelligence` `autonomous-agents` `ai-engineering` `agentic-coding` `vibe-coding` `cursor-ai` `zero-config` `auto-setup` `dashboard` `plugin-system` `brain-export` `natural-language` `real-time` `websocket` `team-collaboration` `ci-cd` `open-source` `trending` `hierarchical-memory` `context-recall` `consensus-engine` `collective-learning` `infinite-intelligence` `coding-assistant` `lsp-server` `language-server-protocol` `fine-tuning` `smart-cache` `intent-engine` `code-dna` `temporal-intelligence` `hyper-cognitive`
|
|
1094
|
-
|
|
1095
|
-
</div>
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<a href="https://github.com/theihtisham/agent-shadow-brain/raw/main/docs/launch/shadow-brain-motion-explainer-narrated.mp4">
|
|
4
|
+
<img src="Banner (2).png" alt="Shadow Brain v6.0 — Hive Mind · Click to watch the 2-minute explainer" width="100%">
|
|
5
|
+
</a>
|
|
6
|
+
|
|
7
|
+
### 🎬 **[▶ Watch the 2-minute explainer](https://github.com/theihtisham/agent-shadow-brain/raw/main/docs/launch/shadow-brain-motion-explainer-narrated.mp4)** · Click the banner above
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/@theihtisham/agent-shadow-brain)
|
|
10
|
+
[](https://www.npmjs.com/package/@theihtisham/agent-shadow-brain)
|
|
11
|
+
[](https://github.com/theihtisham/agent-shadow-brain/stargazers)
|
|
12
|
+
[](https://github.com/theihtisham/agent-shadow-brain/blob/main/LICENSE)
|
|
13
|
+
[](https://www.typescriptlang.org/)
|
|
14
|
+
[](https://nodejs.org/)
|
|
15
|
+
[](#-architecture)
|
|
16
|
+
[](#-cli-reference)
|
|
17
|
+
[](#-mcp-tools)
|
|
18
|
+
[](#)
|
|
19
|
+
[](#)
|
|
20
|
+
[](#)
|
|
21
|
+
|
|
22
|
+
<br/>
|
|
23
|
+
|
|
24
|
+
# 🧠 Shadow Brain v6.0 — Hive Mind
|
|
25
|
+
|
|
26
|
+
### *The first open-source brain that every AI coding agent on your machine can share.*
|
|
27
|
+
|
|
28
|
+
**Claude Code · Cursor · Cline · Codex · Copilot · Windsurf · Kilo · Roo · OpenCode · Aider** — all running on one local brain. What one agent learns, every agent knows. What one sub-agent discovers, every sub-agent inherits.
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# 30 seconds. Every agent + sub-agent on your machine becomes smarter.
|
|
32
|
+
npx @theihtisham/agent-shadow-brain@latest attach-all
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**[🎬 Video](https://github.com/theihtisham/agent-shadow-brain/raw/main/docs/launch/shadow-brain-motion-explainer-narrated.mp4) · [📦 npm](https://www.npmjs.com/package/@theihtisham/agent-shadow-brain) · [⭐ Star on GitHub](https://github.com/theihtisham/agent-shadow-brain) · [📚 Docs](https://github.com/theihtisham/agent-shadow-brain/tree/main/docs) · [🐛 Issues](https://github.com/theihtisham/agent-shadow-brain/issues)**
|
|
36
|
+
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## ⚡ Install in 30 seconds
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Method 1 — one command, every agent wired, dashboard launches
|
|
45
|
+
npx @theihtisham/agent-shadow-brain@latest attach-all
|
|
46
|
+
|
|
47
|
+
# Method 2 — global install
|
|
48
|
+
npm install -g @theihtisham/agent-shadow-brain
|
|
49
|
+
shadow-brain attach-all
|
|
50
|
+
shadow-brain dash . # → http://localhost:7341/
|
|
51
|
+
|
|
52
|
+
# Method 3 — in a specific project only
|
|
53
|
+
cd my-project
|
|
54
|
+
npx @theihtisham/agent-shadow-brain attach-all
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Zero config. Zero API key required. 100 % local-first.**
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 🔥 Why Shadow Brain? (the 60-second pitch)
|
|
62
|
+
|
|
63
|
+
| Without Shadow Brain | With Shadow Brain v6 |
|
|
64
|
+
|---|---|
|
|
65
|
+
| Every new session → agent starts from zero | 2K-token briefing injected **before** the first prompt |
|
|
66
|
+
| Cursor learns X → Claude doesn't know | **One singleton brain** every agent shares |
|
|
67
|
+
| Claude Task spawns sub-agent → sub-agent starts blind | **SABB** injects focused context slivers into every sub-agent |
|
|
68
|
+
| You can't explain *why* the AI made a choice | **Causal Memory Chains** render the full DAG of causes |
|
|
69
|
+
| Two agents touching the same file = merge hell | **Collision Detective** catches it in real time |
|
|
70
|
+
| Agents work, then go idle — wasted compute | **Dream Engine** reflects during idle, runs counterfactuals |
|
|
71
|
+
| No verifiable record of agent decisions | **Ed25519-signed Reputation Ledger** — tamper-proof receipts |
|
|
72
|
+
| Token bills explode across Opus / GPT / Gemini | **Token Economy** routes to cheapest model that passes confidence |
|
|
73
|
+
| Needs its own API key for everything | **Agent-proxy mode** reuses your existing Claude/Cursor/Codex config |
|
|
74
|
+
| Every tool runs hot, every key leaks | **Air-Gap mode** + ChaCha20 encryption at rest |
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 🌟 22 Novel Modules — None Exist in Any Other Tool
|
|
79
|
+
|
|
80
|
+
> *This isn't a wrapper around someone else's API. All 22 are first-party research-grade implementations, persisted to disk, with real tests.*
|
|
81
|
+
|
|
82
|
+
### 🧠 Cognition
|
|
83
|
+
1. **Sub-Agent Brain Bridge (SABB)** — sync brain context into Claude Task / Cursor Composer / CrewAI / LangGraph / AutoGen sub-agents
|
|
84
|
+
2. **Causal Memory Chains** — every decision links to its causes; Graphviz DOT export
|
|
85
|
+
3. **Dream Engine** — idle-time reflection: revisit / counterfactual / consolidation / contradiction / pattern-discovery
|
|
86
|
+
4. **Swarm Debate Protocol** — pro / con / arbiter sub-agents for critical decisions
|
|
87
|
+
5. **Pre-Mortem Assistant** — surfaces past failures from *your* project before you start
|
|
88
|
+
6. **Branch Brains** — git-branch-aware memory context
|
|
89
|
+
|
|
90
|
+
### 🔍 Transparency & Trust
|
|
91
|
+
7. **Agent Reputation Ledger** — Ed25519-signed receipts, portable accuracy score
|
|
92
|
+
8. **Attention Heatmap** — weighted attribution showing which memories shaped a decision
|
|
93
|
+
9. **Confidence Calibration Monitor** — Brier scores + automatic trust-weighting
|
|
94
|
+
10. **Formal Verification Bridge** — natural-language rules → ESLint / Semgrep / LSP diagnostics
|
|
95
|
+
11. **Agent Collision Detective** — real-time overlap detection with advisory locks
|
|
96
|
+
|
|
97
|
+
### 💰 Economy & Memory
|
|
98
|
+
12. **Token Economy Engine** — cross-agent spend, savings suggestions, routing advice
|
|
99
|
+
13. **Cost-Aware Sub-Agent Spawner** — auto-route trivial tasks to cheaper models
|
|
100
|
+
14. **Forgetting Curve + Sleep Consolidation** — Ebbinghaus-inspired biological memory
|
|
101
|
+
|
|
102
|
+
### 🔒 Privacy & Safety
|
|
103
|
+
15. **Air-Gap Mode** — zero outbound network, localhost-only
|
|
104
|
+
16. **E2E Encryption** — ChaCha20-Poly1305 at rest
|
|
105
|
+
17. **Hallucination Quarantine** — isolate suspect memories, auto-expire in 7 days
|
|
106
|
+
|
|
107
|
+
### ✨ Delight & Network Effects
|
|
108
|
+
18. **Voice Mode** — natural-language intent parser for transcripts
|
|
109
|
+
19. **Brain Garden** — animated visualization of memory as a living constellation
|
|
110
|
+
20. **PR Auto-Review** — GitHub PR comments citing project memories
|
|
111
|
+
21. **Team Brain Sync (WebRTC)** — peer-to-peer shared brain, no server
|
|
112
|
+
22. **Brain Exchange** — export / import curated shareable brain slices
|
|
113
|
+
|
|
114
|
+
### ⚡ Accelerators
|
|
115
|
+
- **Local-First LLM** — Ollama default; optional Anthropic / OpenAI / OpenRouter / Moonshot / Gemini / DeepSeek / Mistral
|
|
116
|
+
- **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
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## 🖥️ Complete Web Control Dashboard
|
|
121
|
+
|
|
122
|
+
Start it:
|
|
123
|
+
```bash
|
|
124
|
+
shadow-brain dash .
|
|
125
|
+
# → http://localhost:7341/
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**28 tabs. Real-time data. Full control.** Every feature has live monitoring + interactive controls. Preview:
|
|
129
|
+
|
|
130
|
+
| | | |
|
|
131
|
+
|---|---|---|
|
|
132
|
+
|  |  |  |
|
|
133
|
+
| **Overview** — live counters, charts | **Live Graph** — animated signal flow | **Agents** — connect / disconnect per agent |
|
|
134
|
+
|  |  |  |
|
|
135
|
+
| **Chat with Brain** — RAG with citations | **Memory Browser** — semantic search | **SABB** — sliver generator + quarantine |
|
|
136
|
+
|  |  |  |
|
|
137
|
+
| **Causal Chains** — traceable decisions | **Dream Engine** — reflection insights | **Reputation** — Ed25519 leaderboard |
|
|
138
|
+
|  |  |  |
|
|
139
|
+
| **Token Economy** — $ saved live | **Models & Intelligence** — 8 providers | **⌘K Command Palette** |
|
|
140
|
+
|
|
141
|
+
**→ [Browse all 29 tab screenshots](docs/launch/screenshots/)**
|
|
142
|
+
|
|
143
|
+
Features: dark + light theme · command palette (⌘K) · keyboard shortcuts · toast notifications · Chart.js analytics · responsive (mobile / tablet / desktop) · real-time WebSocket · stop button that actually stops the process.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 🧩 Works With Every AI Coding Agent
|
|
148
|
+
|
|
149
|
+
| Agent | Adapter | Hook target |
|
|
150
|
+
|---|---|---|
|
|
151
|
+
| [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | ✅ Native | `~/.claude/settings.json` hooks.SessionStart |
|
|
152
|
+
| [Cursor](https://cursor.sh/) | ✅ Native | `.cursor/rules/shadow-brain.md` + MCP |
|
|
153
|
+
| [Cline](https://github.com/cline/cline) | ✅ Native | VS Code globalStorage MCP |
|
|
154
|
+
| [Codex](https://github.com/openai/codex) | ✅ Native | `~/.codex/config.json` |
|
|
155
|
+
| [GitHub Copilot](https://github.com/features/copilot) | ✅ Native | `.github/copilot-instructions.md` |
|
|
156
|
+
| [Windsurf](https://codeium.com/windsurf) | ✅ Native | `.windsurfrules` + MCP |
|
|
157
|
+
| [Kilo Code](https://kilocode.ai/) | ✅ Native | `~/.kilocode/settings.json` |
|
|
158
|
+
| [Roo Code](https://roocode.com/) | ✅ Native | `~/.roocode/mcp.json` |
|
|
159
|
+
| [OpenCode](https://github.com/opencode-ai/opencode) | ✅ Native | `AGENT.md` |
|
|
160
|
+
| [Aider](https://aider.chat/) | ✅ Native | `.aider.conf.yml` |
|
|
161
|
+
|
|
162
|
+
**Custom agent?** Add its config path in the dashboard "Custom Agent Paths" panel — Shadow Brain will auto-read its provider + model + API key.
|
|
163
|
+
|
|
164
|
+
**Sub-agent frameworks supported by SABB:** Claude Task, Cursor Composer, Cline Sub-step, CrewAI, LangGraph, AutoGen, generic.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## 🤖 Use Your Own LLM — or Your Agent's Already-Configured One
|
|
169
|
+
|
|
170
|
+
Shadow Brain's **ModelRegistry** supports 8 providers out of the box:
|
|
171
|
+
|
|
172
|
+
**Ollama (default, local, free)** · **Anthropic Claude** · **OpenAI** · **OpenRouter** · **Moonshot / Kimi** · **Google Gemini** · **DeepSeek** · **Mistral**
|
|
173
|
+
|
|
174
|
+
Plus a unique **Agent Proxy** mode: if you already use Claude Code / Cursor / Codex with their own API key, Shadow Brain borrows their intelligence — **zero new API keys, zero cost**.
|
|
175
|
+
|
|
176
|
+
Auto-discovery reads every agent config on your machine so you never retype a key.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## 📊 Real Numbers
|
|
181
|
+
|
|
182
|
+
| Metric | Value |
|
|
183
|
+
|---|---|
|
|
184
|
+
| Brain modules | **48** |
|
|
185
|
+
| CLI commands | **90+** |
|
|
186
|
+
| MCP tools | **60+** |
|
|
187
|
+
| REST endpoints | **50+** |
|
|
188
|
+
| Tests passing | **148 / 148** |
|
|
189
|
+
| TypeScript errors | **0** |
|
|
190
|
+
| Supported agents | **10** (plus custom) |
|
|
191
|
+
| Supported LLM providers | **8** (plus agent-proxy) |
|
|
192
|
+
| Novel features nobody else has | **22** |
|
|
193
|
+
| License | **MIT** |
|
|
194
|
+
| Cost to run | **$0 forever** (local-first) |
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## 🚀 30-Second Quickstart
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
# 1. Install
|
|
202
|
+
npx @theihtisham/agent-shadow-brain@latest attach-all
|
|
203
|
+
|
|
204
|
+
# 2. Launch the dashboard
|
|
205
|
+
shadow-brain dash .
|
|
206
|
+
# → open http://localhost:7341/
|
|
207
|
+
|
|
208
|
+
# 3. Seed the brain (optional — populates example data)
|
|
209
|
+
shadow-brain reputation sign --agent claude-code --ver 4.7 --project demo \
|
|
210
|
+
--decision "use bcrypt cost 12 for all password hashing" \
|
|
211
|
+
--category security --confidence 0.92
|
|
212
|
+
|
|
213
|
+
# 4. Every new AI agent session automatically gets context injected
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
**That's it.** Open any project in Claude Code / Cursor / any supported agent — Shadow Brain is already running under the hood.
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## 🧪 The Hive Mind Explainer (2 minutes)
|
|
221
|
+
|
|
222
|
+
[](https://github.com/theihtisham/agent-shadow-brain/raw/main/docs/launch/shadow-brain-motion-explainer-narrated.mp4)
|
|
223
|
+
|
|
224
|
+
**[▶ Click here to watch](https://github.com/theihtisham/agent-shadow-brain/raw/main/docs/launch/shadow-brain-motion-explainer-narrated.mp4)** · Full motion graphics explainer with voice-over walking through every feature, the live dashboard, and the 30-second install.
|
|
225
|
+
|
|
226
|
+
Local file: `docs/launch/shadow-brain-motion-explainer-narrated.mp4` (2:05 · 1080p · narrated).
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## 📖 CLI Reference (top commands)
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
# Attachment + lifecycle
|
|
234
|
+
shadow-brain attach-all # wire every detected agent
|
|
235
|
+
shadow-brain detach-all # remove every hook
|
|
236
|
+
shadow-brain audit-hooks # list what's installed
|
|
237
|
+
shadow-brain dash . # launch web dashboard at :7341
|
|
238
|
+
shadow-brain mcp # start MCP server at :7342
|
|
239
|
+
|
|
240
|
+
# v6 Hive Mind
|
|
241
|
+
shadow-brain hive status # cross-module status
|
|
242
|
+
shadow-brain subagent sliver --parent claude-code --task "refactor auth"
|
|
243
|
+
shadow-brain causal trace <id> # render ancestor DAG
|
|
244
|
+
shadow-brain dream run # trigger idle reflection now
|
|
245
|
+
shadow-brain debate "Redis or Postgres?" --context "10k users"
|
|
246
|
+
shadow-brain premortem "migrate auth to passkeys"
|
|
247
|
+
shadow-brain reputation sign --agent claude-code --ver 4.7 --project X \
|
|
248
|
+
--decision "..." --category security --confidence 0.92
|
|
249
|
+
shadow-brain reputation badge claude-code --ver 4.7
|
|
250
|
+
|
|
251
|
+
# Memory + analytics
|
|
252
|
+
shadow-brain global recall --keywords "auth"
|
|
253
|
+
shadow-brain tokens report # cross-agent spend + savings
|
|
254
|
+
shadow-brain forget consolidate # run sleep cycle
|
|
255
|
+
shadow-brain formal generate "always use parameterized SQL"
|
|
256
|
+
shadow-brain formal export-eslint
|
|
257
|
+
|
|
258
|
+
# Privacy + trust
|
|
259
|
+
shadow-brain airgap enable --policy strict
|
|
260
|
+
shadow-brain encrypt file ~/.shadow-brain/global.json --passphrase ...
|
|
261
|
+
shadow-brain quarantine list
|
|
262
|
+
|
|
263
|
+
# Sharing
|
|
264
|
+
shadow-brain exchange export --name "react-expert-v1" --tags react,auth
|
|
265
|
+
shadow-brain exchange import ~/brain-packs/react-expert-v1.json
|
|
266
|
+
|
|
267
|
+
# Full list
|
|
268
|
+
shadow-brain --help
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## 🎯 Tweetable Talking Points
|
|
274
|
+
|
|
275
|
+
> *"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."*
|
|
276
|
+
|
|
277
|
+
> *"Every AI decision Shadow Brain makes is Ed25519-signed. Every cause is traced. Every collision is caught before it happens. Free forever."*
|
|
278
|
+
|
|
279
|
+
> *"22 novel features nobody else has. Free. Open source. Local-first. `npx @theihtisham/agent-shadow-brain`."*
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## 🛠️ For Contributors
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
git clone https://github.com/theihtisham/agent-shadow-brain.git
|
|
287
|
+
cd agent-shadow-brain
|
|
288
|
+
npm install
|
|
289
|
+
npm run build
|
|
290
|
+
npm test # 148/148 tests
|
|
291
|
+
npm run dev # ts-node dev mode
|
|
292
|
+
|
|
293
|
+
# Rebuild the explainer video
|
|
294
|
+
node tools/record-motion-explainer.mjs
|
|
295
|
+
|
|
296
|
+
# Capture fresh dashboard screenshots
|
|
297
|
+
node tools/capture-screenshots.mjs
|
|
298
|
+
|
|
299
|
+
# Seed the brain with demo data
|
|
300
|
+
node tools/seed-brain.mjs
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
Issues, PRs, discussions welcome. See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## 📚 Documentation
|
|
308
|
+
|
|
309
|
+
- **[CHANGELOG.md](CHANGELOG.md)** — release notes
|
|
310
|
+
- **[docs/versions/v6.0.0.md](docs/versions/v6.0.0.md)** — v6 release details
|
|
311
|
+
- **[docs/launch/HIVEMIND_VIDEO.md](docs/launch/HIVEMIND_VIDEO.md)** — video production pipeline
|
|
312
|
+
- **[docs/launch/screenshots/](docs/launch/screenshots/)** — all 29 dashboard screenshots
|
|
313
|
+
- **[SECURITY.md](SECURITY.md)** — security policy
|
|
314
|
+
- **[CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)** — community guidelines
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
## 💬 Community
|
|
319
|
+
|
|
320
|
+
- **[GitHub Issues](https://github.com/theihtisham/agent-shadow-brain/issues)** — bug reports, feature requests
|
|
321
|
+
- **[GitHub Discussions](https://github.com/theihtisham/agent-shadow-brain/discussions)** — questions, ideas, show-and-tell
|
|
322
|
+
- **[GitHub Releases](https://github.com/theihtisham/agent-shadow-brain/releases)** — download the explainer MP4 + release assets
|
|
323
|
+
|
|
324
|
+
**If Shadow Brain makes your AI agents smarter, star the repo ⭐**
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## ⭐ Stargazers Over Time
|
|
329
|
+
|
|
330
|
+
[](https://star-history.com/#theihtisham/agent-shadow-brain&Date)
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## 📜 License
|
|
335
|
+
|
|
336
|
+
**MIT** — see [LICENSE](LICENSE).
|
|
337
|
+
|
|
338
|
+
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.
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
<div align="center">
|
|
343
|
+
|
|
344
|
+
### Built by [@theihtisham](https://github.com/theihtisham)
|
|
345
|
+
|
|
346
|
+
<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>
|
|
347
|
+
<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>
|
|
348
|
+
|
|
349
|
+
### The Hive Mind for every AI coding agent on your machine.
|
|
350
|
+
|
|
351
|
+
**`npx @theihtisham/agent-shadow-brain@latest attach-all`**
|
|
352
|
+
|
|
353
|
+
<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>
|
|
354
|
+
|
|
355
|
+
</div>
|