crbro-memory 1.7.0 β 1.8.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 +260 -224
- package/bin/crbro.mjs +17 -3
- package/dist/engine/brain.d.ts.map +1 -1
- package/dist/engine/brain.js +4 -0
- package/dist/engine/brain.js.map +1 -1
- package/dist/engine/keychain.d.ts +32 -0
- package/dist/engine/keychain.d.ts.map +1 -0
- package/dist/engine/keychain.js +329 -0
- package/dist/engine/keychain.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +111 -7
- package/dist/server.js.map +1 -1
- package/package.json +53 -53
package/README.md
CHANGED
|
@@ -1,224 +1,260 @@
|
|
|
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
|
|
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
|
-
- **π Credential-aware** β API keys, tokens and passwords are replaced with a marker before they touch the disk. The sentence around them survives; the secret does not
|
|
22
|
-
- **π₯ Safe with two editors open** β Writes are serialised per neuron, so running CRBRO in two IDEs at once does not silently lose facts
|
|
23
|
-
- **π€ Shareable per project** β Put one project in a team space and it stays in step across everyone's machine. Everything else in your brain never leaves it
|
|
24
|
-
- **πΊοΈ Global Map** β Cluster detection and cross-domain bridge identification
|
|
25
|
-
- **βοΈ Knowledge Miner** β Optionally scans your local `.md`/`.txt` notes and feeds them into the brain
|
|
26
|
-
- **π Fully Local** β Runs on Node.js alone: no Python, no Docker, no databases, no external services. Your memory never leaves your machine
|
|
27
|
-
- **πΎ File-Based** β All data stored as readable JSON files in `~/.crbro/` β inspectable, diffable, and versionable with git
|
|
28
|
-
- **π MCP Native** β Works with Claude Desktop, Claude Code, Cursor, Windsurf, and any MCP-compatible client
|
|
29
|
-
|
|
30
|
-
## Quick Start
|
|
31
|
-
|
|
32
|
-
### 1. Initialize
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
npx crbro-memory init
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### 2. Add to your MCP config
|
|
39
|
-
|
|
40
|
-
> **Register CRBRO at the user level, not per-project.** Your brain lives in
|
|
41
|
-
> `~/.crbro/` and is shared across every folder β but if you register the
|
|
42
|
-
> server inside a single project, other folders won't have the tools and it
|
|
43
|
-
> will *look* like the memory is gone. User-level registration makes it
|
|
44
|
-
> available everywhere, which is the whole point.
|
|
45
|
-
|
|
46
|
-
**Claude Code** (one command, available in every folder):
|
|
47
|
-
```bash
|
|
48
|
-
claude mcp add --scope user crbro -- npx -y crbro-memory
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
**Claude Desktop** (`~/AppData/Roaming/Claude/claude_desktop_config.json`):
|
|
52
|
-
```json
|
|
53
|
-
{
|
|
54
|
-
"mcpServers": {
|
|
55
|
-
"crbro": {
|
|
56
|
-
"command": "npx",
|
|
57
|
-
"args": ["-y", "crbro-memory"]
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
**Cursor** (`~/.cursor/mcp.json` β the one in your home folder, not a project's `.cursor/`):
|
|
64
|
-
```json
|
|
65
|
-
{
|
|
66
|
-
"mcpServers": {
|
|
67
|
-
"crbro": {
|
|
68
|
-
"command": "npx",
|
|
69
|
-
"args": ["-y", "crbro-memory"]
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### 3. Start using it
|
|
76
|
-
|
|
77
|
-
Your AI will now have access to
|
|
78
|
-
|
|
79
|
-
## Tools
|
|
80
|
-
|
|
81
|
-
| Tool | Description |
|
|
82
|
-
|------|-------------|
|
|
83
|
-
| `crbro_boot` | Boot the brain at session start β loads hot topics and context |
|
|
84
|
-
| `crbro_status` | Brain status β neurons, synapses, sessions count |
|
|
85
|
-
| `crbro_learn` | Store a fact, decision, pattern, or preference |
|
|
86
|
-
| `crbro_neuron` | Read a specific neuron (topic) with all its knowledge |
|
|
87
|
-
| `crbro_neurons` | List neurons with optional filters (domain, type, heat) |
|
|
88
|
-
| `crbro_recall` | Search every stored fact, not just topic names β returns the fact that matched |
|
|
89
|
-
| `crbro_connect` | Create or strengthen a connection between neurons |
|
|
90
|
-
| `crbro_connections` | Get all connections for a neuron |
|
|
91
|
-
| `crbro_session_log` | Log a session summary |
|
|
92
|
-
| `crbro_sessions` | List recent sessions |
|
|
93
|
-
| `crbro_context` | Read/update active working context |
|
|
94
|
-
| `crbro_hot_topics` | Get the most active topics by heat score |
|
|
95
|
-
| `crbro_global_map` | View the neural network β clusters and cross-domain bridges |
|
|
96
|
-
| `crbro_revise` | Mark facts as superseded or retracted when they stop being true |
|
|
97
|
-
| `crbro_audit` | Find credentials stored in the brain β reports the kind, never the value |
|
|
98
|
-
| `crbro_forget` | Remove facts for good, keeping a copy in `.quarantine/` first |
|
|
99
|
-
| `
|
|
100
|
-
| `
|
|
101
|
-
| `
|
|
102
|
-
| `
|
|
103
|
-
| `
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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 22 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
|
+
- **π Credential-aware** β API keys, tokens and passwords are replaced with a marker before they touch the disk. The sentence around them survives; the secret does not β and `crbro_secret` puts the real value in your operating system's own keychain, so refusing it does not leave you with nowhere to put it
|
|
22
|
+
- **π₯ Safe with two editors open** β Writes are serialised per neuron, so running CRBRO in two IDEs at once does not silently lose facts
|
|
23
|
+
- **π€ Shareable per project** β Put one project in a team space and it stays in step across everyone's machine. Everything else in your brain never leaves it
|
|
24
|
+
- **πΊοΈ Global Map** β Cluster detection and cross-domain bridge identification
|
|
25
|
+
- **βοΈ Knowledge Miner** β Optionally scans your local `.md`/`.txt` notes and feeds them into the brain
|
|
26
|
+
- **π Fully Local** β Runs on Node.js alone: no Python, no Docker, no databases, no external services. Your memory never leaves your machine
|
|
27
|
+
- **πΎ File-Based** β All data stored as readable JSON files in `~/.crbro/` β inspectable, diffable, and versionable with git
|
|
28
|
+
- **π MCP Native** β Works with Claude Desktop, Claude Code, Cursor, Windsurf, and any MCP-compatible client
|
|
29
|
+
|
|
30
|
+
## Quick Start
|
|
31
|
+
|
|
32
|
+
### 1. Initialize
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npx crbro-memory init
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 2. Add to your MCP config
|
|
39
|
+
|
|
40
|
+
> **Register CRBRO at the user level, not per-project.** Your brain lives in
|
|
41
|
+
> `~/.crbro/` and is shared across every folder β but if you register the
|
|
42
|
+
> server inside a single project, other folders won't have the tools and it
|
|
43
|
+
> will *look* like the memory is gone. User-level registration makes it
|
|
44
|
+
> available everywhere, which is the whole point.
|
|
45
|
+
|
|
46
|
+
**Claude Code** (one command, available in every folder):
|
|
47
|
+
```bash
|
|
48
|
+
claude mcp add --scope user crbro -- npx -y crbro-memory
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Claude Desktop** (`~/AppData/Roaming/Claude/claude_desktop_config.json`):
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"mcpServers": {
|
|
55
|
+
"crbro": {
|
|
56
|
+
"command": "npx",
|
|
57
|
+
"args": ["-y", "crbro-memory"]
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Cursor** (`~/.cursor/mcp.json` β the one in your home folder, not a project's `.cursor/`):
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"mcpServers": {
|
|
67
|
+
"crbro": {
|
|
68
|
+
"command": "npx",
|
|
69
|
+
"args": ["-y", "crbro-memory"]
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 3. Start using it
|
|
76
|
+
|
|
77
|
+
Your AI will now have access to 22 memory tools. Start any session with `crbro_boot`.
|
|
78
|
+
|
|
79
|
+
## Tools
|
|
80
|
+
|
|
81
|
+
| Tool | Description |
|
|
82
|
+
|------|-------------|
|
|
83
|
+
| `crbro_boot` | Boot the brain at session start β loads hot topics and context |
|
|
84
|
+
| `crbro_status` | Brain status β neurons, synapses, sessions count |
|
|
85
|
+
| `crbro_learn` | Store a fact, decision, pattern, or preference |
|
|
86
|
+
| `crbro_neuron` | Read a specific neuron (topic) with all its knowledge |
|
|
87
|
+
| `crbro_neurons` | List neurons with optional filters (domain, type, heat) |
|
|
88
|
+
| `crbro_recall` | Search every stored fact, not just topic names β returns the fact that matched |
|
|
89
|
+
| `crbro_connect` | Create or strengthen a connection between neurons |
|
|
90
|
+
| `crbro_connections` | Get all connections for a neuron |
|
|
91
|
+
| `crbro_session_log` | Log a session summary |
|
|
92
|
+
| `crbro_sessions` | List recent sessions |
|
|
93
|
+
| `crbro_context` | Read/update active working context |
|
|
94
|
+
| `crbro_hot_topics` | Get the most active topics by heat score |
|
|
95
|
+
| `crbro_global_map` | View the neural network β clusters and cross-domain bridges |
|
|
96
|
+
| `crbro_revise` | Mark facts as superseded or retracted when they stop being true |
|
|
97
|
+
| `crbro_audit` | Find credentials stored in the brain β reports the kind, never the value |
|
|
98
|
+
| `crbro_forget` | Remove facts for good, keeping a copy in `.quarantine/` first |
|
|
99
|
+
| `crbro_secret` | Put a credential in the OS keychain and keep only its name in the brain |
|
|
100
|
+
| `crbro_space` | Create or join a team space β a private git repo for shared projects |
|
|
101
|
+
| `crbro_share` | Put one project into a space, after showing exactly what would be sent |
|
|
102
|
+
| `crbro_sync` | Exchange notes with teammates now, instead of waiting for the next session |
|
|
103
|
+
| `crbro_maintenance` | Brain maintenance β heat, pruning, integrity, index rebuild |
|
|
104
|
+
| `crbro_consolidate` | End-of-session consolidation |
|
|
105
|
+
|
|
106
|
+
## Credentials
|
|
107
|
+
|
|
108
|
+
A memory should not hold your passwords, and CRBRO refuses to: anything shaped
|
|
109
|
+
like a credential is replaced with a marker before it reaches the disk. But
|
|
110
|
+
refusing on its own is not much help β the password still exists, and it ends
|
|
111
|
+
up back in a config file in plain text.
|
|
112
|
+
|
|
113
|
+
So `crbro_secret` gives it somewhere to go: the credential store your machine
|
|
114
|
+
already ships with.
|
|
115
|
+
|
|
116
|
+
| Platform | Where the value actually lives |
|
|
117
|
+
|----------|--------------------------------|
|
|
118
|
+
| macOS | Keychain, via `security` |
|
|
119
|
+
| Linux | Secret Service, via `secret-tool` |
|
|
120
|
+
| Windows | Sealed with DPAPI to your Windows account |
|
|
121
|
+
|
|
122
|
+
On a machine with no credential store β a headless server, a CI runner, a
|
|
123
|
+
locked keychain over SSH β `crbro_secret` says so in plain words instead of
|
|
124
|
+
failing. Environment variables keep working, and the rest of CRBRO is
|
|
125
|
+
unaffected.
|
|
126
|
+
|
|
127
|
+
CRBRO keeps no copy and writes no crypto of its own. The store sits **outside
|
|
128
|
+
the brain**, so no sync, no team space and no `crbro_share` can reach it. What
|
|
129
|
+
goes in the brain is the *name*:
|
|
130
|
+
|
|
131
|
+
> "The WordPress password for example.com is in `WP_EXAMPLE_APP_PASSWORD`."
|
|
132
|
+
|
|
133
|
+
Which is all an assistant needs to find it again next week, and useless to
|
|
134
|
+
anyone who reads your memory files.
|
|
135
|
+
|
|
136
|
+
An environment variable of the same name always wins, so CI and one-off
|
|
137
|
+
overrides work without touching the keychain. On a headless box with no
|
|
138
|
+
credential store, `crbro_secret` says so plainly instead of failing β the
|
|
139
|
+
environment variables still work, and the rest of CRBRO is unaffected.
|
|
140
|
+
|
|
141
|
+
## Team memory
|
|
142
|
+
|
|
143
|
+
Two people working on the same thing shouldn't have to tell their assistants
|
|
144
|
+
the same things twice. A **space** is one or more projects shared with
|
|
145
|
+
teammates, carried by a private git repository you own β no server, no account,
|
|
146
|
+
nothing to pay for.
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
# One person, once:
|
|
150
|
+
crbro_space action: create name: "team" remote: git@github.com:acme/team-memory.git author: "ana"
|
|
151
|
+
crbro_share neuron: "project_x" space: "team"
|
|
152
|
+
|
|
153
|
+
# Everyone else, once:
|
|
154
|
+
crbro_space action: join name: "team" remote: git@github.com:acme/team-memory.git author: "bruno"
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
After that it is invisible: notes are exchanged at the start and end of every
|
|
158
|
+
session. What each person learns about that project, the others' assistants
|
|
159
|
+
know next time they sit down.
|
|
160
|
+
|
|
161
|
+
**How it stays out of your way**
|
|
162
|
+
|
|
163
|
+
- Nobody ever writes to anybody else's file. Each person appends to their own
|
|
164
|
+
log and every machine rebuilds the project from all of them, so there is no
|
|
165
|
+
conflict to resolve β not now, not after a week apart.
|
|
166
|
+
- If someone marks a fact as no longer true, that wins. Retracted knowledge
|
|
167
|
+
cannot come back to life because a stale copy still called it current.
|
|
168
|
+
- No connection is a normal answer, not an error. Your memory works offline and
|
|
169
|
+
whatever you saved goes out on the next sync.
|
|
170
|
+
|
|
171
|
+
**What never leaves your machine**
|
|
172
|
+
|
|
173
|
+
- Every project you did not explicitly share.
|
|
174
|
+
- Preferences β not shareable at all, at any setting. They are the field most
|
|
175
|
+
likely to hold a key.
|
|
176
|
+
- Credentials. `crbro_share` refuses outright if it finds one, and tells you
|
|
177
|
+
where. It will not redact it and send the rest.
|
|
178
|
+
|
|
179
|
+
> **Sharing cannot be undone.** Once a teammate has pulled a project it is on
|
|
180
|
+
> their disk. Removing their repository access stops anything new from reaching
|
|
181
|
+
> them; it does not take back what they already have. That is true of any
|
|
182
|
+
> sync system β worth knowing before you share, not after.
|
|
183
|
+
|
|
184
|
+
## Architecture
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
~/.crbro/
|
|
188
|
+
βββ manifest.json β Brain metadata
|
|
189
|
+
βββ cortex/ β One JSON per neuron (topic)
|
|
190
|
+
β βββ project_octochat.json
|
|
191
|
+
β βββ tech_firebase.json
|
|
192
|
+
βββ synapses/ β One JSON per connection
|
|
193
|
+
β βββ syn_octochat__firebase.json
|
|
194
|
+
βββ hippocampus/ β One JSON per session
|
|
195
|
+
β βββ session_2026-05-06.json
|
|
196
|
+
βββ prefrontal/ β Working memory
|
|
197
|
+
β βββ active_context.json
|
|
198
|
+
β βββ hot_topics.json
|
|
199
|
+
β βββ global_map.json
|
|
200
|
+
βββ archives/ β Cold neurons (opt-in; nothing is archived unless you ask)
|
|
201
|
+
βββ shared/ β One git repo per team space. Notes only, never the cortex
|
|
202
|
+
β βββ team/
|
|
203
|
+
β βββ neurons/project_x/ops/ana.a1b2c3.jsonl
|
|
204
|
+
βββ .search/ β Orama search index
|
|
205
|
+
βββ chunks.index.json β one document per fact
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Heat Score Algorithm
|
|
209
|
+
|
|
210
|
+
Each neuron has a heat score (0.0 - 1.0) calculated from:
|
|
211
|
+
|
|
212
|
+
- **Frequency (35%)** β How often the neuron is accessed
|
|
213
|
+
- **Recency (40%)** β When it was last accessed (today = 1.0, >3 months = 0.05)
|
|
214
|
+
- **Connectivity (25%)** β How many synapses connect to it
|
|
215
|
+
|
|
216
|
+
## Knowledge Miner
|
|
217
|
+
|
|
218
|
+
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.
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
npx crbro-memory mine [dir] # One-shot scan of a directory
|
|
222
|
+
npx crbro-memory setup-miner # Install a scheduled auto-scan (OS task scheduler)
|
|
223
|
+
npx crbro-memory miner-status # Check the auto-miner status
|
|
224
|
+
npx crbro-memory remove-miner # Remove the scheduled task
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
> Naming note: "miner" here means *knowledge* mining β extracting facts from your own text files. Nothing to do with cryptocurrency.
|
|
228
|
+
|
|
229
|
+
## CLI Commands
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
npx crbro-memory # Start MCP server (stdio)
|
|
233
|
+
npx crbro-memory init # Initialize brain + detect IDEs
|
|
234
|
+
npx crbro-memory status # Show brain status
|
|
235
|
+
npx crbro-memory reindex # Rebuild the search index
|
|
236
|
+
npx crbro-memory eval # Measure retrieval quality against your own query set
|
|
237
|
+
npx crbro-memory --help # Help
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Measuring retrieval
|
|
241
|
+
|
|
242
|
+
`eval` is there so you can tell a fix from a feeling. Write
|
|
243
|
+
`~/.crbro/.eval/queries.json` as a list of questions you would actually ask,
|
|
244
|
+
each naming the neuron that should answer it:
|
|
245
|
+
|
|
246
|
+
```json
|
|
247
|
+
[
|
|
248
|
+
{ "query": "how we deploy the api",
|
|
249
|
+
"expect_neuron": "project_octochat",
|
|
250
|
+
"expect_contains": "Cloud Run" }
|
|
251
|
+
]
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Then `npx crbro-memory eval` reports how often the right neuron comes back
|
|
255
|
+
first, how often it makes the top three, and MRR β plus every miss, so you can
|
|
256
|
+
see what it got wrong instead of guessing.
|
|
257
|
+
|
|
258
|
+
## License
|
|
259
|
+
|
|
260
|
+
MIT β see [LICENSE](LICENSE). Built by [Octonove](https://github.com/Octonove).
|
package/bin/crbro.mjs
CHANGED
|
@@ -6,8 +6,21 @@
|
|
|
6
6
|
// remove-miner, and MCP server mode (default)
|
|
7
7
|
|
|
8
8
|
import { platform, homedir } from 'os';
|
|
9
|
-
import { join } from 'path';
|
|
10
|
-
import { existsSync } from 'fs';
|
|
9
|
+
import { join, dirname } from 'path';
|
|
10
|
+
import { existsSync, readFileSync } from 'fs';
|
|
11
|
+
import { fileURLToPath } from 'url';
|
|
12
|
+
|
|
13
|
+
// The release that is running, read from the package itself. The manifest
|
|
14
|
+
// version stamps the brain format and has not moved since 1.0.0, so showing
|
|
15
|
+
// only that one told everyone they were on 1.0.0 forever.
|
|
16
|
+
function pkgVersion() {
|
|
17
|
+
try {
|
|
18
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
19
|
+
return JSON.parse(readFileSync(join(here, '..', 'package.json'), 'utf8')).version;
|
|
20
|
+
} catch {
|
|
21
|
+
return 'unknown';
|
|
22
|
+
}
|
|
23
|
+
}
|
|
11
24
|
|
|
12
25
|
const args = process.argv.slice(2);
|
|
13
26
|
const command = args[0];
|
|
@@ -146,7 +159,8 @@ if (command === 'init') {
|
|
|
146
159
|
console.log('');
|
|
147
160
|
console.log(' π§ CRBRO Brain Status');
|
|
148
161
|
console.log(' βββββββββββββββββββββ');
|
|
149
|
-
console.log(`
|
|
162
|
+
console.log(` CRBRO: ${pkgVersion()}`);
|
|
163
|
+
console.log(` Brain format: ${manifest.version}`);
|
|
150
164
|
console.log(` Path: ${manifest.brain_path}`);
|
|
151
165
|
console.log(` Neurons: ${manifest.total_neurons}`);
|
|
152
166
|
console.log(` Synapses: ${manifest.total_synapses}`);
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"brain.d.ts","sourceRoot":"","sources":["../../src/engine/brain.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAA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,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
|
@@ -11,6 +11,10 @@ const node_fs_1 = require("node:fs");
|
|
|
11
11
|
const fs_js_1 = require("../utils/fs.js");
|
|
12
12
|
const CRBRO_DIR = process.env['CRBRO_PATH'] || node_path_1.default.join(process.env['HOME'] || process.env['USERPROFILE'] || '.', '.crbro');
|
|
13
13
|
const MANIFEST_FILE = 'manifest.json';
|
|
14
|
+
// The brain FORMAT, not the release. It moves only when the on-disk layout
|
|
15
|
+
// changes in a way that needs a migration, which is why it has stayed at 1.0.0
|
|
16
|
+
// while the package went to 1.8. The running version is reported separately by
|
|
17
|
+
// crbro_status.
|
|
14
18
|
const CRBRO_VERSION = '1.0.0';
|
|
15
19
|
// βββ Paths βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
16
20
|
class BrainPaths {
|
package/dist/engine/brain.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brain.js","sourceRoot":"","sources":["../../src/engine/brain.ts"],"names":[],"mappings":";AAAA,oEAAoE;AACpE,gEAAgE;;;;;;AAEhE,0DAA6B;AAC7B,qCAAyC;AACzC,0CAAsE;AAGtE,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,mBAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,GAAG,EAAE,QAAQ,CAAC,CAAC;AAC7H,MAAM,aAAa,GAAG,eAAe,CAAC;AACtC,MAAM,aAAa,GAAG,OAAO,CAAC;AAE9B,oEAAoE;AAEpE,MAAa,UAAU;IACZ,IAAI,CAAS;IACb,MAAM,CAAS;IACf,QAAQ,CAAS;IACjB,WAAW,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IAAI,CAAC,MAAM,CAAC,CAAC;gBAEhB,IAAI,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC;oBACxB,SAAS,CAAC,IAAI,CAAC;wBACb,EAAE,EAAE,MAAM,CAAC,EAAE;wBACb,IAAI,EAAE,MAAM,CAAC,IAAI;wBACjB,QAAQ;wBACR,YAAY;wBACZ,MAAM;qBACP,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,8CAA8C;QAChD,CAAC;QAED,mCAAmC;QACnC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;QAClD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA5MD,sBA4MC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type Backend = 'macos-keychain' | 'linux-secret-service' | 'windows-dpapi';
|
|
2
|
+
export interface SecretEntry {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
updated: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class KeychainUnavailable extends Error {
|
|
8
|
+
readonly reason: string;
|
|
9
|
+
constructor(reason: string);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Which store this machine can actually use β not which one it should have.
|
|
13
|
+
* Returns null with a reason the caller can show the user, because "no
|
|
14
|
+
* keychain here" is a normal answer on a headless box, not a failure.
|
|
15
|
+
*/
|
|
16
|
+
export declare function detectBackend(): {
|
|
17
|
+
backend: Backend | null;
|
|
18
|
+
reason?: string;
|
|
19
|
+
};
|
|
20
|
+
export declare function setSecret(name: string, value: string, description?: string): void;
|
|
21
|
+
/**
|
|
22
|
+
* The value, or null when there is no such secret. An environment variable of
|
|
23
|
+
* the same name wins, which is what makes CI and one-off overrides work
|
|
24
|
+
* without touching the store.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getSecret(name: string): string | null;
|
|
27
|
+
/** Names and descriptions only. Values are never returned by design. */
|
|
28
|
+
export declare function listSecrets(): SecretEntry[];
|
|
29
|
+
export declare function removeSecret(name: string): boolean;
|
|
30
|
+
/** Windows only, and only for tests: forget the sealed file entirely. */
|
|
31
|
+
export declare function _resetWindowsStoreForTests(): void;
|
|
32
|
+
//# sourceMappingURL=keychain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keychain.d.ts","sourceRoot":"","sources":["../../src/engine/keychain.ts"],"names":[],"mappings":"AA8CA,MAAM,MAAM,OAAO,GAAG,gBAAgB,GAAG,sBAAsB,GAAG,eAAe,CAAC;AAElF,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,mBAAoB,SAAQ,KAAK;aAChB,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM;CAI3C;AAYD;;;;GAIG;AACH,wBAAgB,aAAa,IAAI;IAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAgC5E;AAmID,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,SAAK,GAAG,IAAI,CAkC7E;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAkCrD;AAED,wEAAwE;AACxE,wBAAgB,WAAW,IAAI,WAAW,EAAE,CAmB3C;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAsBlD;AAED,yEAAyE;AACzE,wBAAgB,0BAA0B,IAAI,IAAI,CAIjD"}
|