crbro-memory 1.14.0 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -13
- package/bin/crbro.mjs +621 -578
- package/dist/engine/cortex.d.ts +8 -0
- package/dist/engine/cortex.d.ts.map +1 -1
- package/dist/engine/cortex.js +33 -2
- package/dist/engine/cortex.js.map +1 -1
- package/dist/search/index.d.ts +16 -1
- package/dist/search/index.d.ts.map +1 -1
- package/dist/search/index.js +78 -7
- package/dist/search/index.js.map +1 -1
- package/dist/search/semantic.d.ts +21 -3
- package/dist/search/semantic.d.ts.map +1 -1
- package/dist/search/semantic.js +68 -27
- package/dist/search/semantic.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +20 -4
- package/dist/server.js.map +1 -1
- package/dist/sync/materialize.d.ts.map +1 -1
- package/dist/sync/materialize.js +4 -0
- package/dist/sync/materialize.js.map +1 -1
- package/dist/sync/ops.d.ts +2 -0
- package/dist/sync/ops.d.ts.map +1 -1
- package/dist/sync/ops.js.map +1 -1
- package/dist/sync/space.d.ts.map +1 -1
- package/dist/sync/space.js +4 -2
- package/dist/sync/space.js.map +1 -1
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +56 -54
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The default model, and the one the benchmarks measure. CRBRO_SEMANTIC_MODEL
|
|
3
|
+
* swaps in another transformers.js feature-extraction model of the e5 family
|
|
4
|
+
* (same "query: " / "passage: " prefixes, mean pooling). The vector width is
|
|
5
|
+
* read from the model's first output; stored vectors of a different model are
|
|
6
|
+
* ignored, never mixed.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SEMANTIC_MODEL_DEFAULT = "Xenova/multilingual-e5-small";
|
|
9
|
+
export declare const SEMANTIC_DTYPE_DEFAULT = "q8";
|
|
10
|
+
export declare function semanticModel(): string;
|
|
11
|
+
export declare function semanticDtype(): string;
|
|
12
|
+
/** Off when CRBRO_SEMANTIC says so, forced on when it says so, else on exactly when the runtime is installed. */
|
|
4
13
|
export declare function semanticEnabled(): boolean;
|
|
14
|
+
export type SemanticMode = 'auto' | 'forced' | 'disabled';
|
|
15
|
+
export declare function semanticMode(): SemanticMode;
|
|
5
16
|
/** Where the runtime and the model cache live. Machine-level, not brain-level. */
|
|
6
17
|
export declare function semanticHome(): string;
|
|
7
18
|
/** Resolve the transformers.js entry point inside the semantic home, or null. */
|
|
@@ -9,6 +20,8 @@ export declare function resolveRuntime(): string | null;
|
|
|
9
20
|
export declare function semanticStatus(): {
|
|
10
21
|
installed: boolean;
|
|
11
22
|
enabled: boolean;
|
|
23
|
+
mode: SemanticMode;
|
|
24
|
+
model_downloaded: boolean;
|
|
12
25
|
home: string;
|
|
13
26
|
model: string;
|
|
14
27
|
};
|
|
@@ -20,6 +33,8 @@ export interface SemanticHit {
|
|
|
20
33
|
export declare class SemanticIndex {
|
|
21
34
|
private dir;
|
|
22
35
|
private ids;
|
|
36
|
+
/** Vector width, read from the first embedding (384 for e5-small). */
|
|
37
|
+
private dim;
|
|
23
38
|
private pos;
|
|
24
39
|
private vectors;
|
|
25
40
|
private extractor;
|
|
@@ -27,6 +42,8 @@ export declare class SemanticIndex {
|
|
|
27
42
|
private dirty;
|
|
28
43
|
/** Set once the runtime or the model failed to load: never retried in-process. */
|
|
29
44
|
private broken;
|
|
45
|
+
/** Upserts run one at a time: two overlapping ones would both extend the same array. */
|
|
46
|
+
private queue;
|
|
30
47
|
constructor(dir: string);
|
|
31
48
|
private metaPath;
|
|
32
49
|
private dataPath;
|
|
@@ -54,6 +71,7 @@ export declare class SemanticIndex {
|
|
|
54
71
|
id: string;
|
|
55
72
|
text: string;
|
|
56
73
|
}>): Promise<number>;
|
|
74
|
+
private upsertNow;
|
|
57
75
|
/** Drop vectors for ids that left the index. */
|
|
58
76
|
remove(ids: Iterable<string>): number;
|
|
59
77
|
/** The k nearest chunks to the question, by cosine. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic.d.ts","sourceRoot":"","sources":["../../src/search/semantic.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"semantic.d.ts","sourceRoot":"","sources":["../../src/search/semantic.ts"],"names":[],"mappings":"AAoCA;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,iCAAiC,CAAC;AACrE,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,wBAAgB,aAAa,IAAI,MAAM,CAAuE;AAC9G,wBAAgB,aAAa,IAAI,MAAM,CAAuE;AAQ9G,iHAAiH;AACjH,wBAAgB,eAAe,IAAI,OAAO,CAKzC;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE1D,wBAAgB,YAAY,IAAI,YAAY,CAK3C;AAED,kFAAkF;AAClF,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,iFAAiF;AACjF,wBAAgB,cAAc,IAAI,MAAM,GAAG,IAAI,CAO9C;AAED,wBAAgB,cAAc,IAAI;IAChC,SAAS,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,YAAY,CAAC;IAAC,gBAAgB,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;CAClH,CASA;AASD,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,aAAa;IAcZ,OAAO,CAAC,GAAG;IAbvB,OAAO,CAAC,GAAG,CAAgB;IAC3B,sEAAsE;IACtE,OAAO,CAAC,GAAG,CAAK;IAChB,OAAO,CAAC,GAAG,CAA6B;IACxC,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,KAAK,CAAS;IACtB,kFAAkF;IAClF,OAAO,CAAC,MAAM,CAAuB;IACrC,wFAAwF;IACxF,OAAO,CAAC,KAAK,CAAuC;gBAEhC,GAAG,EAAE,MAAM;IAE/B,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,QAAQ;IAEhB,KAAK,IAAI,MAAM;IACf,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IACxB,KAAK,IAAI,OAAO;IAChB,MAAM,IAAI,MAAM,GAAG,IAAI;IAEvB;;;;OAIG;IACH,IAAI,IAAI,IAAI;IAKZ,qDAAqD;IAC/C,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAgBrB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAa9B,2EAA2E;YAC7D,KAAK;YA0BL,KAAK;IAmBnB;;;OAGG;IACG,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;YAM7D,SAAS;IAqBvB,gDAAgD;IAChD,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM;IAoBrC,uDAAuD;IACjD,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;CAa7D"}
|
package/dist/search/semantic.js
CHANGED
|
@@ -7,16 +7,16 @@
|
|
|
7
7
|
// fact about Wordfence, "proveedor de email" for one about Mailchimp. No
|
|
8
8
|
// table closes those; an embedding model does.
|
|
9
9
|
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
10
|
+
// Costs, measured: the model is a 118 MB download (Xenova/multilingual-e5-small,
|
|
11
|
+
// int8), the runtime (transformers.js + onnxruntime) ~380 MB of node modules,
|
|
12
|
+
// the loaded model ~0.5 GB of RAM, a cold load ~13 s per process, and a first
|
|
13
|
+
// pass over the reference brain (5,129 chunks, 3,984 lines) three minutes.
|
|
14
|
+
// Until 1.15 that made it opt-in. Since 1.16 `npx crbro-memory init` installs
|
|
15
|
+
// it by default (the author's call: the best recall out of the box) and the
|
|
16
|
+
// layer is ON whenever the runtime is present. `init --no-semantic` skips the
|
|
17
|
+
// install; CRBRO_SEMANTIC=0 turns it off; CRBRO_SEMANTIC=1 forces it on.
|
|
18
|
+
// Without the runtime this file is dead code and recall is exactly the
|
|
19
|
+
// keyword engine.
|
|
20
20
|
//
|
|
21
21
|
// Design:
|
|
22
22
|
// - The runtime lives in ONE machine-level home (~/.crbro/.semantic), not
|
|
@@ -32,8 +32,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
32
32
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.SemanticIndex = exports.
|
|
35
|
+
exports.SemanticIndex = exports.SEMANTIC_DTYPE_DEFAULT = exports.SEMANTIC_MODEL_DEFAULT = void 0;
|
|
36
|
+
exports.semanticModel = semanticModel;
|
|
37
|
+
exports.semanticDtype = semanticDtype;
|
|
36
38
|
exports.semanticEnabled = semanticEnabled;
|
|
39
|
+
exports.semanticMode = semanticMode;
|
|
37
40
|
exports.semanticHome = semanticHome;
|
|
38
41
|
exports.resolveRuntime = resolveRuntime;
|
|
39
42
|
exports.semanticStatus = semanticStatus;
|
|
@@ -42,18 +45,39 @@ const node_url_1 = require("node:url");
|
|
|
42
45
|
const node_fs_1 = require("node:fs");
|
|
43
46
|
const node_path_1 = __importDefault(require("node:path"));
|
|
44
47
|
const node_os_1 = __importDefault(require("node:os"));
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
/**
|
|
49
|
+
* The default model, and the one the benchmarks measure. CRBRO_SEMANTIC_MODEL
|
|
50
|
+
* swaps in another transformers.js feature-extraction model of the e5 family
|
|
51
|
+
* (same "query: " / "passage: " prefixes, mean pooling). The vector width is
|
|
52
|
+
* read from the model's first output; stored vectors of a different model are
|
|
53
|
+
* ignored, never mixed.
|
|
54
|
+
*/
|
|
55
|
+
exports.SEMANTIC_MODEL_DEFAULT = 'Xenova/multilingual-e5-small';
|
|
56
|
+
exports.SEMANTIC_DTYPE_DEFAULT = 'q8';
|
|
57
|
+
function semanticModel() { return process.env.CRBRO_SEMANTIC_MODEL || exports.SEMANTIC_MODEL_DEFAULT; }
|
|
58
|
+
function semanticDtype() { return process.env.CRBRO_SEMANTIC_DTYPE || exports.SEMANTIC_DTYPE_DEFAULT; }
|
|
48
59
|
const BATCH = 16;
|
|
49
60
|
/** e5 models are trained with these prefixes; without them quality drops. */
|
|
50
61
|
const QUERY_PREFIX = 'query: ';
|
|
51
62
|
const PASSAGE_PREFIX = 'passage: ';
|
|
52
63
|
/** Longer passages are truncated by the tokenizer anyway; cap the work. */
|
|
53
64
|
const MAX_CHARS = 2000;
|
|
65
|
+
/** Off when CRBRO_SEMANTIC says so, forced on when it says so, else on exactly when the runtime is installed. */
|
|
54
66
|
function semanticEnabled() {
|
|
67
|
+
const mode = semanticMode();
|
|
68
|
+
if (mode === 'disabled')
|
|
69
|
+
return false;
|
|
70
|
+
if (mode === 'forced')
|
|
71
|
+
return true;
|
|
72
|
+
return resolveRuntime() !== null;
|
|
73
|
+
}
|
|
74
|
+
function semanticMode() {
|
|
55
75
|
const v = (process.env.CRBRO_SEMANTIC || '').toLowerCase();
|
|
56
|
-
|
|
76
|
+
if (v === '0' || v === 'off' || v === 'false')
|
|
77
|
+
return 'disabled';
|
|
78
|
+
if (v === '1' || v === 'on' || v === 'true')
|
|
79
|
+
return 'forced';
|
|
80
|
+
return 'auto';
|
|
57
81
|
}
|
|
58
82
|
/** Where the runtime and the model cache live. Machine-level, not brain-level. */
|
|
59
83
|
function semanticHome() {
|
|
@@ -73,13 +97,17 @@ function semanticStatus() {
|
|
|
73
97
|
return {
|
|
74
98
|
installed: resolveRuntime() !== null,
|
|
75
99
|
enabled: semanticEnabled(),
|
|
100
|
+
mode: semanticMode(),
|
|
101
|
+
model_downloaded: (0, node_fs_1.existsSync)(node_path_1.default.join(semanticHome(), 'models', ...semanticModel().split('/'))),
|
|
76
102
|
home: semanticHome(),
|
|
77
|
-
model: `${
|
|
103
|
+
model: `${semanticModel()} (${semanticDtype()})`,
|
|
78
104
|
};
|
|
79
105
|
}
|
|
80
106
|
class SemanticIndex {
|
|
81
107
|
dir;
|
|
82
108
|
ids = [];
|
|
109
|
+
/** Vector width, read from the first embedding (384 for e5-small). */
|
|
110
|
+
dim = 0;
|
|
83
111
|
pos = new Map();
|
|
84
112
|
vectors = new Float32Array(0);
|
|
85
113
|
extractor = null;
|
|
@@ -87,6 +115,8 @@ class SemanticIndex {
|
|
|
87
115
|
dirty = false;
|
|
88
116
|
/** Set once the runtime or the model failed to load: never retried in-process. */
|
|
89
117
|
broken = null;
|
|
118
|
+
/** Upserts run one at a time: two overlapping ones would both extend the same array. */
|
|
119
|
+
queue = Promise.resolve();
|
|
90
120
|
constructor(dir) {
|
|
91
121
|
this.dir = dir;
|
|
92
122
|
}
|
|
@@ -110,14 +140,15 @@ class SemanticIndex {
|
|
|
110
140
|
async load() {
|
|
111
141
|
try {
|
|
112
142
|
const meta = JSON.parse(await node_fs_1.promises.readFile(this.metaPath(), 'utf8'));
|
|
113
|
-
if (meta.model !==
|
|
143
|
+
if (meta.model !== semanticModel() || !(meta.dim > 0))
|
|
114
144
|
return;
|
|
115
145
|
const buf = await node_fs_1.promises.readFile(this.dataPath());
|
|
116
|
-
const expected = meta.ids.length *
|
|
146
|
+
const expected = meta.ids.length * meta.dim * 4;
|
|
117
147
|
if (buf.byteLength !== expected)
|
|
118
148
|
return;
|
|
119
149
|
this.vectors = new Float32Array(buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength));
|
|
120
150
|
this.ids = meta.ids;
|
|
151
|
+
this.dim = meta.dim;
|
|
121
152
|
this.pos = new Map(meta.ids.map((id, i) => [id, i]));
|
|
122
153
|
}
|
|
123
154
|
catch {
|
|
@@ -128,7 +159,7 @@ class SemanticIndex {
|
|
|
128
159
|
if (!this.dirty)
|
|
129
160
|
return;
|
|
130
161
|
await node_fs_1.promises.mkdir(this.dir, { recursive: true });
|
|
131
|
-
const meta = { model:
|
|
162
|
+
const meta = { model: semanticModel(), dtype: semanticDtype(), dim: this.dim, ids: this.ids };
|
|
132
163
|
const tmpMeta = this.metaPath() + '.tmp';
|
|
133
164
|
const tmpData = this.dataPath() + '.tmp';
|
|
134
165
|
await node_fs_1.promises.writeFile(tmpData, Buffer.from(this.vectors.buffer, this.vectors.byteOffset, this.vectors.byteLength));
|
|
@@ -155,7 +186,7 @@ class SemanticIndex {
|
|
|
155
186
|
tf.env.cacheDir = node_path_1.default.join(semanticHome(), 'models');
|
|
156
187
|
tf.env.allowLocalModels = true;
|
|
157
188
|
tf.env.allowRemoteModels = true;
|
|
158
|
-
this.extractor = await tf.pipeline('feature-extraction',
|
|
189
|
+
this.extractor = await tf.pipeline('feature-extraction', semanticModel(), { dtype: semanticDtype() });
|
|
159
190
|
return this.extractor;
|
|
160
191
|
})().catch(err => {
|
|
161
192
|
this.broken = this.broken || `semantic model failed to load: ${err instanceof Error ? err.message : String(err)}`;
|
|
@@ -174,8 +205,13 @@ class SemanticIndex {
|
|
|
174
205
|
const res = await extractor(batch, { pooling: 'mean', normalize: true });
|
|
175
206
|
// res.data is a flat typed array of batch × dim.
|
|
176
207
|
const flat = res.data instanceof Float32Array ? res.data : Float32Array.from(res.data);
|
|
208
|
+
const dim = flat.length / batch.length;
|
|
209
|
+
if (!this.dim)
|
|
210
|
+
this.dim = dim;
|
|
211
|
+
else if (dim !== this.dim)
|
|
212
|
+
throw new Error(`semantic model returned ${dim}-wide vectors, the index holds ${this.dim}`);
|
|
177
213
|
for (let j = 0; j < batch.length; j++) {
|
|
178
|
-
out.push(flat.slice(j *
|
|
214
|
+
out.push(flat.slice(j * this.dim, (j + 1) * this.dim));
|
|
179
215
|
}
|
|
180
216
|
}
|
|
181
217
|
return out;
|
|
@@ -185,6 +221,11 @@ class SemanticIndex {
|
|
|
185
221
|
* an unchanged line is never embedded twice.
|
|
186
222
|
*/
|
|
187
223
|
async upsert(entries) {
|
|
224
|
+
const run = this.queue.then(() => this.upsertNow(entries));
|
|
225
|
+
this.queue = run.catch(() => undefined);
|
|
226
|
+
return run;
|
|
227
|
+
}
|
|
228
|
+
async upsertNow(entries) {
|
|
188
229
|
const nuevos = entries.filter(e => e.text && !this.pos.has(e.id));
|
|
189
230
|
if (nuevos.length === 0)
|
|
190
231
|
return 0;
|
|
@@ -194,10 +235,10 @@ class SemanticIndex {
|
|
|
194
235
|
// swallowed upstream — which is why the first benchmark run showed no
|
|
195
236
|
// change at all. Measure the effect, not the artefact.
|
|
196
237
|
const base = this.ids.length;
|
|
197
|
-
const grown = new Float32Array((base + nuevos.length) *
|
|
238
|
+
const grown = new Float32Array((base + nuevos.length) * this.dim);
|
|
198
239
|
grown.set(this.vectors, 0);
|
|
199
240
|
for (let i = 0; i < nuevos.length; i++) {
|
|
200
|
-
grown.set(vecs[i], (base + i) *
|
|
241
|
+
grown.set(vecs[i], (base + i) * this.dim);
|
|
201
242
|
this.pos.set(nuevos[i].id, base + i);
|
|
202
243
|
this.ids.push(nuevos[i].id);
|
|
203
244
|
}
|
|
@@ -214,12 +255,12 @@ class SemanticIndex {
|
|
|
214
255
|
if (gone.size === 0)
|
|
215
256
|
return 0;
|
|
216
257
|
const keepIds = [];
|
|
217
|
-
const keep = new Float32Array((this.ids.length - gone.size) *
|
|
258
|
+
const keep = new Float32Array((this.ids.length - gone.size) * this.dim);
|
|
218
259
|
let k = 0;
|
|
219
260
|
for (let i = 0; i < this.ids.length; i++) {
|
|
220
261
|
if (gone.has(this.ids[i]))
|
|
221
262
|
continue;
|
|
222
|
-
keep.set(this.vectors.subarray(i *
|
|
263
|
+
keep.set(this.vectors.subarray(i * this.dim, (i + 1) * this.dim), k * this.dim);
|
|
223
264
|
keepIds.push(this.ids[i]);
|
|
224
265
|
k++;
|
|
225
266
|
}
|
|
@@ -237,8 +278,8 @@ class SemanticIndex {
|
|
|
237
278
|
const scores = new Float32Array(this.ids.length);
|
|
238
279
|
for (let i = 0; i < this.ids.length; i++) {
|
|
239
280
|
let dot = 0;
|
|
240
|
-
const off = i *
|
|
241
|
-
for (let d = 0; d <
|
|
281
|
+
const off = i * this.dim;
|
|
282
|
+
for (let d = 0; d < this.dim; d++)
|
|
242
283
|
dot += q[d] * this.vectors[off + d];
|
|
243
284
|
scores[i] = dot;
|
|
244
285
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic.js","sourceRoot":"","sources":["../../src/search/semantic.ts"],"names":[],"mappings":";AAAA,oEAAoE;AACpE,EAAE;AACF,6EAA6E;AAC7E,4EAA4E;AAC5E,4EAA4E;AAC5E,yEAAyE;AACzE,+CAA+C;AAC/C,EAAE;AACF,+DAA+D;AAC/D,2EAA2E;AAC3E,wEAAwE;AACxE,6EAA6E;AAC7E,2EAA2E;AAC3E,yEAAyE;AACzE,4CAA4C;AAC5C,0EAA0E;AAC1E,yEAAyE;AACzE,sEAAsE;AACtE,EAAE;AACF,UAAU;AACV,4EAA4E;AAC5E,2EAA2E;AAC3E,iEAAiE;AACjE,0EAA0E;AAC1E,4EAA4E;AAC5E,0BAA0B;AAC1B,wEAAwE;AACxE,wCAAwC;AACxC,2EAA2E;;;;;;AAkB3E,0CAGC;AAGD,oCAEC;AAGD,wCAOC;AAED,wCAOC;AA3CD,6CAA4C;AAC5C,uCAAyC;AACzC,qCAAyC;AACzC,0DAA6B;AAC7B,sDAAyB;AAEZ,QAAA,cAAc,GAAG,8BAA8B,CAAC;AAChD,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AC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;YACvE,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;QAClB,CAAC;QACD,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACxF,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC;IACzF,CAAC;CACF;AAhLD,sCAgLC"}
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAqCpE,wBAAgB,YAAY,IAAI,SAAS,CAy3CxC"}
|
package/dist/server.js
CHANGED
|
@@ -23,6 +23,7 @@ const heat_js_1 = require("./engine/heat.js");
|
|
|
23
23
|
const hippocampus_js_1 = require("./engine/hippocampus.js");
|
|
24
24
|
const prefrontal_js_1 = require("./engine/prefrontal.js");
|
|
25
25
|
const index_js_1 = require("./search/index.js");
|
|
26
|
+
const semantic_js_1 = require("./search/semantic.js");
|
|
26
27
|
const maintenance_js_1 = require("./engine/maintenance.js");
|
|
27
28
|
const space_js_1 = require("./sync/space.js");
|
|
28
29
|
const keychain_js_1 = require("./engine/keychain.js");
|
|
@@ -120,12 +121,22 @@ function createServer() {
|
|
|
120
121
|
// repeated inside every tool description. Measured with a real
|
|
121
122
|
// tools/list: the 23 definitions cost ~6.3k tokens on every request
|
|
122
123
|
// in clients that load all tools; this paragraph costs ~200, once.
|
|
124
|
+
// Semantic recall is installed by init since 1.16; say so once when
|
|
125
|
+
// it is missing, so the agent can offer the one command that fixes it.
|
|
126
|
+
const sem = (0, semantic_js_1.semanticStatus)();
|
|
127
|
+
if (!sem.installed && sem.mode !== 'disabled') {
|
|
128
|
+
response.semantic_hint =
|
|
129
|
+
'Semantic recall is not installed on this machine: run once npx crbro-memory init (about 500 MB). ' +
|
|
130
|
+
'Until then recall is keyword-only; keywords at save time still work.';
|
|
131
|
+
}
|
|
123
132
|
response.memory_discipline =
|
|
124
133
|
'Before crbro_learn, crbro_recall: what you are about to save may already exist — then pass ' +
|
|
125
134
|
'supersedes instead of adding a sibling (two versions of one fact compete on recall as equals). ' +
|
|
126
135
|
'Structure — paths, what serves what, traps — goes in crbro_map, not in facts; anything derivable ' +
|
|
127
136
|
'from the repo or git history is not worth storing. Write facts dense and self-contained: they are ' +
|
|
128
|
-
'recalled without this conversation
|
|
137
|
+
'recalled without this conversation, and add keywords: the words a future question may use that ' +
|
|
138
|
+
'the text lacks. On recall, ask several ways (queries) before concluding a thing is not stored. ' +
|
|
139
|
+
'type:error keeps a mistake with its fix; type:debt keeps a ' +
|
|
129
140
|
'deliberate deferral with its ceiling and revisit trigger. Credentials never go in the brain: ' +
|
|
130
141
|
'crbro_secret, then record only the NAME. Recall results carry confidence — "weak" means the match ' +
|
|
131
142
|
'covers little of the question, verify before relying on it — and when two facts disagree, prefer ' +
|
|
@@ -163,6 +174,7 @@ function createServer() {
|
|
|
163
174
|
brain_path: zod_1.z.string().optional(),
|
|
164
175
|
last_boot: zod_1.z.string().nullable().optional(),
|
|
165
176
|
last_consolidation: zod_1.z.string().nullable().optional(),
|
|
177
|
+
semantic: zod_1.z.object({ installed: zod_1.z.boolean(), enabled: zod_1.z.boolean(), mode: zod_1.z.string(), model_downloaded: zod_1.z.boolean(), home: zod_1.z.string(), model: zod_1.z.string() }).optional(),
|
|
166
178
|
},
|
|
167
179
|
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
168
180
|
}, async () => {
|
|
@@ -177,6 +189,7 @@ function createServer() {
|
|
|
177
189
|
brain_path: manifest.brain_path,
|
|
178
190
|
last_boot: manifest.last_boot,
|
|
179
191
|
last_consolidation: manifest.last_consolidation,
|
|
192
|
+
semantic: (0, semantic_js_1.semanticStatus)(),
|
|
180
193
|
};
|
|
181
194
|
return {
|
|
182
195
|
content: [{ type: 'text', text: JSON.stringify(payload, null, 2) }],
|
|
@@ -198,7 +211,7 @@ function createServer() {
|
|
|
198
211
|
// ═══════════════════════════════════════════════════════════════
|
|
199
212
|
server.registerTool('crbro_learn', {
|
|
200
213
|
title: 'Learn something',
|
|
201
|
-
description: 'Store a fact, decision, pattern, preference, error or debt on a topic. The neuron is created if it does not exist; pass neuron_id (from crbro_recall) to target an exact one and skip name matching. Recall first: to replace an outdated fact pass its id in supersedes rather than adding a sibling. A fact stored verbatim before is skipped silently; decisions always append; preferences never leave this machine. Credential-like values are replaced with a marker before touching disk and listed in redacted — store the value with crbro_secret and record only its name. Returns neuron_id, action (created|updated), superseded count, near_duplicates (stored anyway; retire the old telling), supersedes_unmatched (those targets are still live — retire them with crbro_revise) and running totals.',
|
|
214
|
+
description: 'Store a fact, decision, pattern, preference, error or debt on a topic. The neuron is created if it does not exist; pass neuron_id (from crbro_recall) to target an exact one and skip name matching. Recall first: to replace an outdated fact pass its id in supersedes rather than adding a sibling. A fact stored verbatim before is skipped silently; decisions always append; preferences never leave this machine. Credential-like values are replaced with a marker before touching disk and listed in redacted — store the value with crbro_secret and record only its name. Add keywords a future question may use that the text lacks (synonyms, the other language, the generic name of the product). Returns neuron_id, action (created|updated), superseded count, near_duplicates (stored anyway; retire the old telling), supersedes_unmatched (those targets are still live — retire them with crbro_revise) and running totals.',
|
|
202
215
|
inputSchema: {
|
|
203
216
|
topic: zod_1.z.string().describe('Topic name, e.g. "OctoChat", "Firebase", "SEO Strategy".'),
|
|
204
217
|
type: zod_1.z.enum(['fact', 'decision', 'pattern', 'preference', 'error', 'debt']).describe('error = a mistake plus its correction, in one entry. debt = a deliberate deferral: what was NOT done on purpose, its ceiling, and the revisit condition, e.g. "DEFERRED: protecting the PDFs. CEILING: anyone can download them without signing up. REVISIT WHEN: the signup flow works."'),
|
|
@@ -208,6 +221,7 @@ function createServer() {
|
|
|
208
221
|
rationale: zod_1.z.string().optional().describe('Why the decision was taken. Stored and indexed with it; ignored for other types.'),
|
|
209
222
|
neuron_id: zod_1.z.string().optional().describe('Exact neuron id from crbro_recall, e.g. "project_octochat". Skips name matching entirely.'),
|
|
210
223
|
supersedes: zod_1.z.array(zod_1.z.string()).optional().describe('Facts this one replaces: their ids or exact text. They leave recall but stay in the file. Unmatched targets are reported and stay live.'),
|
|
224
|
+
keywords: zod_1.z.array(zod_1.z.string()).optional().describe('Facts only. 2-5 words a future question may use that the text does not contain: synonyms, the other language, the generic name of the product named. Indexed with the fact, never shown. The same text again with new keywords merges them.'),
|
|
211
225
|
},
|
|
212
226
|
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
213
227
|
}, async (args) => {
|
|
@@ -218,6 +232,7 @@ function createServer() {
|
|
|
218
232
|
rationale: args.rationale,
|
|
219
233
|
neuronId: args.neuron_id,
|
|
220
234
|
supersedes: args.supersedes,
|
|
235
|
+
keys: args.keywords,
|
|
221
236
|
});
|
|
222
237
|
// Indexing happens inside cortex.learn, through the indexer hook.
|
|
223
238
|
// `neuron` is only null when the caller asked not to create one,
|
|
@@ -398,9 +413,10 @@ function createServer() {
|
|
|
398
413
|
// ═══════════════════════════════════════════════════════════════
|
|
399
414
|
server.registerTool('crbro_recall', {
|
|
400
415
|
title: 'Recall',
|
|
401
|
-
description: 'Search everything saved in earlier sessions — the full text of facts, decisions, patterns, preferences, errors, debts and system maps, not just topic names. Read-only. One result per neuron: its best matching chunk (matching_content, matched_kind, matched_added), a confidence label (weak = the match covers little of the question; verify before relying on it) and, for the top results, also_matched — the neuron\'s next best lines. Superseded and retracted facts never surface. Call it before asking the user something they may already have told you, and before crbro_learn. If nothing matches, retry with fewer, more distinctive words (names, ids, filenames). has_map:true means the neuron keeps a system map — read it with crbro_map before touching that system.',
|
|
416
|
+
description: 'Search everything saved in earlier sessions — the full text of facts, decisions, patterns, preferences, errors, debts and system maps, not just topic names. Read-only. One result per neuron: its best matching chunk (matching_content, matched_kind, matched_added), a confidence label (weak = the match covers little of the question; verify before relying on it) and, for the top results, also_matched — the neuron\'s next best lines. Superseded and retracted facts never surface. Call it before asking the user something they may already have told you, and before crbro_learn. If nothing matches or all is weak, pass 2-4 alternative phrasings in queries (fused by rank), or retry with fewer, more distinctive words (names, ids, filenames). has_map:true means the neuron keeps a system map — read it with crbro_map before touching that system.',
|
|
402
417
|
inputSchema: {
|
|
403
418
|
query: zod_1.z.string().describe('What to look for, e.g. "Firebase authentication setup". Fewer, distinctive terms beat full sentences.'),
|
|
419
|
+
queries: zod_1.z.array(zod_1.z.string()).optional().describe('Alternative phrasings of the same question, searched together with query and fused by rank. Use synonyms, the other language and the concrete product name; 2-4 is plenty.'),
|
|
404
420
|
domain: zod_1.z.string().optional().describe('Only neurons in this domain (exact match, e.g. "proyectos-web").'),
|
|
405
421
|
limit: zod_1.z.number().optional().describe('Max neurons returned (default 10).'),
|
|
406
422
|
},
|
|
@@ -421,7 +437,7 @@ function createServer() {
|
|
|
421
437
|
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
422
438
|
}, async (args) => {
|
|
423
439
|
try {
|
|
424
|
-
const results = await searchEngine.
|
|
440
|
+
const results = await searchEngine.searchMany([args.query, ...(args.queries || [])], {
|
|
425
441
|
domain: args.domain,
|
|
426
442
|
limit: args.limit,
|
|
427
443
|
});
|