@timmeck/brain 3.36.15 → 3.36.16
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 +178 -188
- package/dist/brain.d.ts +4 -0
- package/dist/brain.js +184 -7
- package/dist/brain.js.map +1 -1
- package/dist/cli/commands/__tests__/borg.test.d.ts +1 -0
- package/dist/cli/commands/__tests__/borg.test.js +84 -0
- package/dist/cli/commands/__tests__/borg.test.js.map +1 -0
- package/dist/cli/commands/__tests__/plugins.test.d.ts +1 -0
- package/dist/cli/commands/__tests__/plugins.test.js +69 -0
- package/dist/cli/commands/__tests__/plugins.test.js.map +1 -0
- package/dist/cli/commands/__tests__/watchdog.test.d.ts +1 -0
- package/dist/cli/commands/__tests__/watchdog.test.js +63 -0
- package/dist/cli/commands/__tests__/watchdog.test.js.map +1 -0
- package/dist/cli/commands/borg.d.ts +2 -0
- package/dist/cli/commands/borg.js +77 -0
- package/dist/cli/commands/borg.js.map +1 -0
- package/dist/cli/commands/plugins.d.ts +2 -0
- package/dist/cli/commands/plugins.js +75 -0
- package/dist/cli/commands/plugins.js.map +1 -0
- package/dist/cli/commands/service.d.ts +2 -0
- package/dist/cli/commands/service.js +101 -0
- package/dist/cli/commands/service.js.map +1 -0
- package/dist/cli/commands/watchdog.d.ts +2 -0
- package/dist/cli/commands/watchdog.js +69 -0
- package/dist/cli/commands/watchdog.js.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/ipc/router.d.ts +7 -0
- package/dist/ipc/router.js +39 -5
- package/dist/ipc/router.js.map +1 -1
- package/dist/mcp/debate-tools.js +48 -0
- package/dist/mcp/debate-tools.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
[](https://github.com/timmeck/brain-ecosystem)
|
|
7
7
|
|
|
8
|
-
**Autonomous Error Memory, Code Intelligence & Self-Improving AI for Claude Code — 134 MCP Tools,
|
|
8
|
+
**Autonomous Error Memory, Code Intelligence & Self-Improving AI for Claude Code — 134 MCP Tools, 60+ Engines**
|
|
9
9
|
|
|
10
|
-
Brain is an MCP server that gives Claude Code a persistent, self-improving memory. It remembers errors, learns solutions, and runs
|
|
10
|
+
Brain is an MCP server that gives Claude Code a persistent, self-improving memory. It remembers errors, learns solutions, and runs 60+ autonomous engines in a 40-step feedback cycle. It observes itself, detects anomalies, forms and tests hypotheses, distills principles, reasons in chains, feels emotions, evolves strategies genetically, debates itself, challenges its own principles (Advocatus Diaboli), gets curious about knowledge gaps, syncs knowledge via Borg collective, loads community plugins, and modifies its own source code. Multi-provider LLM (Anthropic + Ollama). Autonomous web research missions. Live tech radar scanning. 137 MCP tools. 1407 tests.
|
|
11
11
|
|
|
12
12
|
## Quick Start
|
|
13
13
|
|
|
@@ -18,6 +18,29 @@ brain setup
|
|
|
18
18
|
|
|
19
19
|
That's it. One command configures MCP, hooks, and starts the daemon.
|
|
20
20
|
|
|
21
|
+
## Architecture
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
Claude Code ──MCP stdio──► Brain Daemon (:7777)
|
|
25
|
+
Cursor/Windsurf ─MCP SSE──► MCP HTTP Server (:7778)
|
|
26
|
+
Browser ────────HTTP──────► Mission Control (:7788)
|
|
27
|
+
Command Center (:7790)
|
|
28
|
+
│
|
|
29
|
+
┌───────────────┼───────────────┐
|
|
30
|
+
▼ ▼ ▼
|
|
31
|
+
Error Memory Research Engine 60+ Engines
|
|
32
|
+
Code Intel Mission Engine ResearchOrchestrator
|
|
33
|
+
Synapse Net LLM Service 40-step feedback loop
|
|
34
|
+
Prevention Web Research │
|
|
35
|
+
Git Intel TechRadar ┌───┴───────────┐
|
|
36
|
+
│ ▼ ▼
|
|
37
|
+
▼ Self-Modification Dream Mode
|
|
38
|
+
SQLite (~/.brain) CodeGenerator Memory
|
|
39
|
+
SelfScanner Consolidation
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Cross-brain communication via IPC named pipes (trading-brain, marketing-brain).
|
|
43
|
+
|
|
21
44
|
## Features
|
|
22
45
|
|
|
23
46
|
### Error Memory & Code Intelligence
|
|
@@ -32,221 +55,188 @@ That's it. One command configures MCP, hooks, and starts the daemon.
|
|
|
32
55
|
- **Memory System** — Remember preferences, decisions, context, facts, goals, and lessons across sessions
|
|
33
56
|
- **Session Tracking** — Auto-tracks conversation sessions with goals, summaries, and outcomes
|
|
34
57
|
- **Decision History** — Record architecture/design decisions with alternatives and rationale
|
|
35
|
-
- **Semantic Changelog** —
|
|
36
|
-
- **Task
|
|
58
|
+
- **Semantic Changelog** — Tracks every file change with semantic meaning, diffs, and context
|
|
59
|
+
- **Task & Goal Tracking** — Persistent tasks with priority, status, and cross-session continuity
|
|
37
60
|
- **Semantic Search** — Local all-MiniLM-L6-v2 embeddings (23MB, no cloud required)
|
|
38
61
|
|
|
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
|
-
|
|
62
|
+
### LLM Service
|
|
63
|
+
- **Multi-Provider** — Anthropic Claude + Ollama local models with auto-routing
|
|
64
|
+
- **Smart Caching** — Content-hash cache, avoid duplicate API calls
|
|
65
|
+
- **Rate Limiting** — Per-hour and per-day token budgets with automatic throttling
|
|
66
|
+
- **Usage Tracking** — Calls, tokens, latency, cache hit rate, cost tracking
|
|
67
|
+
- **Tier Routing** — Templates mapped to tiers (critical/standard/bulk), auto-routed to best provider
|
|
68
|
+
|
|
69
|
+
### Research Missions
|
|
70
|
+
- **5-Phase Pipeline** — Decompose → Gather → Hypothesize → Analyze → Synthesize
|
|
71
|
+
- **Web Research** — Brave Search + Jina Reader + Playwright + Firecrawl fallback chain
|
|
72
|
+
- **Autonomous** — Brain decides what to research and executes independently
|
|
73
|
+
- **Source Tracking** — Every finding traced back to its original source
|
|
74
|
+
|
|
75
|
+
### TechRadar
|
|
76
|
+
- **Daily Scanning** — Tracks trending repos, tech news, library updates
|
|
77
|
+
- **Repo Watching** — Monitor specific repos for changes (3 default repos configured)
|
|
78
|
+
- **LLM Relevance Scoring** — AI judges how relevant each finding is to your stack
|
|
79
|
+
- **Digest Generation** — Daily summaries of what's new and relevant
|
|
80
|
+
|
|
81
|
+
### 60+ Autonomous Engines
|
|
82
|
+
|
|
83
|
+
The ResearchOrchestrator runs a 40-step feedback cycle every 5 minutes:
|
|
84
|
+
|
|
85
|
+
#### Core Research Engines
|
|
86
|
+
|
|
87
|
+
| Engine | Purpose |
|
|
88
|
+
|--------|---------|
|
|
89
|
+
| SelfObserver | Monitors Brain's own performance metrics and behavior |
|
|
90
|
+
| AnomalyDetective | Detects statistical anomalies in error patterns and metrics |
|
|
91
|
+
| DataScout | Discovers external data sources and imports relevant data |
|
|
92
|
+
| SignalScanner | Scans GitHub repos, HN, crypto markets for signals |
|
|
93
|
+
| TechRadar | Daily tech landscape scanning with relevance scoring |
|
|
94
|
+
| HypothesisEngine | Generates and statistically tests hypotheses about patterns |
|
|
95
|
+
| ExperimentEngine | Proposes, runs, and measures controlled experiments |
|
|
96
|
+
| AutoExperimentEngine | Autonomously discovers and runs parameter experiments |
|
|
97
|
+
| SimulationEngine | What-if scenarios and counterfactual reasoning |
|
|
98
|
+
| KnowledgeDistiller | Extracts principles and anti-patterns from experience |
|
|
99
|
+
|
|
100
|
+
#### Intelligence Engines
|
|
101
|
+
|
|
102
|
+
| Engine | Purpose |
|
|
103
|
+
|--------|---------|
|
|
104
|
+
| AttentionEngine | Dynamic focus allocation across topics and engines |
|
|
105
|
+
| CausalGraph | Discovers cause-effect relationships between events |
|
|
106
|
+
| CrossDomainEngine | Finds correlations across brain domains |
|
|
107
|
+
| PatternExtractor | Mines recurring code and error patterns |
|
|
108
|
+
| TransferEngine | Transfers knowledge between domains via analogies |
|
|
109
|
+
| NarrativeEngine | Generates natural language explanations of findings |
|
|
110
|
+
| CuriosityEngine | Detects knowledge gaps and generates exploration questions |
|
|
111
|
+
| ResearchAgendaEngine | Prioritizes what to investigate next |
|
|
112
|
+
| CounterfactualEngine | "What if X hadn't happened?" reasoning |
|
|
113
|
+
|
|
114
|
+
#### Meta-Cognition Engines
|
|
115
|
+
|
|
116
|
+
| Engine | Purpose |
|
|
117
|
+
|--------|---------|
|
|
118
|
+
| MetaCognitionLayer | Evaluates engine effectiveness, produces report cards |
|
|
119
|
+
| DebateEngine | Multi-perspective reasoning with synthesis |
|
|
120
|
+
| EmergenceEngine | Detects emergent properties from engine interactions |
|
|
121
|
+
| ConceptAbstraction | Forms hierarchical concept taxonomies |
|
|
122
|
+
| MemoryPalace | Builds associative knowledge graph for navigation |
|
|
123
|
+
| ReasoningEngine | Deductive, abductive, and temporal inference chains |
|
|
124
|
+
| EmotionalModel | Frustration, curiosity, satisfaction — influences priorities |
|
|
125
|
+
| SelfTestEngine | Tests understanding of its own principles |
|
|
126
|
+
| TeachEngine | Packages knowledge for transfer to other brains |
|
|
127
|
+
|
|
128
|
+
#### Autonomy Engines
|
|
129
|
+
|
|
130
|
+
| Engine | Purpose |
|
|
131
|
+
|--------|---------|
|
|
132
|
+
| SelfModificationEngine | Generates code improvements, tests before applying |
|
|
133
|
+
| CodeGenerator | Produces new code from learned patterns |
|
|
134
|
+
| CodeMiner | Extracts reusable patterns from codebases |
|
|
135
|
+
| GoalEngine | Sets, tracks, and forecasts autonomous goals |
|
|
136
|
+
| EvolutionEngine | Genetic algorithm for strategy optimization |
|
|
137
|
+
| AdaptiveStrategyEngine | Real-time parameter adaptation based on outcomes |
|
|
138
|
+
| DreamEngine | Offline memory consolidation during idle |
|
|
139
|
+
| ResearchOrchestrator | Orchestrates the entire 40-step feedback cycle |
|
|
92
140
|
|
|
93
141
|
### Self-Improvement Loop
|
|
94
|
-
- **Hypothesis Engine** — Forms hypotheses from observed patterns, tests them statistically
|
|
95
|
-
- **Auto-Experiments** — Tests its own parameters (Z-Threshold, Decay Rate, Research Interval)
|
|
96
|
-
- **Self-Metrics** — Tracks own cycle data: anomaly_count, insight_count, cycle_duration_ms
|
|
97
|
-
- **Frustration Detection** — If a suggestion is ignored 3x, generates alternative approaches
|
|
98
|
-
- **Improvement Requests** — Writes "Tell Claude:" suggestions to `~/.brain/improvement-requests.md`
|
|
99
|
-
- **Knowledge Distillation** — Confirmed hypotheses become reusable principles
|
|
100
142
|
|
|
101
|
-
|
|
102
|
-
- **Memory Replay** — Spreading Activation strengthens active memory pathways
|
|
103
|
-
- **Synapse Pruning** — Weak connections (weight < 0.15) are deleted
|
|
104
|
-
- **Memory Compression** — Similar memories are clustered and merged
|
|
105
|
-
- **Importance Decay** — Old memories gradually lose importance, eventually archived
|
|
106
|
-
- **Triggers** — Every 20 cycles, after 5 minutes idle, or manually
|
|
107
|
-
|
|
108
|
-
### Mission Control Dashboard (`:7788`)
|
|
109
|
-
|
|
110
|
-
<p align="center"><img src="../../docs/assets/mission-control.png" alt="Mission Control Dashboard" width="700"></p>
|
|
143
|
+
Brain continuously improves itself through a closed-loop cycle:
|
|
111
144
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
- **Intelligence** — Attention topics, transfer analogies, cross-domain rules
|
|
119
|
-
- **Trigger Cycle** — Button to manually trigger a feedback cycle
|
|
120
|
-
|
|
121
|
-
### Prediction Engine
|
|
122
|
-
- **Holt-Winters** — Double Exponential Smoothing for metric forecasting
|
|
123
|
-
- **EWMA Fallback** — When insufficient data for Holt-Winters
|
|
124
|
-
- **Auto-Calibration** — Confidence calibrated against actual outcomes
|
|
125
|
-
- **Self-Resolving** — Predictions are checked against reality and scored
|
|
145
|
+
1. **Observe** — SelfObserver records performance metrics (error rates, resolution times, cache hits)
|
|
146
|
+
2. **Hypothesize** — HypothesisEngine generates testable theories about what could work better
|
|
147
|
+
3. **Experiment** — AutoExperimentEngine runs controlled A/B tests on parameters
|
|
148
|
+
4. **Measure** — MetaCognitionLayer evaluates which experiments improved outcomes
|
|
149
|
+
5. **Adapt** — AdaptiveStrategy applies winning parameters, reverts failures
|
|
150
|
+
6. **Evolve** — EvolutionEngine genetically breeds the best strategy combinations
|
|
126
151
|
|
|
127
|
-
|
|
128
|
-
- **Anomaly Response** — Automatically adjusts parameters when anomalies are detected
|
|
129
|
-
- **Configurable Rules** — Define which anomalies trigger which actions
|
|
130
|
-
- **Cooldown System** — Prevents response storms
|
|
131
|
-
- **Journal Logging** — Every auto-response is logged for review
|
|
132
|
-
|
|
133
|
-
### Code Generation & Mining
|
|
134
|
-
- **CodeGenerator** — Claude API integration, uses brain knowledge (principles, anti-patterns, strategies, patterns) as context
|
|
135
|
-
- **Human-in-the-Loop** — Generated code is reviewed: approve or reject with notes
|
|
136
|
-
- **CodeMiner** — Mines GitHub repos (README, package.json, directory trees) for pattern learning
|
|
137
|
-
- **PatternExtractor** — Extracts dependency, tech stack, structure, and README patterns from mined repos
|
|
138
|
-
- **CodeGen Tab** — Integrated in Mission Control at http://localhost:7788 for reviewing and managing code generations
|
|
139
|
-
- **Signal Scanner** — Tracks GitHub trending repos, Hacker News mentions, crypto signals
|
|
140
|
-
|
|
141
|
-
### Dashboards
|
|
142
|
-
|
|
143
|
-
| Dashboard | Port | What It Shows |
|
|
144
|
-
|-----------|------|--------------|
|
|
145
|
-
| **Mission Control** | 7788 | Unified 7-tab dashboard: Overview, Consciousness (Entity visualization), Thoughts, CodeGen, Self-Mod, Engines, Intelligence |
|
|
146
|
-
|
|
147
|
-
## Architecture
|
|
152
|
+
Frustration Detection: EmotionalModel tracks repeated failures. High frustration triggers more aggressive exploration via CuriosityEngine.
|
|
148
153
|
|
|
149
|
-
|
|
150
|
-
Claude Code / Cursor / Browser
|
|
151
|
-
|
|
|
152
|
-
MCP / HTTP / REST
|
|
153
|
-
|
|
|
154
|
-
+----+----+
|
|
155
|
-
| BrainCore|
|
|
156
|
-
+----+----+
|
|
157
|
-
|
|
|
158
|
-
+------+------+------+------+------+
|
|
159
|
-
| | | | | |
|
|
160
|
-
Error Code Synapse Memory Git Embedding
|
|
161
|
-
Memory Intel Network System Intel Engine
|
|
162
|
-
| | | | | |
|
|
163
|
-
+------+------+------+------+------+
|
|
164
|
-
|
|
|
165
|
-
ResearchOrchestrator (40 steps)
|
|
166
|
-
|
|
|
167
|
-
+------+------+------+------+------+------+------+
|
|
168
|
-
| | | | | | | |
|
|
169
|
-
Dream Pred. AutoR Hypo. CodeGen Signal Attention
|
|
170
|
-
Engine Engine espond Engine (Claude) Scanner Engine
|
|
171
|
-
| | | | | | | |
|
|
172
|
-
+------+------+------+------+------+------+------+
|
|
173
|
-
|
|
|
174
|
-
30+ Engines in Feedback Loops
|
|
175
|
-
(Research, Intelligence, MetaCog, Evolution,
|
|
176
|
-
Reasoning, Emotions, Self-Modification, ...)
|
|
177
|
-
|
|
|
178
|
-
SQLite (better-sqlite3, WAL mode)
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
## MCP Tools (134 tools)
|
|
182
|
-
|
|
183
|
-
**Error & Code**: brain_report_error, brain_query_error, brain_report_solution, brain_report_attempt, brain_find_reusable_code, brain_register_code, brain_check_code_similarity
|
|
184
|
-
|
|
185
|
-
**Memory & Sessions**: brain_remember, brain_recall, brain_session_start, brain_session_end, brain_session_history
|
|
154
|
+
### Dream Mode
|
|
186
155
|
|
|
187
|
-
|
|
156
|
+
During idle periods (no active conversations), DreamEngine performs memory consolidation:
|
|
188
157
|
|
|
189
|
-
**
|
|
158
|
+
- **Replay** — Re-processes important experiences to strengthen synaptic connections
|
|
159
|
+
- **Pruning** — Removes low-value memories and weak synapse connections
|
|
160
|
+
- **Compression** — Merges similar patterns into generalized principles
|
|
161
|
+
- **Decay** — Time-based weight reduction on unused knowledge
|
|
162
|
+
- **Triggers** — Starts automatically after configurable idle period, or manually via `dream.start`
|
|
190
163
|
|
|
191
|
-
|
|
164
|
+
### Prediction Engine
|
|
192
165
|
|
|
193
|
-
|
|
166
|
+
Forecasts future metrics using statistical models:
|
|
194
167
|
|
|
195
|
-
**
|
|
168
|
+
- **Holt-Winters** — Triple exponential smoothing for seasonal patterns
|
|
169
|
+
- **EWMA** — Exponential weighted moving average for trend detection
|
|
170
|
+
- **Auto-Calibration** — Tracks prediction accuracy and adjusts model parameters
|
|
171
|
+
- **Domain-Aware** — Separate models per domain (errors, performance, learning)
|
|
196
172
|
|
|
197
|
-
|
|
173
|
+
### AutoResponder
|
|
198
174
|
|
|
199
|
-
|
|
175
|
+
Automatic anomaly response system:
|
|
200
176
|
|
|
201
|
-
**
|
|
177
|
+
- **Rule-Based** — Configurable rules: "if error_rate > threshold, trigger learning cycle"
|
|
178
|
+
- **Cooldown** — Prevents response storms with per-rule cooldown periods
|
|
179
|
+
- **Action Types** — Learning cycles, notifications, parameter adjustments, dream triggers
|
|
180
|
+
- **History** — Full audit trail of what was detected and what action was taken
|
|
202
181
|
|
|
203
|
-
|
|
182
|
+
### Code Generation & Mining
|
|
204
183
|
|
|
205
|
-
**
|
|
184
|
+
- **CodeGenerator** — Generates code improvements via Claude API with full diff preview
|
|
185
|
+
- **CodeMiner** — Analyzes codebases to extract reusable patterns and modules
|
|
186
|
+
- **PatternExtractor** — Identifies recurring code patterns across projects
|
|
187
|
+
- **SignalScanner** — Monitors GitHub trending, Hacker News, crypto markets for relevant signals
|
|
188
|
+
- **Self-Improvement Proposals** — Engines can propose improvements to their own source code
|
|
206
189
|
|
|
207
|
-
|
|
190
|
+
### Self-Modification
|
|
191
|
+
- **SelfScanner** — Indexes own TypeScript source code with SHA256 change detection
|
|
192
|
+
- **SelfModificationEngine** — Generates improvements via Claude API, tests before applying
|
|
193
|
+
- **Experiment Ledger** — Tracks hypothesis, risk level, metrics before/after for every modification
|
|
194
|
+
- **Safety** — All modifications require explicit approval, automatic rollback on test failure
|
|
208
195
|
|
|
209
|
-
|
|
196
|
+
### Notifications
|
|
197
|
+
- **Discord, Telegram, Email** — Multi-channel alert routing
|
|
198
|
+
- **Notification Bridge** — IPC-based cross-brain notification relay
|
|
199
|
+
- **Configurable** — All providers optional, graceful fallback
|
|
200
|
+
- **Event Routing** — Different events route to different channels
|
|
210
201
|
|
|
211
|
-
|
|
202
|
+
### Dashboards
|
|
212
203
|
|
|
213
|
-
|
|
204
|
+
| Dashboard | Port | What It Shows |
|
|
205
|
+
|-----------|------|--------------|
|
|
206
|
+
| **Mission Control** | 7788 | 7-tab: Overview, Consciousness Entity, Thoughts, CodeGen, Self-Mod, Engines, Intelligence |
|
|
207
|
+
| **Command Center** | 7790 | 8-page: Ecosystem, Learning, Trading, Marketing, Cross-Brain & Borg, Debates & Challenges, Activity & Missions, Infrastructure |
|
|
214
208
|
|
|
215
|
-
**
|
|
209
|
+
**Mission Control** — The Consciousness Entity visualization shows Brain's current emotional state, active thought streams, engine activity heatmap, and real-time thought generation. CodeGen tab shows pending code proposals. Self-Mod tab shows modification history with diffs.
|
|
216
210
|
|
|
217
|
-
**
|
|
211
|
+
**Command Center** — Live overview of the entire ecosystem: all 3 brains, 60+ engines, error log, self-modification feed, research missions, knowledge growth chart, engine dependency flow, quick actions, animated Borg network, peer graph, debate history, Advocatus Diaboli challenges with resilience bars, watchdog daemon monitoring, LLM usage tracking.
|
|
218
212
|
|
|
219
|
-
|
|
213
|
+
## MCP Tools (137 tools)
|
|
220
214
|
|
|
221
|
-
**
|
|
215
|
+
**Error & Code**: brain_report_error, brain_query_error, brain_report_solution, brain_report_attempt, brain_find_reusable_code, brain_register_code, brain_check_code_similarity
|
|
222
216
|
|
|
223
|
-
**
|
|
217
|
+
**Memory & Sessions**: brain_remember, brain_recall, brain_session_start, brain_session_end, brain_session_history
|
|
224
218
|
|
|
225
|
-
**
|
|
219
|
+
**Research Engines** (5 tools each): self_observer, anomaly_detective, cross_domain, adaptive_strategy, experiment, knowledge_distiller, research_agenda, counterfactual, journal
|
|
226
220
|
|
|
227
|
-
**
|
|
221
|
+
**Dream, Consciousness, Prediction, AutoResponder, Attention, Transfer, Narrative, Curiosity, Emergence, Debate, Challenge (Advocatus Diaboli), MetaCognition, Evolution, Reasoning, Emotions, Self-Modification, Ecosystem, Borg, Plugins** — full tool suites for each
|
|
228
222
|
|
|
229
223
|
## CLI Commands
|
|
230
224
|
|
|
231
225
|
```
|
|
232
226
|
brain setup One-command setup: MCP + hooks + daemon
|
|
233
|
-
brain start
|
|
234
|
-
brain
|
|
235
|
-
brain status Show stats
|
|
227
|
+
brain start / stop Daemon management (with watchdog)
|
|
228
|
+
brain status Stats: errors, solutions, engines, synapses
|
|
236
229
|
brain doctor Health check: daemon, DB, MCP, hooks
|
|
237
230
|
brain query <text> Search for errors and solutions
|
|
238
|
-
brain modules List registered code modules
|
|
239
|
-
brain insights Show research insights
|
|
240
|
-
brain network Explore the synapse network
|
|
241
231
|
brain learn Trigger a learning cycle
|
|
242
|
-
brain explain <id> Full error report
|
|
243
|
-
brain rules List active learned rules
|
|
244
|
-
brain synapses Show strongest synapse connections
|
|
245
|
-
brain config View and manage configuration
|
|
246
|
-
brain export Export Brain data as JSON
|
|
247
|
-
brain import <dir> Import a project directory
|
|
248
|
-
brain dashboard Generate interactive HTML dashboard
|
|
249
232
|
brain peers Show peer brains in the ecosystem
|
|
233
|
+
brain dashboard Generate interactive HTML dashboard
|
|
234
|
+
brain missions Research mission management (create, list, report)
|
|
235
|
+
brain watchdog Watchdog daemon status and control
|
|
236
|
+
brain service Windows service management (install, uninstall, status)
|
|
237
|
+
brain borg Borg collective sync (status, enable, disable, sync, history)
|
|
238
|
+
brain plugins Community plugins (list, routes, tools)
|
|
239
|
+
brain export Export Brain data as JSON
|
|
250
240
|
```
|
|
251
241
|
|
|
252
242
|
## Configuration
|
|
@@ -256,20 +246,20 @@ brain peers Show peer brains in the ecosystem
|
|
|
256
246
|
| `BRAIN_DATA_DIR` | `~/.brain` | Data directory |
|
|
257
247
|
| `BRAIN_LOG_LEVEL` | `info` | Log level |
|
|
258
248
|
| `BRAIN_API_PORT` | `7777` | REST API port |
|
|
259
|
-
| `BRAIN_API_KEY` | — | API authentication key |
|
|
260
249
|
| `BRAIN_MCP_HTTP_PORT` | `7778` | MCP HTTP/SSE port |
|
|
261
|
-
| `
|
|
262
|
-
| `
|
|
250
|
+
| `ANTHROPIC_API_KEY` | — | Enables LLM features, CodeGen, Self-Mod |
|
|
251
|
+
| `BRAVE_SEARCH_API_KEY` | — | Enables web research missions |
|
|
263
252
|
| `GITHUB_TOKEN` | — | Enables CodeMiner + Signal Scanner |
|
|
253
|
+
| `OLLAMA_HOST` | `http://localhost:11434` | Ollama local model endpoint |
|
|
264
254
|
|
|
265
255
|
## Brain Ecosystem
|
|
266
256
|
|
|
267
|
-
| Brain |
|
|
268
|
-
|
|
269
|
-
| **Brain**
|
|
270
|
-
| [Trading Brain](../trading-brain) |
|
|
271
|
-
| [Marketing Brain](../marketing-brain) |
|
|
272
|
-
| [Brain Core](../brain-core) |
|
|
257
|
+
| Brain | Purpose | Ports |
|
|
258
|
+
|-------|---------|-------|
|
|
259
|
+
| **Brain** (this) | Error memory, code intelligence, full autonomy & self-modification | **7777** / 7778 / 7788 / 7790 |
|
|
260
|
+
| [Trading Brain](../trading-brain) | Adaptive trading intelligence with signal learning & paper trading | 7779 / 7780 |
|
|
261
|
+
| [Marketing Brain](../marketing-brain) | Content strategy, social engagement & cross-platform optimization | 7781 / 7782 / 7783 |
|
|
262
|
+
| [Brain Core](../brain-core) | Shared infrastructure — 60+ engines | — |
|
|
273
263
|
|
|
274
264
|
## Support
|
|
275
265
|
|
package/dist/brain.d.ts
CHANGED
|
@@ -22,7 +22,10 @@ export declare class BrainCore {
|
|
|
22
22
|
private emergenceEngine;
|
|
23
23
|
private debateEngine;
|
|
24
24
|
private peerNetwork;
|
|
25
|
+
private pluginRegistry;
|
|
26
|
+
private borgSync;
|
|
25
27
|
private cleanupTimer;
|
|
28
|
+
private retentionTimer;
|
|
26
29
|
private config;
|
|
27
30
|
private configPath?;
|
|
28
31
|
private restarting;
|
|
@@ -30,6 +33,7 @@ export declare class BrainCore {
|
|
|
30
33
|
private restartWindowStart;
|
|
31
34
|
start(configPath?: string): void;
|
|
32
35
|
private logCrash;
|
|
36
|
+
private runRetentionCleanup;
|
|
33
37
|
private cleanup;
|
|
34
38
|
restart(): void;
|
|
35
39
|
stop(): void;
|