crbro-memory 1.3.0 β 1.5.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/LICENSE +21 -0
- package/README.md +170 -121
- package/bin/{crbro.js β crbro.mjs} +119 -47
- package/dist/engine/brain.d.ts +3 -0
- package/dist/engine/brain.d.ts.map +1 -1
- package/dist/engine/brain.js +15 -2
- package/dist/engine/brain.js.map +1 -1
- package/dist/engine/cortex.d.ts +61 -7
- package/dist/engine/cortex.d.ts.map +1 -1
- package/dist/engine/cortex.js +168 -23
- package/dist/engine/cortex.js.map +1 -1
- package/dist/engine/maintenance.d.ts +6 -1
- package/dist/engine/maintenance.d.ts.map +1 -1
- package/dist/engine/maintenance.js +19 -5
- package/dist/engine/maintenance.js.map +1 -1
- package/dist/engine/prefrontal.d.ts +13 -2
- package/dist/engine/prefrontal.d.ts.map +1 -1
- package/dist/engine/prefrontal.js +47 -11
- package/dist/engine/prefrontal.js.map +1 -1
- package/dist/miner/index.d.ts.map +1 -1
- package/dist/miner/index.js +35 -30
- package/dist/miner/index.js.map +1 -1
- package/dist/search/index.d.ts +46 -6
- package/dist/search/index.d.ts.map +1 -1
- package/dist/search/index.js +335 -74
- package/dist/search/index.js.map +1 -1
- package/dist/search/tokenize.d.ts +23 -0
- package/dist/search/tokenize.d.ts.map +1 -0
- package/dist/search/tokenize.js +83 -0
- package/dist/search/tokenize.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +132 -64
- package/dist/server.js.map +1 -1
- package/dist/types/index.d.ts +39 -8
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/fs.d.ts +3 -1
- package/dist/utils/fs.d.ts.map +1 -1
- package/dist/utils/fs.js +6 -2
- package/dist/utils/fs.js.map +1 -1
- package/dist/utils/hash.d.ts +20 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/hash.js +45 -0
- package/dist/utils/hash.js.map +1 -0
- package/package.json +53 -52
- package/dist/engine/license.d.ts +0 -56
- package/dist/engine/license.d.ts.map +0 -1
- package/dist/engine/license.js +0 -332
- package/dist/engine/license.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Octonove Agency
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,121 +1,170 @@
|
|
|
1
|
-
# π§ CRBRO β Persistent Neural Memory for AI
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
1
|
+
# π§ CRBRO β Persistent Neural Memory for AI
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/crbro-memory)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](https://modelcontextprotocol.io)
|
|
6
|
+
|
|
7
|
+
**CRBRO** is a local MCP (Model Context Protocol) server that gives your AI assistant **persistent long-term memory** across sessions. It uses a biological neural architecture β cortex, synapses, hippocampus β to store, connect, and retrieve knowledge automatically.
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
Free and open source (MIT). All 16 tools included β no license, no account, no tiers.
|
|
12
|
+
|
|
13
|
+
> β **If CRBRO gives your AI a memory worth keeping, a star on GitHub is the best way to support it.**
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
- **𧬠Biological Architecture** β Knowledge organized as neurons (cortex), connections (synapses), and session memory (hippocampus)
|
|
18
|
+
- **π Fact-Level Search** β Powered by [Orama](https://orama.com/). Every fact is indexed on its own, so a topic with hundreds of facts stays as findable as one with three, and each result comes back with the exact fact that matched and the date it was recorded
|
|
19
|
+
- **π₯ Heat Scores** β Automatic relevance tracking based on frequency, recency, and connectivity
|
|
20
|
+
- **βοΈ Correctable** β Knowledge can be superseded or retracted, not just piled up. A memory that only appends keeps serving yesterday's answer with today's confidence
|
|
21
|
+
- **πΊοΈ Global Map** β Cluster detection and cross-domain bridge identification
|
|
22
|
+
- **βοΈ Knowledge Miner** β Optionally scans your local `.md`/`.txt` notes and feeds them into the brain
|
|
23
|
+
- **π Fully Local** β Runs on Node.js alone: no Python, no Docker, no databases, no external services. Your memory never leaves your machine
|
|
24
|
+
- **πΎ File-Based** β All data stored as readable JSON files in `~/.crbro/` β inspectable, diffable, and versionable with git
|
|
25
|
+
- **π MCP Native** β Works with Claude Desktop, Claude Code, Cursor, Windsurf, and any MCP-compatible client
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
### 1. Initialize
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx crbro-memory init
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 2. Add to your MCP config
|
|
36
|
+
|
|
37
|
+
> **Register CRBRO at the user level, not per-project.** Your brain lives in
|
|
38
|
+
> `~/.crbro/` and is shared across every folder β but if you register the
|
|
39
|
+
> server inside a single project, other folders won't have the tools and it
|
|
40
|
+
> will *look* like the memory is gone. User-level registration makes it
|
|
41
|
+
> available everywhere, which is the whole point.
|
|
42
|
+
|
|
43
|
+
**Claude Code** (one command, available in every folder):
|
|
44
|
+
```bash
|
|
45
|
+
claude mcp add --scope user crbro -- npx -y crbro-memory
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Claude Desktop** (`~/AppData/Roaming/Claude/claude_desktop_config.json`):
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"mcpServers": {
|
|
52
|
+
"crbro": {
|
|
53
|
+
"command": "npx",
|
|
54
|
+
"args": ["-y", "crbro-memory"]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Cursor** (`~/.cursor/mcp.json` β the one in your home folder, not a project's `.cursor/`):
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"mcpServers": {
|
|
64
|
+
"crbro": {
|
|
65
|
+
"command": "npx",
|
|
66
|
+
"args": ["-y", "crbro-memory"]
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### 3. Start using it
|
|
73
|
+
|
|
74
|
+
Your AI will now have access to 16 memory tools. Start any session with `crbro_boot`.
|
|
75
|
+
|
|
76
|
+
## Tools
|
|
77
|
+
|
|
78
|
+
| Tool | Description |
|
|
79
|
+
|------|-------------|
|
|
80
|
+
| `crbro_boot` | Boot the brain at session start β loads hot topics and context |
|
|
81
|
+
| `crbro_status` | Brain status β neurons, synapses, sessions count |
|
|
82
|
+
| `crbro_learn` | Store a fact, decision, pattern, or preference |
|
|
83
|
+
| `crbro_neuron` | Read a specific neuron (topic) with all its knowledge |
|
|
84
|
+
| `crbro_neurons` | List neurons with optional filters (domain, type, heat) |
|
|
85
|
+
| `crbro_recall` | Search every stored fact, not just topic names β returns the fact that matched |
|
|
86
|
+
| `crbro_connect` | Create or strengthen a connection between neurons |
|
|
87
|
+
| `crbro_connections` | Get all connections for a neuron |
|
|
88
|
+
| `crbro_session_log` | Log a session summary |
|
|
89
|
+
| `crbro_sessions` | List recent sessions |
|
|
90
|
+
| `crbro_context` | Read/update active working context |
|
|
91
|
+
| `crbro_hot_topics` | Get the most active topics by heat score |
|
|
92
|
+
| `crbro_global_map` | View the neural network β clusters and cross-domain bridges |
|
|
93
|
+
| `crbro_revise` | Mark facts as superseded or retracted when they stop being true |
|
|
94
|
+
| `crbro_maintenance` | Brain maintenance β heat, pruning, integrity, index rebuild |
|
|
95
|
+
| `crbro_consolidate` | End-of-session consolidation |
|
|
96
|
+
|
|
97
|
+
## Architecture
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
~/.crbro/
|
|
101
|
+
βββ manifest.json β Brain metadata
|
|
102
|
+
βββ cortex/ β One JSON per neuron (topic)
|
|
103
|
+
β βββ project_octochat.json
|
|
104
|
+
β βββ tech_firebase.json
|
|
105
|
+
βββ synapses/ β One JSON per connection
|
|
106
|
+
β βββ syn_octochat__firebase.json
|
|
107
|
+
βββ hippocampus/ β One JSON per session
|
|
108
|
+
β βββ session_2026-05-06.json
|
|
109
|
+
βββ prefrontal/ β Working memory
|
|
110
|
+
β βββ active_context.json
|
|
111
|
+
β βββ hot_topics.json
|
|
112
|
+
β βββ global_map.json
|
|
113
|
+
βββ archives/ β Cold neurons (opt-in; nothing is archived unless you ask)
|
|
114
|
+
βββ .search/ β Orama search index
|
|
115
|
+
βββ chunks.index.json β one document per fact
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Heat Score Algorithm
|
|
119
|
+
|
|
120
|
+
Each neuron has a heat score (0.0 - 1.0) calculated from:
|
|
121
|
+
|
|
122
|
+
- **Frequency (35%)** β How often the neuron is accessed
|
|
123
|
+
- **Recency (40%)** β When it was last accessed (today = 1.0, >3 months = 0.05)
|
|
124
|
+
- **Connectivity (25%)** β How many synapses connect to it
|
|
125
|
+
|
|
126
|
+
## Knowledge Miner
|
|
127
|
+
|
|
128
|
+
The miner is an **optional, fully local** helper that scans a directory for `.md` and `.txt` files (notes, docs, journals) and extracts knowledge into the brain β so CRBRO can learn from what you already wrote, not just from conversations. It never touches the network and never leaves your machine.
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
npx crbro-memory mine [dir] # One-shot scan of a directory
|
|
132
|
+
npx crbro-memory setup-miner # Install a scheduled auto-scan (OS task scheduler)
|
|
133
|
+
npx crbro-memory miner-status # Check the auto-miner status
|
|
134
|
+
npx crbro-memory remove-miner # Remove the scheduled task
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
> Naming note: "miner" here means *knowledge* mining β extracting facts from your own text files. Nothing to do with cryptocurrency.
|
|
138
|
+
|
|
139
|
+
## CLI Commands
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
npx crbro-memory # Start MCP server (stdio)
|
|
143
|
+
npx crbro-memory init # Initialize brain + detect IDEs
|
|
144
|
+
npx crbro-memory status # Show brain status
|
|
145
|
+
npx crbro-memory reindex # Rebuild the search index
|
|
146
|
+
npx crbro-memory eval # Measure retrieval quality against your own query set
|
|
147
|
+
npx crbro-memory --help # Help
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Measuring retrieval
|
|
151
|
+
|
|
152
|
+
`eval` is there so you can tell a fix from a feeling. Write
|
|
153
|
+
`~/.crbro/.eval/queries.json` as a list of questions you would actually ask,
|
|
154
|
+
each naming the neuron that should answer it:
|
|
155
|
+
|
|
156
|
+
```json
|
|
157
|
+
[
|
|
158
|
+
{ "query": "how we deploy the api",
|
|
159
|
+
"expect_neuron": "project_octochat",
|
|
160
|
+
"expect_contains": "Cloud Run" }
|
|
161
|
+
]
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Then `npx crbro-memory eval` reports how often the right neuron comes back
|
|
165
|
+
first, how often it makes the top three, and MRR β plus every miss, so you can
|
|
166
|
+
see what it got wrong instead of guessing.
|
|
167
|
+
|
|
168
|
+
## License
|
|
169
|
+
|
|
170
|
+
MIT β see [LICENSE](LICENSE). Built by [Octonove](https://github.com/Octonove).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// βββ CRBRO CLI βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
4
4
|
// Command-line interface for CRBRO memory system
|
|
5
|
-
// Supports: init, status,
|
|
5
|
+
// Supports: init, status, mine, setup-miner, miner-status,
|
|
6
6
|
// remove-miner, and MCP server mode (default)
|
|
7
7
|
|
|
8
8
|
import { platform, homedir } from 'os';
|
|
@@ -132,9 +132,8 @@ if (command === 'init') {
|
|
|
132
132
|
console.log('');
|
|
133
133
|
console.log(' Next steps:');
|
|
134
134
|
console.log(' 1. Add the config above to your IDE\'s MCP settings');
|
|
135
|
-
console.log(' 2. npx crbro-memory
|
|
136
|
-
console.log(' 3.
|
|
137
|
-
console.log(' 4. Restart your IDE β CRBRO boots automatically!');
|
|
135
|
+
console.log(' 2. (Optional) npx crbro-memory setup-miner');
|
|
136
|
+
console.log(' 3. Restart your IDE β CRBRO boots automatically!');
|
|
138
137
|
console.log('');
|
|
139
138
|
}).catch(console.error);
|
|
140
139
|
|
|
@@ -154,7 +153,6 @@ if (command === 'init') {
|
|
|
154
153
|
console.log(` Sessions: ${manifest.total_sessions}`);
|
|
155
154
|
console.log(` Last Boot: ${manifest.last_boot || 'never'}`);
|
|
156
155
|
console.log(` Last Consolidate: ${manifest.last_consolidation || 'never'}`);
|
|
157
|
-
console.log(` License: ${manifest.license_key ? 'β
Active' : 'β Not activated'}`);
|
|
158
156
|
console.log('');
|
|
159
157
|
|
|
160
158
|
// Show detected IDEs
|
|
@@ -175,45 +173,11 @@ if (command === 'init') {
|
|
|
175
173
|
}).catch(console.error);
|
|
176
174
|
|
|
177
175
|
} else if (command === 'activate') {
|
|
178
|
-
// βββ
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
console.log('');
|
|
184
|
-
console.log(' Get your license key at https://synthetica-decks.web.app');
|
|
185
|
-
console.log('');
|
|
186
|
-
process.exit(1);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
import('../dist/engine/brain.js').then(async ({ Brain }) => {
|
|
190
|
-
const brain = new Brain();
|
|
191
|
-
try {
|
|
192
|
-
await brain.getManifest();
|
|
193
|
-
} catch {
|
|
194
|
-
console.log(' π§ Brain not initialized. Initializing now...');
|
|
195
|
-
await brain.initialize();
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
// Validate key format
|
|
199
|
-
if (!key.startsWith('SYNTH-ZERO-') || key.length < 20) {
|
|
200
|
-
console.log(' β Invalid license key format.');
|
|
201
|
-
console.log(' Keys start with SYNTH-ZERO- and are at least 20 characters.');
|
|
202
|
-
process.exit(1);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
// Persist key in manifest
|
|
206
|
-
await brain.updateManifest({ license_key: key });
|
|
207
|
-
console.log('');
|
|
208
|
-
console.log(' β
License key activated!');
|
|
209
|
-
console.log('');
|
|
210
|
-
console.log(' π Premium features unlocked:');
|
|
211
|
-
console.log(' β’ crbro_global_map β Neural cluster visualization');
|
|
212
|
-
console.log(' β’ crbro_maintenance β Automated brain optimization');
|
|
213
|
-
console.log('');
|
|
214
|
-
console.log(' Restart your IDE to apply changes.');
|
|
215
|
-
console.log('');
|
|
216
|
-
}).catch(console.error);
|
|
176
|
+
// βββ Legacy command (pre-1.4.0) β CRBRO is now fully free ββββββ
|
|
177
|
+
console.log('');
|
|
178
|
+
console.log(' β
Good news: since v1.4.0 CRBRO is fully free.');
|
|
179
|
+
console.log(' All 15 tools are available β no license key needed.');
|
|
180
|
+
console.log('');
|
|
217
181
|
|
|
218
182
|
} else if (command === 'mine') {
|
|
219
183
|
// βββ One-shot mining βββββββββββββββββββββββββββββββββββββββββββ
|
|
@@ -309,6 +273,111 @@ if (command === 'init') {
|
|
|
309
273
|
console.log('');
|
|
310
274
|
}).catch(console.error);
|
|
311
275
|
|
|
276
|
+
} else if (command === 'reindex') {
|
|
277
|
+
// βββ Rebuild the search index from the cortex ββββββββββββββββββ
|
|
278
|
+
Promise.all([
|
|
279
|
+
import('../dist/engine/brain.js'),
|
|
280
|
+
import('../dist/search/index.js'),
|
|
281
|
+
]).then(async ([{ Brain }, { SearchEngine }]) => {
|
|
282
|
+
const brain = new Brain();
|
|
283
|
+
const engine = new SearchEngine(brain);
|
|
284
|
+
|
|
285
|
+
console.log('');
|
|
286
|
+
console.log(' π Rebuilding the CRBRO search index...');
|
|
287
|
+
const started = Date.now();
|
|
288
|
+
const indexed = await engine.rebuild();
|
|
289
|
+
const seconds = ((Date.now() - started) / 1000).toFixed(1);
|
|
290
|
+
|
|
291
|
+
console.log('');
|
|
292
|
+
console.log(` β
${indexed} chunks indexed in ${seconds}s`);
|
|
293
|
+
console.log(' Every fact, decision and pattern is now searchable on its own,');
|
|
294
|
+
console.log(' so a big neuron is no longer buried by short ones.');
|
|
295
|
+
console.log('');
|
|
296
|
+
}).catch(console.error);
|
|
297
|
+
|
|
298
|
+
} else if (command === 'eval') {
|
|
299
|
+
// βββ Measure retrieval quality against a query set βββββββββββββ
|
|
300
|
+
//
|
|
301
|
+
// Without a number you cannot tell a fix from a feeling. The file is
|
|
302
|
+
// .crbro/.eval/queries.json β a list of { query, expect_neuron } and
|
|
303
|
+
// optionally expect_contains, the substring the matched fact should carry.
|
|
304
|
+
Promise.all([
|
|
305
|
+
import('../dist/engine/brain.js'),
|
|
306
|
+
import('../dist/search/index.js'),
|
|
307
|
+
import('fs/promises'),
|
|
308
|
+
]).then(async ([{ Brain }, { SearchEngine }, fsp]) => {
|
|
309
|
+
const brain = new Brain();
|
|
310
|
+
const evalPath = join(brain.paths.root, '.eval', 'queries.json');
|
|
311
|
+
|
|
312
|
+
let queries;
|
|
313
|
+
try {
|
|
314
|
+
queries = JSON.parse(await fsp.readFile(evalPath, 'utf-8'));
|
|
315
|
+
} catch {
|
|
316
|
+
console.log('');
|
|
317
|
+
console.log(` No query set found at ${evalPath}`);
|
|
318
|
+
console.log(' Create it as a JSON array, for example:');
|
|
319
|
+
console.log('');
|
|
320
|
+
console.log(' [');
|
|
321
|
+
console.log(' { "query": "how we deploy the api", "expect_neuron": "project_octochat",');
|
|
322
|
+
console.log(' "expect_contains": "Cloud Run" }');
|
|
323
|
+
console.log(' ]');
|
|
324
|
+
console.log('');
|
|
325
|
+
console.log(' Build it from facts you already saved: take six or eight words');
|
|
326
|
+
console.log(' out of a real fact and name the neuron that holds it.');
|
|
327
|
+
console.log('');
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
const engine = new SearchEngine(brain);
|
|
332
|
+
await engine.init();
|
|
333
|
+
|
|
334
|
+
let atOne = 0, atThree = 0, reciprocal = 0, contentOk = 0;
|
|
335
|
+
const misses = [];
|
|
336
|
+
|
|
337
|
+
for (const q of queries) {
|
|
338
|
+
const results = await engine.search(q.query, { limit: 10 });
|
|
339
|
+
const rank = results.findIndex(r => r.neuron_id === q.expect_neuron);
|
|
340
|
+
|
|
341
|
+
if (rank === 0) atOne++;
|
|
342
|
+
if (rank >= 0 && rank < 3) atThree++;
|
|
343
|
+
if (rank >= 0) reciprocal += 1 / (rank + 1);
|
|
344
|
+
|
|
345
|
+
if (rank === 0 && q.expect_contains) {
|
|
346
|
+
if (results[0].matching_content.includes(q.expect_contains)) contentOk++;
|
|
347
|
+
else misses.push(` ~ "${q.query}" β right neuron, wrong fact returned`);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
if (rank !== 0) {
|
|
351
|
+
const got = results[0] ? results[0].neuron_id : '(nothing)';
|
|
352
|
+
misses.push(` β "${q.query}" β expected ${q.expect_neuron}, got ${got}` +
|
|
353
|
+
(rank > 0 ? ` (it was #${rank + 1})` : ''));
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
const n = queries.length;
|
|
358
|
+
const pct = (x) => `${((x / n) * 100).toFixed(1)}%`;
|
|
359
|
+
|
|
360
|
+
console.log('');
|
|
361
|
+
console.log(' π CRBRO retrieval eval');
|
|
362
|
+
console.log(' βββββββββββββββββββββββ');
|
|
363
|
+
console.log(` Queries: ${n}`);
|
|
364
|
+
console.log(` Right first hit: ${atOne}/${n} (${pct(atOne)})`);
|
|
365
|
+
console.log(` In the top 3: ${atThree}/${n} (${pct(atThree)})`);
|
|
366
|
+
console.log(` MRR: ${(reciprocal / n).toFixed(3)}`);
|
|
367
|
+
if (queries.some(q => q.expect_contains)) {
|
|
368
|
+
const withContent = queries.filter(q => q.expect_contains).length;
|
|
369
|
+
console.log(` Right fact shown: ${contentOk}/${withContent}`);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
if (misses.length > 0) {
|
|
373
|
+
console.log('');
|
|
374
|
+
console.log(' Misses:');
|
|
375
|
+
for (const m of misses.slice(0, 25)) console.log(m);
|
|
376
|
+
if (misses.length > 25) console.log(` ... and ${misses.length - 25} more`);
|
|
377
|
+
}
|
|
378
|
+
console.log('');
|
|
379
|
+
}).catch(console.error);
|
|
380
|
+
|
|
312
381
|
} else if (command === '--help' || command === '-h') {
|
|
313
382
|
// βββ Help ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
314
383
|
console.log('');
|
|
@@ -316,8 +385,7 @@ if (command === 'init') {
|
|
|
316
385
|
console.log(' βββββββββββββββββββββββββββββββββββββββββββ');
|
|
317
386
|
console.log('');
|
|
318
387
|
console.log(' Setup:');
|
|
319
|
-
console.log(' npx crbro-memory init
|
|
320
|
-
console.log(' npx crbro-memory activate KEY Activate premium license');
|
|
388
|
+
console.log(' npx crbro-memory init Initialize brain + detect IDEs');
|
|
321
389
|
console.log(' npx crbro-memory status Show brain status');
|
|
322
390
|
console.log('');
|
|
323
391
|
console.log(' Auto-Mining:');
|
|
@@ -326,10 +394,14 @@ if (command === 'init') {
|
|
|
326
394
|
console.log(' npx crbro-memory miner-status Check auto-miner status');
|
|
327
395
|
console.log(' npx crbro-memory remove-miner Remove auto-miner');
|
|
328
396
|
console.log('');
|
|
397
|
+
console.log(' Search:');
|
|
398
|
+
console.log(' npx crbro-memory reindex Rebuild the search index');
|
|
399
|
+
console.log(' npx crbro-memory eval Measure retrieval against .crbro/.eval/queries.json');
|
|
400
|
+
console.log('');
|
|
329
401
|
console.log(' Server:');
|
|
330
402
|
console.log(' npx crbro-memory Start MCP server (stdio)');
|
|
331
403
|
console.log('');
|
|
332
|
-
console.log('
|
|
404
|
+
console.log(' Open source (MIT) β https://github.com/Octonove/crbro-memory');
|
|
333
405
|
console.log('');
|
|
334
406
|
|
|
335
407
|
} else {
|
package/dist/engine/brain.d.ts
CHANGED
|
@@ -16,7 +16,10 @@ export declare class BrainPaths {
|
|
|
16
16
|
activeContext(): string;
|
|
17
17
|
hotTopics(): string;
|
|
18
18
|
globalMap(): string;
|
|
19
|
+
/** Pre-v2 index. Kept only so the migration can delete it. */
|
|
19
20
|
searchIndex(): string;
|
|
21
|
+
/** Chunk-level index (v2+). Separate filename so an old index is never loaded. */
|
|
22
|
+
chunksIndex(): string;
|
|
20
23
|
}
|
|
21
24
|
export declare class Brain {
|
|
22
25
|
private manifest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brain.d.ts","sourceRoot":"","sources":["../../src/engine/brain.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAoC,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAQnH,qBAAa,UAAU;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ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E,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAEb,OAAO,CAAC,EAAE,MAAM;IAW5B,QAAQ,IAAI,MAAM;IAIlB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAI1B,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAI3B,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAI3B,aAAa,IAAI,MAAM;IAIvB,SAAS,IAAI,MAAM;IAInB,SAAS,IAAI,MAAM;IAInB,8DAA8D;IAC9D,WAAW,IAAI,MAAM;IAIrB,kFAAkF;IAClF,WAAW,IAAI,MAAM;CAGtB;AAID,qBAAa,KAAK;IAChB,OAAO,CAAC,QAAQ,CAAyB;IACzC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;gBAEf,OAAO,CAAC,EAAE,MAAM;IAI5B;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,QAAQ,CAAC;IAkDrC;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;IAgEjC;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,QAAQ,CAAC;IAUtC;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAO/D;;;;OAIG;IACG,aAAa,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;CA4CpD"}
|
package/dist/engine/brain.js
CHANGED
|
@@ -53,9 +53,14 @@ class BrainPaths {
|
|
|
53
53
|
globalMap() {
|
|
54
54
|
return node_path_1.default.join(this.prefrontal, 'global_map.json');
|
|
55
55
|
}
|
|
56
|
+
/** Pre-v2 index. Kept only so the migration can delete it. */
|
|
56
57
|
searchIndex() {
|
|
57
58
|
return node_path_1.default.join(this.search, 'orama.index.json');
|
|
58
59
|
}
|
|
60
|
+
/** Chunk-level index (v2+). Separate filename so an old index is never loaded. */
|
|
61
|
+
chunksIndex() {
|
|
62
|
+
return node_path_1.default.join(this.search, 'chunks.index.json');
|
|
63
|
+
}
|
|
59
64
|
}
|
|
60
65
|
exports.BrainPaths = BrainPaths;
|
|
61
66
|
// βββ Brain Manager βββββββββββββββββββββββββββββββββββββββββββββββ
|
|
@@ -94,7 +99,6 @@ class Brain {
|
|
|
94
99
|
total_sessions: 0,
|
|
95
100
|
last_boot: null,
|
|
96
101
|
last_consolidation: null,
|
|
97
|
-
license_key: null,
|
|
98
102
|
};
|
|
99
103
|
await (0, fs_js_1.writeJSON)(this.paths.manifest(), manifest);
|
|
100
104
|
this.manifest = manifest;
|
|
@@ -145,6 +149,11 @@ class Brain {
|
|
|
145
149
|
const activeContext = await (0, fs_js_1.readJSON)(this.paths.activeContext());
|
|
146
150
|
// Load active protocols
|
|
147
151
|
const activeProtocols = await this.loadProtocols();
|
|
152
|
+
// Pending items, split into what is open and what was just closed.
|
|
153
|
+
const openItems = (activeContext?.pending_tasks || []).map(t => typeof t === 'string'
|
|
154
|
+
? { id: '', text: t, added: '' }
|
|
155
|
+
: t);
|
|
156
|
+
const recentlyClosed = activeContext?.recently_closed || [];
|
|
148
157
|
// Update boot timestamp
|
|
149
158
|
this.manifest.last_boot = (0, fs_js_1.now)();
|
|
150
159
|
await (0, fs_js_1.writeJSON)(this.paths.manifest(), this.manifest);
|
|
@@ -157,7 +166,11 @@ class Brain {
|
|
|
157
166
|
last_session: activeContext?.last_session || null,
|
|
158
167
|
active_context: activeContext,
|
|
159
168
|
active_protocols: activeProtocols,
|
|
160
|
-
|
|
169
|
+
open_items: openItems,
|
|
170
|
+
recently_closed: recentlyClosed,
|
|
171
|
+
message: `CRBRO boot complete. ${this.manifest.total_neurons} neurons, ${this.manifest.total_synapses} synapses, ` +
|
|
172
|
+
`${this.manifest.total_sessions} sessions. ${activeProtocols.length} active protocol(s). ` +
|
|
173
|
+
`${openItems.length} open item(s), ${recentlyClosed.length} recently closed.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