@theihtisham/agent-shadow-brain 3.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +443 -602
- package/dist/brain/adversarial-defense.d.ts +57 -0
- package/dist/brain/adversarial-defense.d.ts.map +1 -0
- package/dist/brain/adversarial-defense.js +303 -0
- package/dist/brain/adversarial-defense.js.map +1 -0
- package/dist/brain/cognitive-load.d.ts +27 -0
- package/dist/brain/cognitive-load.d.ts.map +1 -0
- package/dist/brain/cognitive-load.js +304 -0
- package/dist/brain/cognitive-load.js.map +1 -0
- package/dist/brain/cross-agent-protocol.d.ts +48 -0
- package/dist/brain/cross-agent-protocol.d.ts.map +1 -0
- package/dist/brain/cross-agent-protocol.js +306 -0
- package/dist/brain/cross-agent-protocol.js.map +1 -0
- package/dist/brain/influence-map.d.ts +31 -0
- package/dist/brain/influence-map.d.ts.map +1 -0
- package/dist/brain/influence-map.js +375 -0
- package/dist/brain/influence-map.js.map +1 -0
- package/dist/brain/knowledge-graph.d.ts +56 -0
- package/dist/brain/knowledge-graph.d.ts.map +1 -0
- package/dist/brain/knowledge-graph.js +427 -0
- package/dist/brain/knowledge-graph.js.map +1 -0
- package/dist/brain/learning-engine.d.ts +11 -0
- package/dist/brain/learning-engine.d.ts.map +1 -1
- package/dist/brain/learning-engine.js +44 -1
- package/dist/brain/learning-engine.js.map +1 -1
- package/dist/brain/neural-mesh.d.ts +9 -1
- package/dist/brain/neural-mesh.d.ts.map +1 -1
- package/dist/brain/neural-mesh.js +75 -16
- package/dist/brain/neural-mesh.js.map +1 -1
- package/dist/brain/orchestrator.d.ts +24 -2
- package/dist/brain/orchestrator.d.ts.map +1 -1
- package/dist/brain/orchestrator.js +208 -4
- package/dist/brain/orchestrator.js.map +1 -1
- package/dist/brain/pattern-memory.d.ts +8 -3
- package/dist/brain/pattern-memory.d.ts.map +1 -1
- package/dist/brain/pattern-memory.js +71 -3
- package/dist/brain/pattern-memory.js.map +1 -1
- package/dist/brain/predictive-engine.d.ts +45 -0
- package/dist/brain/predictive-engine.d.ts.map +1 -0
- package/dist/brain/predictive-engine.js +238 -0
- package/dist/brain/predictive-engine.js.map +1 -0
- package/dist/brain/security-audit.d.ts +20 -0
- package/dist/brain/security-audit.d.ts.map +1 -0
- package/dist/brain/security-audit.js +340 -0
- package/dist/brain/security-audit.js.map +1 -0
- package/dist/brain/self-evolution.d.ts +53 -0
- package/dist/brain/self-evolution.d.ts.map +1 -0
- package/dist/brain/self-evolution.js +278 -0
- package/dist/brain/self-evolution.js.map +1 -0
- package/dist/brain/sssp-router.d.ts +58 -0
- package/dist/brain/sssp-router.d.ts.map +1 -0
- package/dist/brain/sssp-router.js +295 -0
- package/dist/brain/sssp-router.js.map +1 -0
- package/dist/brain/swarm-intelligence.d.ts +48 -0
- package/dist/brain/swarm-intelligence.d.ts.map +1 -0
- package/dist/brain/swarm-intelligence.js +215 -0
- package/dist/brain/swarm-intelligence.js.map +1 -0
- package/dist/brain/turbo-memory.d.ts +56 -0
- package/dist/brain/turbo-memory.d.ts.map +1 -0
- package/dist/brain/turbo-memory.js +388 -0
- package/dist/brain/turbo-memory.js.map +1 -0
- package/dist/cli.js +339 -3
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +272 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/dashboard.d.ts.map +1 -1
- package/dist/ui/dashboard.js +20 -3
- package/dist/ui/dashboard.js.map +1 -1
- package/package.json +16 -7
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
<img src="banner.svg" alt="Agent Shadow Brain" width="100%">
|
|
3
|
+
<img src="banner.svg" alt="Agent Shadow Brain v4.0.0" width="100%">
|
|
4
4
|
|
|
5
5
|
<br/>
|
|
6
6
|
|
|
@@ -9,16 +9,18 @@
|
|
|
9
9
|
[](https://github.com/theihtisham/agent-shadow-brain/blob/master/LICENSE)
|
|
10
10
|
[](https://nodejs.org/)
|
|
11
11
|
[](https://github.com/theihtisham/agent-shadow-brain/stargazers)
|
|
12
|
+
[](https://arxiv.org/abs/2504.17033)
|
|
13
|
+
[](https://openreview.net/forum?id=TbqSEUXWaO)
|
|
12
14
|
|
|
13
15
|
<br/>
|
|
14
16
|
|
|
15
|
-
### **
|
|
17
|
+
### **The World's First Hyper-Intelligent AI Coding Brain**
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
**Shadow Brain** is a self-evolving, infinite-memory intelligence layer for AI coding agents. It watches your code, applies **mathematically proven algorithms** from cutting-edge research, learns across sessions with **zero forgetting**, and makes every AI agent write **better, safer, faster code** — forever.
|
|
18
20
|
|
|
19
|
-
> **
|
|
21
|
+
> **v4.0.0 — Hyper-Intelligence Edition**: TurboQuant infinite memory (Google Research, ICLR 2026), SSSP O(m log<sup>2/3</sup>n) routing (arXiv 2504.17033), self-evolving genetic rules, cross-agent protocol, adversarial hallucination defense, swarm intelligence, knowledge graph with PageRank.
|
|
20
22
|
|
|
21
|
-
[**
|
|
23
|
+
[**Install Now**](#-getting-started) · [**v4.0.0 Modules**](#-v40-hyper-intelligence-engine) · [**Algorithms**](#-algorithms--research) · [**CLI Reference**](#-cli-reference) · [**Architecture**](#-architecture)
|
|
22
24
|
|
|
23
25
|
</div>
|
|
24
26
|
|
|
@@ -26,141 +28,169 @@ No such brain and intelligence has existed before. Shadow Brain is a **super ult
|
|
|
26
28
|
|
|
27
29
|
## The Problem
|
|
28
30
|
|
|
29
|
-
You use AI coding agents
|
|
31
|
+
You use AI coding agents. They're powerful, but:
|
|
30
32
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
| Problem | Impact |
|
|
34
|
+
|---|---|
|
|
35
|
+
| Agents **forget everything** between sessions | Same mistakes, zero learning |
|
|
36
|
+
| Multiple agents **don't communicate** | Claude doesn't know what Cline learned |
|
|
37
|
+
| Generated code has **hallucinations** | LLMs fabricate APIs that don't exist |
|
|
38
|
+
| No **cross-session memory** | Every conversation starts from zero |
|
|
39
|
+
| Agents can't **predict bugs** | Reactive, not proactive |
|
|
40
|
+
| No **self-improvement** | Rules never get better on their own |
|
|
37
41
|
|
|
38
42
|
## The Solution
|
|
39
43
|
|
|
40
|
-
**Shadow Brain** runs alongside your agents as a *shadow
|
|
41
|
-
|
|
42
|
-
1. **Watches** every file change and git commit in real-time
|
|
43
|
-
2. **Analyzes** code using LLM-powered review + rule-based engines + mathematical algorithms
|
|
44
|
-
3. **Learns** patterns, correlations, and recurring issues across sessions
|
|
45
|
-
4. **Injects** insights directly into your agent's memory files
|
|
46
|
-
5. **Scores** your codebase health on every change
|
|
47
|
-
6. **Shares** knowledge across all connected Shadow Brain instances via Quantum Neural Mesh
|
|
44
|
+
**Shadow Brain v4.0.0** runs alongside your agents as a *hyper-intelligent shadow layer*:
|
|
48
45
|
|
|
49
46
|
```
|
|
50
|
-
|
|
51
|
-
│ AI Agents
|
|
52
|
-
│ Claude Code
|
|
53
|
-
│ Kilo Code
|
|
54
|
-
│ Cline
|
|
55
|
-
│ OpenCode
|
|
56
|
-
│ Codex
|
|
57
|
-
│ Roo Code
|
|
58
|
-
│ Aider
|
|
59
|
-
|
|
60
|
-
▲
|
|
61
|
-
│
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
knowledge │ Shannon Entropy │ knowledge
|
|
65
|
-
│ Bayesian Inference │
|
|
66
|
-
│ Cosine Similarity │
|
|
67
|
-
└──────────────────────┘
|
|
47
|
+
┌──────────────┐ watches ┌────────────────────────────────────┐ injects ┌──────────────┐
|
|
48
|
+
│ AI Agents │ ─────────────▶ │ SHADOW BRAIN v4.0.0 │ ────────────▶ │ AI Agents │
|
|
49
|
+
│ Claude Code │ file changes │ │ insights + │ Smarter │
|
|
50
|
+
│ Kilo Code │ git commits │ TurboQuant ─── Infinite Memory │ context + │ Safer │
|
|
51
|
+
│ Cline │ activity │ SSSP BMSSP ─── Quantum Routing │ fixes + │ Faster │
|
|
52
|
+
│ OpenCode │ │ Self-Evolution ─ Living Rules │ predictions │ Connected │
|
|
53
|
+
│ Codex │ │ CAIP ───────── Cross-Agent Sync │ │ Evolving │
|
|
54
|
+
│ Roo Code │ │ Swarm ──────── File Hotspots │ │ Predictive │
|
|
55
|
+
│ Aider │ │ PageRank ───── Impact Radar │ │ Trusted │
|
|
56
|
+
└──────────────┘ │ Adversarial ── Trust Verification │ └──────────────┘
|
|
57
|
+
▲ └────────────────────────────────────┘ ▲
|
|
58
|
+
│ ▲ ▲ ▲ │
|
|
59
|
+
└──────────────────────────────┘──────────┘──────────┘───────────────────────────────┘
|
|
60
|
+
shares insights across all agents via Cross-Agent Intelligence Protocol
|
|
68
61
|
```
|
|
69
62
|
|
|
70
63
|
---
|
|
71
64
|
|
|
72
|
-
##
|
|
65
|
+
## v4.0.0 Hyper-Intelligence Engine
|
|
66
|
+
|
|
67
|
+
### 8 New Breakthrough Modules
|
|
73
68
|
|
|
74
69
|
<table>
|
|
75
70
|
<tr>
|
|
76
71
|
<td width="50%">
|
|
77
72
|
|
|
78
|
-
###
|
|
79
|
-
- **File watching** — detects changes instantly (chokidar)
|
|
80
|
-
- **Git monitoring** — tracks commits, branches, diffs
|
|
81
|
-
- **LLM-powered analysis** — supports Anthropic, OpenAI, Ollama, OpenRouter
|
|
82
|
-
- **Pattern memory** — learns your codebase patterns over time
|
|
83
|
-
- **Learning engine** — extracts lessons from insights automatically
|
|
73
|
+
### Quantum Memory Layer
|
|
84
74
|
|
|
85
|
-
|
|
86
|
-
<td width="50%">
|
|
75
|
+
**TurboQuant Infinite Memory** — never forget anything, ever.
|
|
87
76
|
|
|
88
|
-
|
|
89
|
-
- **
|
|
90
|
-
- **
|
|
91
|
-
- **
|
|
92
|
-
- **
|
|
93
|
-
- **Type safety analyzer** — detects `any`, `@ts-ignore`, missing return types
|
|
77
|
+
Based on Google Research's **TurboQuant** (ICLR 2026):
|
|
78
|
+
- **PolarQuant**: 2 bits per dimension (polar coordinate quantization)
|
|
79
|
+
- **QJL Residual**: 1 bit per dimension (random rotation + sign)
|
|
80
|
+
- **Total**: 3 bits/dim = **6x compression** with <1% accuracy loss
|
|
81
|
+
- **Result**: Infinite retention — old knowledge is compressed, never deleted
|
|
94
82
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
83
|
+
```bash
|
|
84
|
+
shadow-brain turbo stats # 0 entries | 6x compressed
|
|
85
|
+
shadow-brain turbo search "authentication patterns"
|
|
86
|
+
```
|
|
99
87
|
|
|
100
|
-
|
|
101
|
-
- **Health scoring** — A-F grading across 6 dimensions
|
|
102
|
-
- **Code metrics** — LOC, complexity, language breakdown, hotspots
|
|
103
|
-
- **SVG badges** — embeddable health score badges
|
|
104
|
-
- **Trend tracking** — health history with persistence
|
|
105
|
-
- **Performance profiler** — N+1 queries, memory leaks, blocking ops
|
|
88
|
+
**SSSP Quantum Router** — deterministic shortest-path message routing.
|
|
106
89
|
|
|
107
|
-
|
|
108
|
-
<
|
|
90
|
+
Based on **"Breaking the Sorting Barrier"** (arXiv 2504.17033, Duan et al.):
|
|
91
|
+
- **BMSSP Algorithm**: O(m log<sup>2/3</sup> n) — breaks the sorting barrier
|
|
92
|
+
- **Deterministic**: No randomization, provably correct
|
|
93
|
+
- **Application**: Neural mesh messages find optimal paths between brain nodes
|
|
109
94
|
|
|
110
|
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
|
|
114
|
-
- **OpenCode** — injects into `AGENT.md`
|
|
115
|
-
- **Codex** — injects into `AGENTS.md`
|
|
116
|
-
- **Roo Code** — injects into `.roo/rules.md`
|
|
117
|
-
- **Aider** — injects into `.aider.conf.yml`
|
|
95
|
+
```bash
|
|
96
|
+
shadow-brain route status # 5 nodes | BMSSP active
|
|
97
|
+
shadow-brain route find node-A node-B # → [node-A, node-C, node-B]
|
|
98
|
+
```
|
|
118
99
|
|
|
119
100
|
</td>
|
|
120
|
-
</tr>
|
|
121
|
-
<tr>
|
|
122
101
|
<td width="50%">
|
|
123
102
|
|
|
124
|
-
###
|
|
125
|
-
- **30+ CLI commands** — full control from terminal
|
|
126
|
-
- **MCP Server** — Model Context Protocol for tool integration
|
|
127
|
-
- **Web dashboard** — real-time browser UI at `localhost:7341`
|
|
128
|
-
- **Terminal UI** — Ink/React dashboard in your terminal
|
|
129
|
-
- **Pre-commit hooks** — block bad commits automatically
|
|
130
|
-
- **GitHub Actions** — CI integration with one command
|
|
103
|
+
### Self-Evolution Layer
|
|
131
104
|
|
|
132
|
-
|
|
133
|
-
|
|
105
|
+
**Genetic Algorithm Self-Evolution** — rules that write themselves.
|
|
106
|
+
|
|
107
|
+
Inspired by evolutionary computation:
|
|
108
|
+
- **Population**: 50 genetic rule chromosomes
|
|
109
|
+
- **Selection**: Tournament (k=5) — survival of the fittest
|
|
110
|
+
- **Crossover**: Single-point recombination
|
|
111
|
+
- **Mutation**: Gaussian noise (Box-Muller transform, σ=0.1)
|
|
112
|
+
- **Fitness**: accuracy × coverage × (1 / falsePositiveRate)
|
|
113
|
+
- **Meta-Learning**: Bayesian updating per (strategy, category) pair
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
shadow-brain evolve status # Generation 47 | Best: 0.943
|
|
117
|
+
shadow-brain evolve run # Evolve one generation
|
|
118
|
+
shadow-brain evolve best-rules security # Top 5 evolved rules
|
|
119
|
+
```
|
|
134
120
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
|
|
121
|
+
**Cross-Agent Intelligence Protocol (CAIP)** — agents that talk to each other.
|
|
122
|
+
|
|
123
|
+
Your Claude Code session learns what your Cline session discovered:
|
|
124
|
+
- Zero-config broadcast protocol
|
|
125
|
+
- Agent identification + insight tagging
|
|
126
|
+
- Multi-agent consensus building
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
shadow-brain caip status # 3 agents connected
|
|
130
|
+
shadow-brain caip broadcast "Security pattern detected in auth/"
|
|
131
|
+
```
|
|
142
132
|
|
|
143
133
|
</td>
|
|
144
134
|
</tr>
|
|
145
135
|
<tr>
|
|
146
136
|
<td width="50%">
|
|
147
137
|
|
|
148
|
-
###
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
-
|
|
138
|
+
### Defense & Trust Layer
|
|
139
|
+
|
|
140
|
+
**Adversarial Hallucination Defense** — trust nothing, verify everything.
|
|
141
|
+
|
|
142
|
+
LLMs hallucinate. Shadow Brain catches it:
|
|
143
|
+
- Cross-reference every critical insight against actual code
|
|
144
|
+
- Evidence scoring with confidence thresholds
|
|
145
|
+
- Verdict: `real` | `hallucinated` | `uncertain`
|
|
146
|
+
- Tracks accuracy, false positive rate, blocked count
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
shadow-brain defense status # Accuracy: 97.3% | Blocked: 12
|
|
150
|
+
shadow-brain defense scan "This API endpoint exists at /api/v2/users"
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**Swarm Intelligence** — Ant Colony Optimization for file prioritization.
|
|
154
|
+
|
|
155
|
+
Files with more bugs get more pheromone. Analysis focuses where it matters:
|
|
156
|
+
- Pheromone deposit: +3 for critical, +2 for high, +1 for medium
|
|
157
|
+
- Evaporation: decay over time to avoid staleness
|
|
158
|
+
- Convergence score: measures how focused the swarm is
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
shadow-brain swarm status # Convergence: 0.847
|
|
162
|
+
shadow-brain swarm priorities # Top 10 hotspot files
|
|
163
|
+
```
|
|
154
164
|
|
|
155
165
|
</td>
|
|
156
166
|
<td width="50%">
|
|
157
167
|
|
|
158
|
-
###
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
-
|
|
168
|
+
### Analytics & Prediction Layer
|
|
169
|
+
|
|
170
|
+
**Knowledge Graph + PageRank** — code impact radar.
|
|
171
|
+
|
|
172
|
+
Builds a directed graph of code entities, then runs **PageRank** (d=0.85):
|
|
173
|
+
- Identify high-impact files (change one, break many)
|
|
174
|
+
- Cycle detection in dependency graphs
|
|
175
|
+
- Entity extraction with file/line tracking
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
shadow-brain graph build . # 342 entities | PageRank computed
|
|
179
|
+
shadow-brain graph pagerank # Top 10 most impactful files
|
|
180
|
+
shadow-brain graph cycles # Detect circular dependencies
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Predictive Engine** — predict bugs before they happen.
|
|
184
|
+
|
|
185
|
+
Analyzes code age, churn rate, staleness, and author patterns:
|
|
186
|
+
- Bug risk scoring: `low` | `medium` | `high` | `critical`
|
|
187
|
+
- Technical debt forecasting
|
|
188
|
+
- Anomaly detection in change patterns
|
|
189
|
+
- Factors: days since modification, lines changed, churn rate, staleness
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
shadow-brain predict bugs . # 3 high-risk files detected
|
|
193
|
+
```
|
|
164
194
|
|
|
165
195
|
</td>
|
|
166
196
|
</tr>
|
|
@@ -168,93 +198,160 @@ You use AI coding agents like Claude Code, Cline, Kilo Code, OpenCode, Codex, Ro
|
|
|
168
198
|
|
|
169
199
|
---
|
|
170
200
|
|
|
171
|
-
##
|
|
201
|
+
## Algorithms & Research
|
|
172
202
|
|
|
173
|
-
|
|
203
|
+
Shadow Brain v4.0.0 implements algorithms from **peer-reviewed research**:
|
|
174
204
|
|
|
175
|
-
|
|
205
|
+
| Algorithm | Paper / Origin | Application | Complexity |
|
|
206
|
+
|---|---|---|---|
|
|
207
|
+
| **TurboQuant** | Google Research, ICLR 2026 | Infinite memory compression (PolarQuant + QJL) | O(n) per vector |
|
|
208
|
+
| **BMSSP (SSSP)** | arXiv 2504.17033, Duan et al. | Neural mesh message routing | O(m log<sup>2/3</sup> n) |
|
|
209
|
+
| **Shannon Entropy** | Claude Shannon, 1948 | Cross-project insight relevance scoring | O(n) |
|
|
210
|
+
| **Bayesian Inference** | Thomas Bayes, 1763 | Confidence updating, meta-learning | O(1) per update |
|
|
211
|
+
| **Cosine Similarity** | Vector space model | Knowledge deduplication | O(d) per pair |
|
|
212
|
+
| **PageRank** | Brin & Page, 1998 | Code entity impact analysis | O(V + E) per iteration |
|
|
213
|
+
| **Tarjan's SCC** | Robert Tarjan, 1972 | Dependency cycle detection | O(V + E) |
|
|
214
|
+
| **Winnowing** | Schleimer et al., 2003 | Code duplicate fingerprinting | O(n) |
|
|
215
|
+
| **Box-Muller** | Box & Muller, 1958 | Gaussian mutation in genetic algorithm | O(1) per sample |
|
|
216
|
+
| **Ant Colony (ACO)** | Dorigo, 1992 | File priority pheromone system | O(n × m) |
|
|
217
|
+
| **Tournament Selection** | Goldberg, 1989 | Genetic rule selection (k=5) | O(k) per selection |
|
|
218
|
+
| **Polar Coordinates** | Classical mathematics | Vector compression via angle quantization | O(n) |
|
|
176
219
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
220
|
+
### TurboQuant Pipeline Detail
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
Input Vector (64-dim, float64)
|
|
224
|
+
│
|
|
225
|
+
▼
|
|
226
|
+
┌─────────────┐
|
|
227
|
+
│ PolarQuant │── Cartesian → Polar coordinates
|
|
228
|
+
│ 2 bits/dim │── Quantize angles to 4 levels (2 bits each)
|
|
229
|
+
└──────┬──────┘ Pack into Uint8Array
|
|
230
|
+
│
|
|
231
|
+
▼
|
|
232
|
+
┌─────────────┐
|
|
233
|
+
│ QJL Residual│── Random rotation (Hadamard-like)
|
|
234
|
+
│ 1 bit/dim │── Sign extraction (1 bit per dim)
|
|
235
|
+
└──────┬──────┘ Pack into Uint8Array
|
|
236
|
+
│
|
|
237
|
+
▼
|
|
238
|
+
TurboVector { polar: Uint8Array, qjl: Uint8Array, dim: number, radius: number }
|
|
239
|
+
= 3 bits/dim total = 6x compression from float64
|
|
240
|
+
= ZERO FORGETTING — compressed knowledge stays searchable forever
|
|
241
|
+
```
|
|
185
242
|
|
|
186
|
-
###
|
|
243
|
+
### SSSP BMSSP Algorithm
|
|
187
244
|
|
|
188
245
|
```
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
│ ┌───────────────────────────┘
|
|
198
|
-
▼ ▼
|
|
199
|
-
┌──────────────────────────────┐
|
|
200
|
-
│ Quantum Neural Mesh Bus │
|
|
201
|
-
│ ~/.shadow-brain-mesh/ │
|
|
202
|
-
│ │
|
|
203
|
-
│ • Nodes (heartbeats) │
|
|
204
|
-
│ • Messages (insights) │
|
|
205
|
-
│ • Knowledge (shared) │
|
|
206
|
-
│ │
|
|
207
|
-
│ Entropy: 0.73 │
|
|
208
|
-
│ State: coherent (3 nodes) │
|
|
209
|
-
│ Knowledge: 147 entries │
|
|
210
|
-
└──────────────────────────────┘
|
|
246
|
+
Traditional Dijkstra: O(m + n log n) ── limited by comparison sorting
|
|
247
|
+
Bellman-Ford: O(mn) ── too slow for large meshes
|
|
248
|
+
|
|
249
|
+
BMSSP (2025): O(m log^(2/3) n) ── BREAKS THE SORTING BARRIER
|
|
250
|
+
└─ Uses approximate bucketing instead of exact comparison sort
|
|
251
|
+
└─ Deterministic (no randomization)
|
|
252
|
+
└─ Provably correct shortest paths
|
|
253
|
+
└─ Applied to neural mesh message routing between brain nodes
|
|
211
254
|
```
|
|
212
255
|
|
|
213
|
-
|
|
256
|
+
---
|
|
214
257
|
|
|
215
|
-
|
|
216
|
-
|---|---|---|
|
|
217
|
-
| **Coherent** | 3+ | Full quantum coherence — maximum intelligence sharing |
|
|
218
|
-
| **Decoherent** | 1-2 | Partial sharing — limited cross-pollination |
|
|
219
|
-
| **Collapsed** | 0 | Single brain — no mesh connections |
|
|
258
|
+
## Features
|
|
220
259
|
|
|
221
|
-
|
|
260
|
+
<table>
|
|
261
|
+
<tr>
|
|
262
|
+
<td width="33%">
|
|
222
263
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
264
|
+
### Real-Time Intelligence
|
|
265
|
+
- File watching (chokidar)
|
|
266
|
+
- Git monitoring (commits, diffs)
|
|
267
|
+
- LLM-powered analysis (Anthropic, OpenAI, Ollama, OpenRouter)
|
|
268
|
+
- Pattern memory across sessions
|
|
269
|
+
- Learning engine (automatic)
|
|
226
270
|
|
|
227
|
-
|
|
228
|
-
|
|
271
|
+
</td>
|
|
272
|
+
<td width="33%">
|
|
229
273
|
|
|
230
|
-
|
|
231
|
-
|
|
274
|
+
### Security & Quality
|
|
275
|
+
- Vulnerability scanner
|
|
276
|
+
- Custom rules engine (regex)
|
|
277
|
+
- Framework presets (React, Next.js, Django, FastAPI)
|
|
278
|
+
- Smart fix engine with confidence scores
|
|
279
|
+
- Type safety analyzer
|
|
232
280
|
|
|
233
|
-
|
|
234
|
-
|
|
281
|
+
</td>
|
|
282
|
+
<td width="33%">
|
|
235
283
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
284
|
+
### Health & Metrics
|
|
285
|
+
- A-F health grading (6 dimensions)
|
|
286
|
+
- Code metrics (LOC, complexity, languages)
|
|
287
|
+
- SVG health badges
|
|
288
|
+
- Trend tracking
|
|
289
|
+
- Performance profiler
|
|
290
|
+
|
|
291
|
+
</td>
|
|
292
|
+
</tr>
|
|
293
|
+
<tr>
|
|
294
|
+
<td width="33%">
|
|
295
|
+
|
|
296
|
+
### Multi-Agent (7 Adapters)
|
|
297
|
+
- Claude Code → `CLAUDE.md`
|
|
298
|
+
- Kilo Code → `.kilocode/rules.md`
|
|
299
|
+
- Cline → `.clinerules`
|
|
300
|
+
- OpenCode → `AGENT.md`
|
|
301
|
+
- Codex → `AGENTS.md`
|
|
302
|
+
- Roo Code → `.roo/rules.md`
|
|
303
|
+
- Aider → `.aider.conf.yml`
|
|
304
|
+
|
|
305
|
+
</td>
|
|
306
|
+
<td width="33%">
|
|
307
|
+
|
|
308
|
+
### Developer Experience
|
|
309
|
+
- **40+ CLI commands** — full terminal control
|
|
310
|
+
- MCP Server — Model Context Protocol
|
|
311
|
+
- Web dashboard — `localhost:7341`
|
|
312
|
+
- Terminal UI — Ink/React dashboard
|
|
313
|
+
- Pre-commit hooks — block bad commits
|
|
314
|
+
- GitHub Actions — CI integration
|
|
315
|
+
|
|
316
|
+
</td>
|
|
317
|
+
<td width="33%">
|
|
318
|
+
|
|
319
|
+
### v4.0.0 Hyper-Intelligence
|
|
320
|
+
- TurboQuant infinite memory
|
|
321
|
+
- SSSP quantum routing
|
|
322
|
+
- Self-evolving genetic rules
|
|
323
|
+
- Cross-agent protocol (CAIP)
|
|
324
|
+
- Adversarial hallucination defense
|
|
325
|
+
- Swarm intelligence (ACO)
|
|
326
|
+
- Knowledge Graph + PageRank
|
|
327
|
+
- Predictive bug forecasting
|
|
328
|
+
|
|
329
|
+
</td>
|
|
330
|
+
</tr>
|
|
331
|
+
</table>
|
|
239
332
|
|
|
240
333
|
---
|
|
241
334
|
|
|
242
|
-
|
|
335
|
+
## Architecture
|
|
243
336
|
|
|
244
|
-
|
|
337
|
+
<img src="docs/images/v4-architecture.svg" alt="v4.0.0 Architecture" width="100%">
|
|
245
338
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
|
249
|
-
|
|
250
|
-
|
|
|
251
|
-
|
|
|
252
|
-
|
|
|
253
|
-
|
|
|
339
|
+
### v4.0.0 Module Map
|
|
340
|
+
|
|
341
|
+
| Module | File | What It Does | Research |
|
|
342
|
+
|---|---|---|---|
|
|
343
|
+
| **TurboMemory** | `brain/turbo-memory.ts` | 6x compressed infinite memory | Google ICLR 2026 |
|
|
344
|
+
| **SSSP Router** | `brain/sssp-router.ts` | Sub-sorting-complexity routing | arXiv 2504.17033 |
|
|
345
|
+
| **Self-Evolution** | `brain/self-evolution.ts` | Genetic rule optimization | Goldberg 1989 |
|
|
346
|
+
| **Cross-Agent** | `brain/cross-agent-protocol.ts` | Multi-agent broadcast | Novel protocol |
|
|
347
|
+
| **Adversarial** | `brain/adversarial-defense.ts` | Hallucination detection | Novel approach |
|
|
348
|
+
| **Swarm** | `brain/swarm-intelligence.ts` | File priority pheromones | Dorigo 1992 |
|
|
349
|
+
| **Knowledge Graph** | `brain/knowledge-graph.ts` | PageRank impact analysis | Brin & Page 1998 |
|
|
350
|
+
| **Predictive** | `brain/predictive-engine.ts` | Bug risk & debt forecasting | Statistical models |
|
|
254
351
|
|
|
255
352
|
---
|
|
256
353
|
|
|
257
|
-
##
|
|
354
|
+
## Getting Started
|
|
258
355
|
|
|
259
356
|
### Install
|
|
260
357
|
|
|
@@ -262,7 +359,7 @@ Choose how Shadow Brain communicates with your agents:
|
|
|
262
359
|
# Install globally
|
|
263
360
|
npm install -g @theihtisham/agent-shadow-brain
|
|
264
361
|
|
|
265
|
-
# Or use with npx (no install)
|
|
362
|
+
# Or use with npx (no install needed)
|
|
266
363
|
npx @theihtisham/agent-shadow-brain review .
|
|
267
364
|
```
|
|
268
365
|
|
|
@@ -272,8 +369,6 @@ npx @theihtisham/agent-shadow-brain review .
|
|
|
272
369
|
shadow-brain setup
|
|
273
370
|
```
|
|
274
371
|
|
|
275
|
-
Interactive wizard that configures your LLM provider, personality, and review depth.
|
|
276
|
-
|
|
277
372
|
### Start Watching
|
|
278
373
|
|
|
279
374
|
```bash
|
|
@@ -281,535 +376,287 @@ shadow-brain start .
|
|
|
281
376
|
```
|
|
282
377
|
|
|
283
378
|
That's it. Shadow Brain will:
|
|
284
|
-
1. Auto-detect which AI agents are running
|
|
285
|
-
2.
|
|
286
|
-
3. Analyze every change
|
|
287
|
-
4. Inject insights into your agent's memory
|
|
288
|
-
5.
|
|
379
|
+
1. Auto-detect which AI agents are running (7 supported)
|
|
380
|
+
2. Watch your project files for changes
|
|
381
|
+
3. Analyze every change with LLM + mathematical algorithms
|
|
382
|
+
4. Inject expert insights into your agent's memory
|
|
383
|
+
5. Compress knowledge with TurboQuant for infinite retention
|
|
384
|
+
6. Evolve its own rules via genetic algorithm
|
|
385
|
+
7. Share insights across agents via CAIP
|
|
386
|
+
8. Detect hallucinations with adversarial verification
|
|
387
|
+
|
|
388
|
+
### Quick Review (No Watch Mode)
|
|
289
389
|
|
|
290
|
-
|
|
390
|
+
```bash
|
|
391
|
+
shadow-brain review . # One-shot analysis
|
|
392
|
+
shadow-brain review . --show-health # + health score
|
|
393
|
+
shadow-brain review . --show-fixes # + fix suggestions
|
|
394
|
+
shadow-brain review . --output json # JSON for scripting
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
### v4.0.0 Commands
|
|
291
398
|
|
|
292
399
|
```bash
|
|
293
|
-
#
|
|
294
|
-
shadow-brain
|
|
400
|
+
# Infinite memory
|
|
401
|
+
shadow-brain turbo stats # TurboQuant compression stats
|
|
402
|
+
shadow-brain turbo search "auth" # Semantic search in compressed memory
|
|
295
403
|
|
|
296
|
-
#
|
|
297
|
-
shadow-brain
|
|
404
|
+
# Quantum routing
|
|
405
|
+
shadow-brain route status # SSSP mesh routing status
|
|
406
|
+
shadow-brain route find node-A node-B # Shortest path between brain nodes
|
|
298
407
|
|
|
299
|
-
#
|
|
300
|
-
shadow-brain
|
|
301
|
-
|
|
408
|
+
# Cross-agent protocol
|
|
409
|
+
shadow-brain caip status # Connected agents
|
|
410
|
+
shadow-brain caip broadcast "message" # Broadcast to all agents
|
|
302
411
|
|
|
303
|
-
|
|
412
|
+
# Self-evolution
|
|
413
|
+
shadow-brain evolve status # Genetic algorithm stats
|
|
414
|
+
shadow-brain evolve run # Evolve one generation
|
|
415
|
+
shadow-brain evolve best-rules security # Top evolved security rules
|
|
304
416
|
|
|
305
|
-
|
|
417
|
+
# Predictive engine
|
|
418
|
+
shadow-brain predict bugs . # Bug risk scoring
|
|
306
419
|
|
|
307
|
-
|
|
308
|
-
#
|
|
309
|
-
shadow-brain
|
|
420
|
+
# Knowledge graph
|
|
421
|
+
shadow-brain graph build . # Build + PageRank
|
|
422
|
+
shadow-brain graph pagerank # Top impact entities
|
|
310
423
|
|
|
311
|
-
#
|
|
312
|
-
shadow-brain
|
|
424
|
+
# Swarm intelligence
|
|
425
|
+
shadow-brain swarm status # Convergence + pheromone stats
|
|
426
|
+
shadow-brain swarm priorities # File hotspot ranking
|
|
313
427
|
|
|
314
|
-
#
|
|
315
|
-
shadow-brain
|
|
428
|
+
# Adversarial defense
|
|
429
|
+
shadow-brain defense status # Accuracy + blocked count
|
|
430
|
+
shadow-brain defense scan "claim text" # Verify a specific claim
|
|
431
|
+
|
|
432
|
+
# Run EVERYTHING at once
|
|
433
|
+
shadow-brain v4 . # Full v4.0.0 hyper-analysis
|
|
316
434
|
```
|
|
317
435
|
|
|
318
436
|
---
|
|
319
437
|
|
|
320
|
-
##
|
|
438
|
+
## CLI Reference
|
|
321
439
|
|
|
322
440
|
### Core Commands
|
|
323
441
|
|
|
324
442
|
| Command | Description |
|
|
325
443
|
|---|---|
|
|
326
|
-
| `shadow-brain start [dir]` | Start
|
|
444
|
+
| `shadow-brain start [dir]` | Start real-time watching |
|
|
327
445
|
| `shadow-brain review [dir]` | One-shot code analysis |
|
|
328
|
-
| `shadow-brain health [dir]` |
|
|
329
|
-
| `shadow-brain fix [dir]` |
|
|
330
|
-
| `shadow-brain report [dir]` |
|
|
331
|
-
| `shadow-brain metrics [dir]` | Code metrics
|
|
446
|
+
| `shadow-brain health [dir]` | Health score (A-F grading) |
|
|
447
|
+
| `shadow-brain fix [dir]` | Smart fix suggestions |
|
|
448
|
+
| `shadow-brain report [dir]` | HTML/MD/JSON reports |
|
|
449
|
+
| `shadow-brain metrics [dir]` | Code metrics |
|
|
332
450
|
| `shadow-brain scan [dir]` | Vulnerability scanner |
|
|
333
451
|
| `shadow-brain pr [dir]` | Generate PR description |
|
|
334
452
|
| `shadow-brain commit-msg [dir]` | Generate commit message |
|
|
335
|
-
| `shadow-brain ci [dir]` |
|
|
336
|
-
| `shadow-brain hook [dir]` |
|
|
337
|
-
| `shadow-brain
|
|
338
|
-
| `shadow-brain
|
|
339
|
-
| `shadow-brain
|
|
340
|
-
| `shadow-brain notify [dir]` | Test notification channels |
|
|
341
|
-
| `shadow-brain status` | Show current configuration |
|
|
342
|
-
| `shadow-brain config` | Manage configuration |
|
|
453
|
+
| `shadow-brain ci [dir]` | GitHub Actions workflow |
|
|
454
|
+
| `shadow-brain hook [dir]` | Pre-commit hook |
|
|
455
|
+
| `shadow-brain dash [dir]` | Web dashboard |
|
|
456
|
+
| `shadow-brain inject <msg>` | Inject into agent memory |
|
|
457
|
+
| `shadow-brain status` | Current configuration |
|
|
343
458
|
| `shadow-brain setup` | Interactive setup wizard |
|
|
344
459
|
| `shadow-brain doctor` | Health check & diagnostics |
|
|
345
460
|
|
|
461
|
+
### v4.0.0 Hyper-Intelligence Commands
|
|
462
|
+
|
|
463
|
+
| Command | Description |
|
|
464
|
+
|---|---|
|
|
465
|
+
| `shadow-brain turbo stats` | TurboQuant infinite memory stats |
|
|
466
|
+
| `shadow-brain turbo search <q>` | Semantic search compressed memory |
|
|
467
|
+
| `shadow-brain route status` | SSSP routing status |
|
|
468
|
+
| `shadow-brain route find <from> <to>` | Shortest path query |
|
|
469
|
+
| `shadow-brain caip status` | Cross-agent protocol status |
|
|
470
|
+
| `shadow-brain caip broadcast <msg>` | Broadcast to all agents |
|
|
471
|
+
| `shadow-brain evolve status` | Genetic algorithm generation stats |
|
|
472
|
+
| `shadow-brain evolve run` | Trigger evolution cycle |
|
|
473
|
+
| `shadow-brain evolve best-rules [cat]` | Top evolved rules by category |
|
|
474
|
+
| `shadow-brain predict bugs [dir]` | Bug risk prediction |
|
|
475
|
+
| `shadow-brain graph build [dir]` | Build knowledge graph + PageRank |
|
|
476
|
+
| `shadow-brain swarm status` | Swarm convergence + priorities |
|
|
477
|
+
| `shadow-brain swarm priorities` | File hotspot ranking |
|
|
478
|
+
| `shadow-brain defense status` | Adversarial defense statistics |
|
|
479
|
+
| `shadow-brain defense scan <text>` | Scan text for hallucination patterns |
|
|
480
|
+
| `shadow-brain v4 [dir]` | Run ALL v4.0.0 analyses |
|
|
481
|
+
|
|
346
482
|
### Super-Intelligence Commands (v2.0+)
|
|
347
483
|
|
|
348
484
|
| Command | Description |
|
|
349
485
|
|---|---|
|
|
350
|
-
| `shadow-brain semantic [dir]` |
|
|
351
|
-
| `shadow-brain deps [dir]` | Dependency graph
|
|
352
|
-
| `shadow-brain duplicates [dir]` |
|
|
486
|
+
| `shadow-brain semantic [dir]` | Symbol extraction, dead code |
|
|
487
|
+
| `shadow-brain deps [dir]` | Dependency graph, cycles, hubs |
|
|
488
|
+
| `shadow-brain duplicates [dir]` | Duplicate code detection |
|
|
353
489
|
| `shadow-brain adr [dir]` | Architecture Decision Records |
|
|
354
|
-
| `shadow-brain typesafety [dir]` | TypeScript type
|
|
490
|
+
| `shadow-brain typesafety [dir]` | TypeScript type analysis |
|
|
355
491
|
| `shadow-brain perf [dir]` | Performance profiling |
|
|
356
|
-
| `shadow-brain knowledge [dir]` |
|
|
357
|
-
| `shadow-brain
|
|
358
|
-
| `shadow-brain learn [dir]` | Run learning cycle — extract patterns & lessons |
|
|
359
|
-
| `shadow-brain team share [dir]` | Share insights with team |
|
|
360
|
-
| `shadow-brain team insights` | View team insights |
|
|
361
|
-
| `shadow-brain team stats` | Team activity statistics |
|
|
492
|
+
| `shadow-brain knowledge [dir]` | Project knowledge base |
|
|
493
|
+
| `shadow-brain learn [dir]` | Extract patterns & lessons |
|
|
362
494
|
|
|
363
495
|
### Neural Mesh Commands (v2.1+)
|
|
364
496
|
|
|
365
497
|
| Command | Description |
|
|
366
498
|
|---|---|
|
|
367
|
-
| `shadow-brain mesh status` |
|
|
368
|
-
| `shadow-brain mesh insights` | Cross-session insights
|
|
499
|
+
| `shadow-brain mesh status` | Mesh state + quantum state |
|
|
500
|
+
| `shadow-brain mesh insights` | Cross-session insights |
|
|
369
501
|
| `shadow-brain mesh knowledge` | Shared knowledge base |
|
|
370
|
-
| `shadow-brain mesh nodes` |
|
|
371
|
-
| `shadow-brain mesh aggregate` | Aggregated cross-project analytics |
|
|
372
|
-
|
|
373
|
-
### Global Options
|
|
374
|
-
|
|
375
|
-
```
|
|
376
|
-
-p, --provider <provider> LLM provider: anthropic | openai | ollama | openrouter
|
|
377
|
-
-m, --model <model> Model name (e.g., claude-sonnet-4-20250514, gpt-4o, llama3)
|
|
378
|
-
-k, --api-key <key> API key for the provider
|
|
379
|
-
--personality <type> Brain personality: mentor | critic | architect | security | performance | balanced
|
|
380
|
-
--depth <depth> Review depth: quick | standard | deep
|
|
381
|
-
--agents <agents> Comma-separated list of agents to watch
|
|
382
|
-
--no-inject Disable auto-injection
|
|
383
|
-
--mesh Enable Quantum Neural Mesh
|
|
384
|
-
--team <name> Enable team mode with username
|
|
385
|
-
--mcp Start MCP server alongside
|
|
386
|
-
```
|
|
502
|
+
| `shadow-brain mesh nodes` | Connected brain nodes |
|
|
387
503
|
|
|
388
504
|
---
|
|
389
505
|
|
|
390
|
-
##
|
|
506
|
+
## Programmatic API
|
|
391
507
|
|
|
392
508
|
```typescript
|
|
393
509
|
import {
|
|
394
510
|
Orchestrator,
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
Notifier,
|
|
404
|
-
SemanticAnalyzer,
|
|
405
|
-
DependencyGraphBuilder,
|
|
406
|
-
CodeSimilarityDetector,
|
|
407
|
-
ADREngine,
|
|
408
|
-
TypeSafetyAnalyzer,
|
|
409
|
-
PerformanceProfiler,
|
|
410
|
-
LearningEngine,
|
|
411
|
-
MCPServer,
|
|
412
|
-
TeamMode,
|
|
413
|
-
MultiProjectManager,
|
|
511
|
+
TurboMemory,
|
|
512
|
+
SSSPRouter,
|
|
513
|
+
SelfEvolution,
|
|
514
|
+
CrossAgentProtocol,
|
|
515
|
+
AdversarialDefense,
|
|
516
|
+
SwarmIntelligence,
|
|
517
|
+
KnowledgeGraph,
|
|
518
|
+
PredictiveEngine,
|
|
414
519
|
NeuralMesh,
|
|
415
520
|
} from '@theihtisham/agent-shadow-brain';
|
|
416
521
|
|
|
417
|
-
// Create
|
|
418
|
-
const
|
|
522
|
+
// Create the brain
|
|
523
|
+
const brain = new Orchestrator({
|
|
419
524
|
provider: 'anthropic',
|
|
420
525
|
projectDir: './my-project',
|
|
421
526
|
agents: ['claude-code', 'cline', 'roo-code'],
|
|
422
527
|
watchMode: true,
|
|
423
528
|
autoInject: true,
|
|
424
|
-
reviewDepth: 'standard',
|
|
425
529
|
brainPersonality: 'balanced',
|
|
426
|
-
};
|
|
427
|
-
|
|
428
|
-
const brain = new Orchestrator(config);
|
|
429
|
-
|
|
430
|
-
// Listen to events
|
|
431
|
-
brain.on('insights', ({ insights }) => {
|
|
432
|
-
console.log(`Generated ${insights.length} insights`);
|
|
433
530
|
});
|
|
434
531
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
});
|
|
438
|
-
|
|
439
|
-
brain.on('fixes', ({ fixes }) => {
|
|
440
|
-
console.log(`${fixes.length} fix suggestions available`);
|
|
441
|
-
});
|
|
442
|
-
|
|
443
|
-
await brain.start();
|
|
444
|
-
|
|
445
|
-
// ── Super-Intelligence API (v2.0+) ────────────────────────────────────
|
|
446
|
-
|
|
447
|
-
// Semantic analysis
|
|
448
|
-
const semantic = await brain.getSemanticInsights(100);
|
|
449
|
-
console.log(`Found ${semantic.unusedExports.length} unused exports`);
|
|
450
|
-
|
|
451
|
-
// Dependency graph
|
|
452
|
-
const deps = await brain.getDependencyGraph();
|
|
453
|
-
const details = brain.getDependencyDetails(deps);
|
|
454
|
-
console.log(`Cycles: ${details.cycles.length}, Hubs: ${details.hubs.length}`);
|
|
455
|
-
|
|
456
|
-
// Duplicate detection
|
|
457
|
-
const dupes = await brain.detectDuplicates(0.8);
|
|
458
|
-
console.log(`${dupes.length} duplicate groups found`);
|
|
459
|
-
|
|
460
|
-
// Type safety
|
|
461
|
-
const typeIssues = await brain.analyzeTypeSafety();
|
|
462
|
-
console.log(`${typeIssues.length} type safety issues`);
|
|
463
|
-
|
|
464
|
-
// Performance profiling
|
|
465
|
-
const perfInsights = await brain.profilePerformance();
|
|
466
|
-
console.log(`${perfInsights.length} performance suggestions`);
|
|
467
|
-
|
|
468
|
-
// Learning engine
|
|
469
|
-
await brain.runLearningCycle();
|
|
470
|
-
const lessons = await brain.getLearnedLessons();
|
|
471
|
-
|
|
472
|
-
// ── Team Mode ────────────────────────────────────────────────────────
|
|
473
|
-
|
|
474
|
-
brain.enableTeamMode('ihtisham');
|
|
475
|
-
await brain.shareTeamInsight(insights[0]);
|
|
476
|
-
const teamInsights = await brain.getTeamInsights(10);
|
|
477
|
-
|
|
478
|
-
// ── MCP Server ───────────────────────────────────────────────────────
|
|
479
|
-
|
|
480
|
-
await brain.startMCPServer({ port: 7342 });
|
|
481
|
-
// Now accessible via JSON-RPC 2.0 at http://localhost:7342/mcp
|
|
482
|
-
|
|
483
|
-
// ── Neural Mesh (v2.1+) ──────────────────────────────────────────────
|
|
532
|
+
// v4.0.0 — Direct module access
|
|
533
|
+
const turbo = new TurboMemory({ maxEntries: 100000 });
|
|
534
|
+
await turbo.store('auth-pattern', vector, { category: 'security' });
|
|
535
|
+
const results = await turbo.search(queryVector, 10);
|
|
484
536
|
|
|
485
|
-
const
|
|
486
|
-
|
|
537
|
+
const evolution = new SelfEvolution({ populationSize: 50 });
|
|
538
|
+
const snapshot = await evolution.evolve(insights);
|
|
539
|
+
console.log(`Generation ${snapshot.generation}, Best fitness: ${snapshot.bestFitness}`);
|
|
487
540
|
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
541
|
+
const kg = new KnowledgeGraph('./my-project');
|
|
542
|
+
await kg.build();
|
|
543
|
+
const topEntities = kg.getTopEntities(10);
|
|
491
544
|
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
545
|
+
const swarm = new SwarmIntelligence();
|
|
546
|
+
swarm.initialize(fileList);
|
|
547
|
+
swarm.depositPheromone(['src/auth.ts'], 3.0);
|
|
548
|
+
const hotspots = swarm.getHighPriorityFiles(10);
|
|
496
549
|
|
|
497
|
-
|
|
498
|
-
const
|
|
499
|
-
console.log(`
|
|
500
|
-
|
|
501
|
-
// ── Standard API ─────────────────────────────────────────────────────
|
|
502
|
-
|
|
503
|
-
// Get health score
|
|
504
|
-
const health = await brain.getHealthScore();
|
|
505
|
-
|
|
506
|
-
// Code metrics
|
|
507
|
-
const metrics = await brain.computeMetrics();
|
|
508
|
-
|
|
509
|
-
// Vulnerability scan
|
|
510
|
-
const vulns = await brain.runVulnScan();
|
|
511
|
-
|
|
512
|
-
// Generate PR description
|
|
513
|
-
const pr = await brain.generatePRDescription(changes, 'feature/auth');
|
|
514
|
-
|
|
515
|
-
// Custom rules
|
|
516
|
-
brain.addCustomRule({
|
|
517
|
-
id: 'no-console-log',
|
|
518
|
-
name: 'No Console.Log',
|
|
519
|
-
description: 'Prevent console.log in production code',
|
|
520
|
-
pattern: 'console\\.log\\(',
|
|
521
|
-
severity: 'medium',
|
|
522
|
-
category: 'quality',
|
|
523
|
-
enabled: true,
|
|
524
|
-
});
|
|
525
|
-
|
|
526
|
-
// Notifications
|
|
527
|
-
await brain.sendNotification('critical-insight', 'Security Issue', 'Hardcoded API key found');
|
|
528
|
-
```
|
|
529
|
-
|
|
530
|
-
---
|
|
531
|
-
|
|
532
|
-
## 🏗️ Architecture
|
|
533
|
-
|
|
534
|
-
### Core Components
|
|
535
|
-
|
|
536
|
-
| Module | File | Purpose |
|
|
537
|
-
|---|---|---|
|
|
538
|
-
| **Orchestrator** | `brain/orchestrator.ts` | Central event loop — coordinates everything |
|
|
539
|
-
| **Analyzer** | `brain/analyzer.ts` | LLM + rule-based code analysis |
|
|
540
|
-
| **LLM Client** | `brain/llm-client.ts` | Multi-provider LLM abstraction (Anthropic, OpenAI, Ollama, OpenRouter) |
|
|
541
|
-
| **Project Context** | `brain/project-context.ts` | Builds project understanding |
|
|
542
|
-
| **Pattern Memory** | `brain/pattern-memory.ts` | Learns codebase patterns |
|
|
543
|
-
| **Health Score** | `brain/health-score.ts` | Multi-dimensional health scoring |
|
|
544
|
-
| **Smart Fix** | `brain/smart-fix.ts` | Auto-generates fix suggestions |
|
|
545
|
-
| **Framework Presets** | `brain/framework-presets.ts` | React, Next.js, Django, FastAPI, etc. |
|
|
546
|
-
| **Custom Rules** | `brain/custom-rules.ts` | User-defined analysis rules |
|
|
547
|
-
| **PR Generator** | `brain/pr-generator.ts` | AI-powered PR/commit messages |
|
|
548
|
-
| **Notifier** | `brain/notifier.ts` | Slack, Discord, Webhook alerts |
|
|
549
|
-
| **Code Metrics** | `brain/code-metrics.ts` | LOC, complexity, language stats |
|
|
550
|
-
| **Vuln Scanner** | `brain/vuln-scanner.ts` | Dependency & secrets scanning |
|
|
551
|
-
| **Report Generator** | `brain/report-generator.ts` | HTML, Markdown, JSON reports |
|
|
552
|
-
| **Auto-Update** | `brain/auto-update.ts` | Version update notifications |
|
|
553
|
-
|
|
554
|
-
### Super-Intelligence Components (v2.0+)
|
|
555
|
-
|
|
556
|
-
| Module | File | Purpose |
|
|
557
|
-
|---|---|---|
|
|
558
|
-
| **Semantic Analyzer** | `brain/semantic-analyzer.ts` | Symbol extraction, unused exports, dead code |
|
|
559
|
-
| **Dependency Graph** | `brain/dependency-graph.ts` | Tarjan's SCC, BFS depth, cycle & hub detection |
|
|
560
|
-
| **Code Similarity** | `brain/code-similarity.ts` | Winnowing algorithm for duplicate detection |
|
|
561
|
-
| **ADR Engine** | `brain/adr-engine.ts` | Architecture Decision Records |
|
|
562
|
-
| **Type Safety** | `brain/type-safety.ts` | `any` detection, `@ts-ignore`, missing types |
|
|
563
|
-
| **Performance Profiler** | `brain/perf-profiler.ts` | N+1 queries, memory leaks, blocking ops |
|
|
564
|
-
| **Context Completion** | `brain/context-completion.ts` | Knowledge gaps, missing docs/configs |
|
|
565
|
-
| **Learning Engine** | `brain/learning-engine.ts` | Pattern extraction, lesson persistence |
|
|
566
|
-
| **MCP Server** | `brain/mcp-server.ts` | JSON-RPC 2.0 MCP protocol server |
|
|
567
|
-
| **Team Mode** | `brain/team-mode.ts` | Shared insights & patterns across team |
|
|
568
|
-
| **Multi-Project** | `brain/multi-project.ts` | Watch multiple repos, aggregate health |
|
|
569
|
-
|
|
570
|
-
### Quantum Neural Mesh (v2.1+)
|
|
571
|
-
|
|
572
|
-
| Module | File | Purpose |
|
|
573
|
-
|---|---|---|
|
|
574
|
-
| **Neural Mesh** | `brain/neural-mesh.ts` | Cross-session shared intelligence |
|
|
575
|
-
| **Entropy Engine** | `brain/neural-mesh.ts` | Shannon entropy relevance scoring |
|
|
576
|
-
| **Knowledge Bus** | `~/.shadow-brain-mesh/` | Filesystem-based knowledge sharing |
|
|
577
|
-
|
|
578
|
-
### Adapter Pattern
|
|
579
|
-
|
|
580
|
-
Each AI agent gets a dedicated adapter that knows how to read its memory files and inject context:
|
|
581
|
-
|
|
582
|
-
```
|
|
583
|
-
BaseAdapter (abstract)
|
|
584
|
-
├── ClaudeCodeAdapter → CLAUDE.md, .claude/
|
|
585
|
-
├── KiloCodeAdapter → .kilocode/rules.md
|
|
586
|
-
├── ClineAdapter → .clinerules
|
|
587
|
-
├── OpenCodeAdapter → AGENT.md
|
|
588
|
-
├── CodexAdapter → AGENTS.md
|
|
589
|
-
├── RooCodeAdapter → .roo/rules.md
|
|
590
|
-
└── AiderAdapter → .aider.conf.yml
|
|
591
|
-
```
|
|
550
|
+
const defense = new AdversarialDefense();
|
|
551
|
+
const flag = await defense.verifyInsight(insight, './my-project');
|
|
552
|
+
console.log(`Verdict: ${flag?.verdict}, Confidence: ${flag?.confidence}`);
|
|
592
553
|
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
## 🔧 Configuration
|
|
596
|
-
|
|
597
|
-
### Project Config (`.shadow-brain.json`)
|
|
598
|
-
|
|
599
|
-
```json
|
|
600
|
-
{
|
|
601
|
-
"version": "2.1.0",
|
|
602
|
-
"rules": {
|
|
603
|
-
"customRules": [
|
|
604
|
-
{
|
|
605
|
-
"id": "no-any",
|
|
606
|
-
"name": "No TypeScript Any",
|
|
607
|
-
"description": "Prevent usage of 'any' type",
|
|
608
|
-
"pattern": ":\\s*any\\b",
|
|
609
|
-
"severity": "medium",
|
|
610
|
-
"category": "quality",
|
|
611
|
-
"suggestion": "Use a specific type instead of 'any'",
|
|
612
|
-
"enabled": true
|
|
613
|
-
}
|
|
614
|
-
],
|
|
615
|
-
"ignorePaths": ["**/*.test.ts", "**/*.spec.ts"]
|
|
616
|
-
},
|
|
617
|
-
"notifications": {
|
|
618
|
-
"slack": "https://hooks.slack.com/services/...",
|
|
619
|
-
"discord": "https://discord.com/api/webhooks/...",
|
|
620
|
-
"onHealthDrop": true,
|
|
621
|
-
"onCriticalInsight": true
|
|
622
|
-
},
|
|
623
|
-
"health": {
|
|
624
|
-
"weights": {
|
|
625
|
-
"security": 0.25,
|
|
626
|
-
"performance": 0.15,
|
|
627
|
-
"quality": 0.25,
|
|
628
|
-
"architecture": 0.15,
|
|
629
|
-
"maintainability": 0.10,
|
|
630
|
-
"testCoverage": 0.10
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
```
|
|
635
|
-
|
|
636
|
-
### Global Config
|
|
637
|
-
|
|
638
|
-
```bash
|
|
639
|
-
# Set LLM provider
|
|
640
|
-
shadow-brain config provider anthropic
|
|
641
|
-
|
|
642
|
-
# Set API key
|
|
643
|
-
shadow-brain config apiKey sk-ant-...
|
|
644
|
-
|
|
645
|
-
# Set brain personality
|
|
646
|
-
shadow-brain config brainPersonality security
|
|
647
|
-
|
|
648
|
-
# View all config
|
|
649
|
-
shadow-brain config --list
|
|
650
|
-
|
|
651
|
-
# Reset to defaults
|
|
652
|
-
shadow-brain config --reset
|
|
653
|
-
```
|
|
654
|
-
|
|
655
|
-
---
|
|
656
|
-
|
|
657
|
-
## 🔌 GitHub Actions Integration
|
|
658
|
-
|
|
659
|
-
```bash
|
|
660
|
-
# Generate CI workflow
|
|
661
|
-
shadow-brain ci .
|
|
662
|
-
```
|
|
663
|
-
|
|
664
|
-
Creates `.github/workflows/shadow-brain.yml` that:
|
|
665
|
-
- Runs Shadow Brain analysis on every PR
|
|
666
|
-
- Posts health score as a PR comment
|
|
667
|
-
- Uploads full HTML report as artifact
|
|
668
|
-
- Runs language-specific lint/test jobs
|
|
669
|
-
- Blocks merge on critical issues
|
|
670
|
-
|
|
671
|
-
---
|
|
672
|
-
|
|
673
|
-
## 🪝 Pre-Commit Hook
|
|
674
|
-
|
|
675
|
-
```bash
|
|
676
|
-
# Install hook
|
|
677
|
-
shadow-brain hook .
|
|
678
|
-
|
|
679
|
-
# Remove hook
|
|
680
|
-
shadow-brain hook . --uninstall
|
|
554
|
+
// Start everything
|
|
555
|
+
await brain.start();
|
|
681
556
|
```
|
|
682
557
|
|
|
683
|
-
Automatically analyzes your staged changes before each commit. If critical issues are found, the commit is blocked. Bypass with `git commit --no-verify`.
|
|
684
|
-
|
|
685
558
|
---
|
|
686
559
|
|
|
687
|
-
##
|
|
688
|
-
|
|
689
|
-
Shadow Brain computes a multi-dimensional health score (0-100, A-F):
|
|
560
|
+
## Health Score System
|
|
690
561
|
|
|
691
|
-
| Dimension | Weight |
|
|
562
|
+
| Dimension | Weight | Checks |
|
|
692
563
|
|---|---|---|
|
|
693
|
-
|
|
|
694
|
-
|
|
|
695
|
-
|
|
|
696
|
-
|
|
|
697
|
-
|
|
|
698
|
-
|
|
|
699
|
-
|
|
700
|
-
```bash
|
|
701
|
-
# Get health score
|
|
702
|
-
shadow-brain health .
|
|
703
|
-
|
|
704
|
-
# JSON output
|
|
705
|
-
shadow-brain health . --json
|
|
706
|
-
|
|
707
|
-
# SVG badge for README
|
|
708
|
-
shadow-brain health . --badge > health-badge.svg
|
|
709
|
-
```
|
|
564
|
+
| Security | 25% | Vulnerabilities, secrets, exposed keys |
|
|
565
|
+
| Quality | 25% | Code smells, anti-patterns, complexity |
|
|
566
|
+
| Performance | 15% | N+1 queries, memory leaks, blocking ops |
|
|
567
|
+
| Architecture | 15% | Coupling, cohesion, dependencies |
|
|
568
|
+
| Maintainability | 10% | Duplication, file sizes, comments |
|
|
569
|
+
| Test Coverage | 10% | Test presence, assertion quality |
|
|
710
570
|
|
|
711
571
|
---
|
|
712
572
|
|
|
713
|
-
##
|
|
573
|
+
## Version History
|
|
574
|
+
|
|
575
|
+
### v4.0.0 — Hyper-Intelligence Edition (Current)
|
|
576
|
+
- **TurboQuant Infinite Memory** — 6x compression, zero forgetting (Google Research, ICLR 2026)
|
|
577
|
+
- **SSSP BMSSP Routing** — O(m log<sup>2/3</sup>n) deterministic routing (arXiv 2504.17033)
|
|
578
|
+
- **Self-Evolving Genetic Rules** — tournament selection, Gaussian mutation, Bayesian meta-learning
|
|
579
|
+
- **Cross-Agent Intelligence Protocol** — 7 agents share insights in real-time
|
|
580
|
+
- **Adversarial Hallucination Defense** — cross-reference verification, evidence scoring
|
|
581
|
+
- **Swarm Intelligence** — Ant Colony pheromone file prioritization
|
|
582
|
+
- **Knowledge Graph + PageRank** — code impact radar with d=0.85 damping
|
|
583
|
+
- **Predictive Engine** — bug risk scoring, debt forecasting, anomaly detection
|
|
584
|
+
- **9 new CLI commands** — turbo, route, caip, evolve, predict, graph, swarm, defense, v4
|
|
585
|
+
- **29 files changed**, 7,000+ lines of new code
|
|
586
|
+
|
|
587
|
+
### v3.0.0 — Hyper-Intelligence Edition
|
|
588
|
+
- Cognitive load analysis
|
|
589
|
+
- Security audit engine
|
|
590
|
+
- Influence map (cross-file impact)
|
|
714
591
|
|
|
715
592
|
### v2.1.0 — Quantum Neural Mesh
|
|
716
|
-
-
|
|
717
|
-
-
|
|
718
|
-
-
|
|
719
|
-
-
|
|
720
|
-
- **5 mesh CLI commands** — status, insights, knowledge, nodes, aggregate
|
|
721
|
-
- **Quantum state** tracking — coherent, decoherent, collapsed
|
|
722
|
-
- **Heartbeat & discovery** — automatic node detection with filesystem bus
|
|
593
|
+
- Cross-session shared intelligence
|
|
594
|
+
- Shannon entropy relevance scoring
|
|
595
|
+
- Cosine similarity knowledge dedup
|
|
596
|
+
- Bayesian confidence updating
|
|
723
597
|
|
|
724
598
|
### v2.0.0 — Super-Intelligence Edition
|
|
725
|
-
-
|
|
726
|
-
-
|
|
727
|
-
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
-
|
|
731
|
-
-
|
|
732
|
-
-
|
|
733
|
-
- **MCP Server** — JSON-RPC 2.0 Model Context Protocol server
|
|
734
|
-
- **Team mode** — shared insights and patterns across team members
|
|
735
|
-
- **Multi-project** — watch and compare health across multiple repos
|
|
736
|
-
- **Roo Code & Aider adapters** — extended agent coverage
|
|
737
|
-
- **11 new CLI commands** — semantic, deps, duplicates, adr, typesafety, perf, knowledge, gaps, learn, team, mesh
|
|
738
|
-
|
|
739
|
-
### v1.2.0 — Feature Complete
|
|
740
|
-
- **Custom Rules Engine** — define your own analysis rules with regex patterns
|
|
741
|
-
- **PR Description Generator** — AI-powered PR titles and bodies
|
|
742
|
-
- **Commit Message Generator** — conventional commits, auto-generated
|
|
743
|
-
- **Vulnerability Scanner** — npm audit, pip audit, cargo audit, secrets detection
|
|
744
|
-
- **Code Metrics Engine** — LOC, complexity, language breakdown, hotspot detection
|
|
745
|
-
- **Notification System** — Slack, Discord, and webhook alerts for critical findings
|
|
746
|
-
- **Project Config** — `.shadow-brain.json` for per-project settings
|
|
747
|
-
- **Auto-Update Checker** — notifies when a new version is available
|
|
599
|
+
- Semantic analyzer, dependency graph, code similarity
|
|
600
|
+
- ADR engine, type safety, performance profiler
|
|
601
|
+
- MCP Server, team mode, multi-project
|
|
602
|
+
|
|
603
|
+
### v1.x — Foundation
|
|
604
|
+
- 7 agent adapters, health scoring, smart fixes
|
|
605
|
+
- Vulnerability scanning, custom rules, notifications
|
|
606
|
+
- CI/CD integration, pre-commit hooks
|
|
748
607
|
|
|
749
608
|
---
|
|
750
609
|
|
|
751
|
-
##
|
|
610
|
+
## Supported Agents
|
|
752
611
|
|
|
753
612
|
| Agent | Status | Injection Target |
|
|
754
613
|
|---|---|---|
|
|
755
|
-
| [Claude Code](https://docs.anthropic.com/en/docs/claude-code) |
|
|
756
|
-
| [Kilo Code](https://kilocode.ai/) |
|
|
757
|
-
| [Cline](https://github.com/cline/cline) |
|
|
758
|
-
| [OpenCode](https://github.com/opencode-ai/opencode) |
|
|
759
|
-
| [Codex](https://github.com/openai/codex) |
|
|
760
|
-
| [Roo Code](https://roocode.com/) |
|
|
761
|
-
| [Aider](https://aider.chat/) |
|
|
762
|
-
| [Cursor](https://cursor.com/) | 🔄 Planned | — |
|
|
614
|
+
| [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | Full Support | `CLAUDE.md`, `.claude/` |
|
|
615
|
+
| [Kilo Code](https://kilocode.ai/) | Full Support | `.kilocode/rules.md` |
|
|
616
|
+
| [Cline](https://github.com/cline/cline) | Full Support | `.clinerules` |
|
|
617
|
+
| [OpenCode](https://github.com/opencode-ai/opencode) | Full Support | `AGENT.md` |
|
|
618
|
+
| [Codex](https://github.com/openai/codex) | Full Support | `AGENTS.md` |
|
|
619
|
+
| [Roo Code](https://roocode.com/) | Full Support | `.roo/rules.md` |
|
|
620
|
+
| [Aider](https://aider.chat/) | Full Support | `.aider.conf.yml` |
|
|
763
621
|
|
|
764
622
|
---
|
|
765
623
|
|
|
766
|
-
##
|
|
624
|
+
## Development
|
|
767
625
|
|
|
768
626
|
```bash
|
|
769
|
-
# Clone
|
|
770
627
|
git clone https://github.com/theihtisham/agent-shadow-brain.git
|
|
771
628
|
cd agent-shadow-brain
|
|
772
|
-
|
|
773
|
-
# Install dependencies
|
|
774
629
|
npm install
|
|
775
|
-
|
|
776
|
-
# Build
|
|
777
630
|
npm run build
|
|
778
|
-
|
|
779
|
-
# Run in dev mode
|
|
780
|
-
npm run dev start .
|
|
781
|
-
|
|
782
|
-
# Run tests
|
|
783
631
|
npm test
|
|
784
|
-
|
|
785
|
-
# Type check
|
|
786
|
-
npm run lint
|
|
787
632
|
```
|
|
788
633
|
|
|
789
634
|
---
|
|
790
635
|
|
|
791
|
-
##
|
|
636
|
+
## Roadmap
|
|
792
637
|
|
|
793
|
-
- [x]
|
|
794
|
-
- [x]
|
|
795
|
-
- [x]
|
|
796
|
-
- [x]
|
|
797
|
-
- [x]
|
|
638
|
+
- [x] ~~MCP Server, multi-project, team mode~~ (v2.0)
|
|
639
|
+
- [x] ~~Cross-session neural mesh~~ (v2.1)
|
|
640
|
+
- [x] ~~TurboQuant infinite memory~~ (v4.0)
|
|
641
|
+
- [x] ~~SSSP quantum routing~~ (v4.0)
|
|
642
|
+
- [x] ~~Self-evolving rules~~ (v4.0)
|
|
643
|
+
- [x] ~~Cross-agent protocol~~ (v4.0)
|
|
644
|
+
- [x] ~~Adversarial hallucination defense~~ (v4.0)
|
|
798
645
|
- [ ] **IDE extensions** — VS Code extension for inline insights
|
|
799
646
|
- [ ] **Custom LLM fine-tuning** — train on your codebase patterns
|
|
800
647
|
- [ ] **Docker image** — one-command containerized deployment
|
|
801
|
-
- [ ] **Web dashboard v2** — React-based interactive analytics
|
|
802
|
-
- [ ] **Language server** — LSP protocol for real-time
|
|
648
|
+
- [ ] **Web dashboard v2** — React-based interactive analytics
|
|
649
|
+
- [ ] **Language server** — LSP protocol for real-time feedback
|
|
803
650
|
|
|
804
651
|
---
|
|
805
652
|
|
|
806
|
-
##
|
|
653
|
+
## License
|
|
807
654
|
|
|
808
655
|
MIT License — see [LICENSE](LICENSE) for details.
|
|
809
656
|
|
|
810
657
|
---
|
|
811
658
|
|
|
812
|
-
##
|
|
659
|
+
## Author
|
|
813
660
|
|
|
814
661
|
**theihtisham**
|
|
815
662
|
|
|
@@ -820,18 +667,12 @@ MIT License — see [LICENSE](LICENSE) for details.
|
|
|
820
667
|
|
|
821
668
|
<div align="center">
|
|
822
669
|
|
|
823
|
-
### If Shadow Brain makes your AI agents smarter, give it a
|
|
670
|
+
### If Shadow Brain makes your AI agents smarter, give it a star
|
|
824
671
|
|
|
825
672
|
[](https://star-history.com/#theihtisham/agent-shadow-brain&Date)
|
|
826
673
|
|
|
827
|
-
**Built with
|
|
828
|
-
|
|
829
|
-
</div>
|
|
830
|
-
|
|
831
|
-
---
|
|
832
|
-
|
|
833
|
-
<div align="center">
|
|
674
|
+
**Built with brains by [theihtisham](https://github.com/theihtisham)**
|
|
834
675
|
|
|
835
|
-
**Topics:** `ai` `artificial-intelligence` `llm` `claude-code` `cline` `kilo-code` `codex` `roo-code` `aider` `opencode` `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` `
|
|
676
|
+
**Topics:** `ai` `artificial-intelligence` `llm` `claude-code` `cline` `kilo-code` `codex` `roo-code` `aider` `opencode` `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` `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`
|
|
836
677
|
|
|
837
678
|
</div>
|