@framers/agentos 0.1.119 → 0.1.120

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.
@@ -0,0 +1,115 @@
1
+ /**
2
+ * @fileoverview HNSW sidecar index for SqliteBrain.
3
+ * @module memory/store/HnswSidecar
4
+ *
5
+ * Maintains an HNSW index file alongside brain.sqlite for O(log n)
6
+ * approximate nearest neighbor search. SQLite remains the source of
7
+ * truth; the HNSW index is rebuildable from SQLite data at any time.
8
+ *
9
+ * Auto-activates when trace count exceeds threshold (default: 1000).
10
+ * Below that, brute-force cosine in the Memory facade is fast enough.
11
+ *
12
+ * Architecture:
13
+ * ```
14
+ * ~/.wunderland/agents/{name}/
15
+ * ├── brain.sqlite ← source of truth
16
+ * └── brain.hnsw ← HNSW index (rebuildable)
17
+ * brain.hnsw.map.json ← label↔id mapping
18
+ * ```
19
+ */
20
+ export interface HnswSidecarConfig {
21
+ /** Path to brain.sqlite — HNSW file will be at same dir with .hnsw extension. */
22
+ sqlitePath: string;
23
+ /** Embedding dimensions. */
24
+ dimensions: number;
25
+ /** Auto-build threshold. Below this count, brute-force is used. @default 1000 */
26
+ autoThreshold?: number;
27
+ /** HNSW M parameter (connections per node). @default 16 */
28
+ m?: number;
29
+ /** HNSW efConstruction (build quality). @default 200 */
30
+ efConstruction?: number;
31
+ /** HNSW efSearch (query quality). @default 50 */
32
+ efSearch?: number;
33
+ }
34
+ /** Result from a KNN query. */
35
+ export interface HnswQueryResult {
36
+ /** Trace ID. */
37
+ id: string;
38
+ /** Distance from query vector (lower = closer for cosine distance). */
39
+ distance: number;
40
+ }
41
+ export declare class HnswSidecar {
42
+ private index;
43
+ private HierarchicalNSW;
44
+ private readonly indexPath;
45
+ private readonly mapPath;
46
+ private readonly config;
47
+ /** Maps HNSW internal integer labels → trace ID strings. */
48
+ private labelToId;
49
+ /** Maps trace ID strings → HNSW internal integer labels. */
50
+ private idToLabel;
51
+ private nextLabel;
52
+ private _isActive;
53
+ private _hnswAvailable;
54
+ constructor(config: HnswSidecarConfig);
55
+ /** Whether the HNSW index is currently active and queryable. */
56
+ get isActive(): boolean;
57
+ /** Number of vectors currently indexed. */
58
+ get size(): number;
59
+ /**
60
+ * Initialize the sidecar. Loads existing index from disk if present.
61
+ * If hnswlib-node is not installed, silently stays inactive.
62
+ */
63
+ init(): Promise<void>;
64
+ /**
65
+ * Add a vector to the index. If below threshold, does nothing.
66
+ * If threshold is crossed, caller should call rebuildFromData().
67
+ *
68
+ * @param traceId - The trace ID to associate with this vector.
69
+ * @param embedding - The embedding vector.
70
+ * @param totalCount - Current total trace count (to check threshold).
71
+ */
72
+ add(traceId: string, embedding: number[], totalCount: number): Promise<void>;
73
+ /**
74
+ * Query the HNSW index for top-K nearest neighbors.
75
+ * Returns trace IDs sorted by distance (closest first).
76
+ *
77
+ * @param embedding - Query vector.
78
+ * @param topK - Number of results to return.
79
+ * @returns Array of { id, distance } sorted by distance ascending.
80
+ */
81
+ query(embedding: number[], topK: number): HnswQueryResult[];
82
+ /**
83
+ * Remove a trace from the index by marking its label as deleted.
84
+ * HNSW doesn't support true deletion — cleaned up on rebuild.
85
+ *
86
+ * @param traceId - The trace ID to remove.
87
+ */
88
+ remove(traceId: string): void;
89
+ /**
90
+ * Rebuild the entire index from a set of id/embedding pairs.
91
+ * Called on first threshold crossing or when brain.hnsw is missing/corrupt.
92
+ *
93
+ * @param data - Array of { id, embedding } to index.
94
+ */
95
+ rebuildFromData(data: {
96
+ id: string;
97
+ embedding: number[];
98
+ }[]): Promise<void>;
99
+ /**
100
+ * Persist index and label map to disk.
101
+ * Called after rebuildFromData() and periodically after adds.
102
+ */
103
+ saveToDisk(): void;
104
+ /**
105
+ * Delete index files from disk and deactivate.
106
+ */
107
+ destroy(): void;
108
+ /** Try to load hnswlib-node. Returns false if not installed. */
109
+ private _ensureHnswlib;
110
+ /** Load index + label map from disk. */
111
+ private _loadFromDisk;
112
+ /** Persist index + label map to disk. */
113
+ private _saveToDisk;
114
+ }
115
+ //# sourceMappingURL=HnswSidecar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HnswSidecar.d.ts","sourceRoot":"","sources":["../../../src/memory/store/HnswSidecar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AASH,MAAM,WAAW,iBAAiB;IAChC,iFAAiF;IACjF,UAAU,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,wDAAwD;IACxD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,+BAA+B;AAC/B,MAAM,WAAW,eAAe;IAC9B,gBAAgB;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAMD,qBAAa,WAAW;IACtB,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA8B;IAErD,4DAA4D;IAC5D,OAAO,CAAC,SAAS,CAAkC;IACnD,4DAA4D;IAC5D,OAAO,CAAC,SAAS,CAAkC;IACnD,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,cAAc,CAAwB;gBAElC,MAAM,EAAE,iBAAiB;IAYrC,gEAAgE;IAChE,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,2CAA2C;IAC3C,IAAI,IAAI,IAAI,MAAM,CAEjB;IAMD;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAc3B;;;;;;;OAOG;IACG,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBlF;;;;;;;OAOG;IACH,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,eAAe,EAAE;IAqB3D;;;;;OAKG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAa7B;;;;;OAKG;IACG,eAAe,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IA6BjF;;;OAGG;IACH,UAAU,IAAI,IAAI;IAIlB;;OAEG;IACH,OAAO,IAAI,IAAI;IAkBf,gEAAgE;YAClD,cAAc;IAe5B,wCAAwC;YAC1B,aAAa;IAuB3B,yCAAyC;IACzC,OAAO,CAAC,WAAW;CAepB"}
@@ -0,0 +1,256 @@
1
+ /**
2
+ * @fileoverview HNSW sidecar index for SqliteBrain.
3
+ * @module memory/store/HnswSidecar
4
+ *
5
+ * Maintains an HNSW index file alongside brain.sqlite for O(log n)
6
+ * approximate nearest neighbor search. SQLite remains the source of
7
+ * truth; the HNSW index is rebuildable from SQLite data at any time.
8
+ *
9
+ * Auto-activates when trace count exceeds threshold (default: 1000).
10
+ * Below that, brute-force cosine in the Memory facade is fast enough.
11
+ *
12
+ * Architecture:
13
+ * ```
14
+ * ~/.wunderland/agents/{name}/
15
+ * ├── brain.sqlite ← source of truth
16
+ * └── brain.hnsw ← HNSW index (rebuildable)
17
+ * brain.hnsw.map.json ← label↔id mapping
18
+ * ```
19
+ */
20
+ import { existsSync, unlinkSync, writeFileSync, readFileSync } from 'node:fs';
21
+ import { join, dirname } from 'node:path';
22
+ // ---------------------------------------------------------------------------
23
+ // HnswSidecar
24
+ // ---------------------------------------------------------------------------
25
+ export class HnswSidecar {
26
+ constructor(config) {
27
+ this.index = null; // HierarchicalNSW instance (dynamic import)
28
+ this.HierarchicalNSW = null; // Constructor reference
29
+ /** Maps HNSW internal integer labels → trace ID strings. */
30
+ this.labelToId = new Map();
31
+ /** Maps trace ID strings → HNSW internal integer labels. */
32
+ this.idToLabel = new Map();
33
+ this.nextLabel = 0;
34
+ this._isActive = false;
35
+ this._hnswAvailable = null;
36
+ this.config = {
37
+ autoThreshold: 1000,
38
+ m: 16,
39
+ efConstruction: 200,
40
+ efSearch: 50,
41
+ ...config,
42
+ };
43
+ this.indexPath = join(dirname(this.config.sqlitePath), 'brain.hnsw');
44
+ this.mapPath = this.indexPath + '.map.json';
45
+ }
46
+ /** Whether the HNSW index is currently active and queryable. */
47
+ get isActive() {
48
+ return this._isActive;
49
+ }
50
+ /** Number of vectors currently indexed. */
51
+ get size() {
52
+ return this.labelToId.size;
53
+ }
54
+ // ---------------------------------------------------------------------------
55
+ // Lifecycle
56
+ // ---------------------------------------------------------------------------
57
+ /**
58
+ * Initialize the sidecar. Loads existing index from disk if present.
59
+ * If hnswlib-node is not installed, silently stays inactive.
60
+ */
61
+ async init() {
62
+ if (!(await this._ensureHnswlib()))
63
+ return;
64
+ if (existsSync(this.indexPath) && existsSync(this.mapPath)) {
65
+ try {
66
+ await this._loadFromDisk();
67
+ }
68
+ catch {
69
+ // Corrupt index — will rebuild when threshold is reached
70
+ this._isActive = false;
71
+ this.index = null;
72
+ }
73
+ }
74
+ }
75
+ /**
76
+ * Add a vector to the index. If below threshold, does nothing.
77
+ * If threshold is crossed, caller should call rebuildFromData().
78
+ *
79
+ * @param traceId - The trace ID to associate with this vector.
80
+ * @param embedding - The embedding vector.
81
+ * @param totalCount - Current total trace count (to check threshold).
82
+ */
83
+ async add(traceId, embedding, totalCount) {
84
+ if (!this._isActive) {
85
+ // If we just crossed the threshold, caller needs to rebuildFromData()
86
+ if (totalCount >= this.config.autoThreshold)
87
+ return;
88
+ return;
89
+ }
90
+ if (!this.index)
91
+ return;
92
+ if (this.idToLabel.has(traceId))
93
+ return; // Already indexed
94
+ // Resize if needed
95
+ const currentMax = this.index.getMaxElements();
96
+ if (this.nextLabel >= currentMax) {
97
+ this.index.resizeIndex(currentMax + 1000);
98
+ }
99
+ const label = this.nextLabel++;
100
+ this.index.addPoint(embedding, label);
101
+ this.labelToId.set(label, traceId);
102
+ this.idToLabel.set(traceId, label);
103
+ }
104
+ /**
105
+ * Query the HNSW index for top-K nearest neighbors.
106
+ * Returns trace IDs sorted by distance (closest first).
107
+ *
108
+ * @param embedding - Query vector.
109
+ * @param topK - Number of results to return.
110
+ * @returns Array of { id, distance } sorted by distance ascending.
111
+ */
112
+ query(embedding, topK) {
113
+ if (!this._isActive || !this.index)
114
+ return [];
115
+ const currentCount = this.index.getCurrentCount();
116
+ if (currentCount === 0)
117
+ return [];
118
+ const k = Math.min(topK, currentCount);
119
+ const result = this.index.searchKnn(embedding, k);
120
+ const hits = [];
121
+ for (let i = 0; i < result.neighbors.length; i++) {
122
+ const label = result.neighbors[i];
123
+ const id = this.labelToId.get(label);
124
+ if (id) {
125
+ hits.push({ id, distance: result.distances[i] });
126
+ }
127
+ }
128
+ return hits;
129
+ }
130
+ /**
131
+ * Remove a trace from the index by marking its label as deleted.
132
+ * HNSW doesn't support true deletion — cleaned up on rebuild.
133
+ *
134
+ * @param traceId - The trace ID to remove.
135
+ */
136
+ remove(traceId) {
137
+ const label = this.idToLabel.get(traceId);
138
+ if (label !== undefined && this.index) {
139
+ try {
140
+ this.index.markDelete(label);
141
+ }
142
+ catch {
143
+ // markDelete may not be available in all hnswlib-node versions
144
+ }
145
+ this.labelToId.delete(label);
146
+ this.idToLabel.delete(traceId);
147
+ }
148
+ }
149
+ /**
150
+ * Rebuild the entire index from a set of id/embedding pairs.
151
+ * Called on first threshold crossing or when brain.hnsw is missing/corrupt.
152
+ *
153
+ * @param data - Array of { id, embedding } to index.
154
+ */
155
+ async rebuildFromData(data) {
156
+ if (data.length === 0)
157
+ return;
158
+ if (!(await this._ensureHnswlib()))
159
+ return;
160
+ const dim = this.config.dimensions;
161
+ this.index = new this.HierarchicalNSW('cosine', dim);
162
+ this.index.initIndex(Math.max(data.length + 1000, data.length * 1.2 | 0), this.config.m, this.config.efConstruction);
163
+ this.index.setEf(this.config.efSearch);
164
+ this.labelToId.clear();
165
+ this.idToLabel.clear();
166
+ this.nextLabel = 0;
167
+ for (const { id, embedding } of data) {
168
+ if (embedding.length !== dim)
169
+ continue; // Skip dimension mismatches
170
+ const label = this.nextLabel++;
171
+ this.index.addPoint(embedding, label);
172
+ this.labelToId.set(label, id);
173
+ this.idToLabel.set(id, label);
174
+ }
175
+ this._isActive = true;
176
+ this._saveToDisk();
177
+ }
178
+ /**
179
+ * Persist index and label map to disk.
180
+ * Called after rebuildFromData() and periodically after adds.
181
+ */
182
+ saveToDisk() {
183
+ this._saveToDisk();
184
+ }
185
+ /**
186
+ * Delete index files from disk and deactivate.
187
+ */
188
+ destroy() {
189
+ this._isActive = false;
190
+ this.index = null;
191
+ this.labelToId.clear();
192
+ this.idToLabel.clear();
193
+ this.nextLabel = 0;
194
+ try {
195
+ if (existsSync(this.indexPath))
196
+ unlinkSync(this.indexPath);
197
+ if (existsSync(this.mapPath))
198
+ unlinkSync(this.mapPath);
199
+ }
200
+ catch {
201
+ // Best effort cleanup
202
+ }
203
+ }
204
+ // ---------------------------------------------------------------------------
205
+ // Internal
206
+ // ---------------------------------------------------------------------------
207
+ /** Try to load hnswlib-node. Returns false if not installed. */
208
+ async _ensureHnswlib() {
209
+ if (this._hnswAvailable === true)
210
+ return true;
211
+ if (this._hnswAvailable === false)
212
+ return false;
213
+ try {
214
+ const mod = await import('hnswlib-node');
215
+ this.HierarchicalNSW = mod.HierarchicalNSW;
216
+ this._hnswAvailable = true;
217
+ return true;
218
+ }
219
+ catch {
220
+ this._hnswAvailable = false;
221
+ return false;
222
+ }
223
+ }
224
+ /** Load index + label map from disk. */
225
+ async _loadFromDisk() {
226
+ if (!(await this._ensureHnswlib()))
227
+ return;
228
+ const dim = this.config.dimensions;
229
+ this.index = new this.HierarchicalNSW('cosine', dim);
230
+ this.index.readIndexSync(this.indexPath);
231
+ this.index.setEf(this.config.efSearch);
232
+ // Load label map
233
+ const raw = readFileSync(this.mapPath, 'utf-8');
234
+ const data = JSON.parse(raw);
235
+ this.labelToId = new Map(data.labelToId);
236
+ this.idToLabel = new Map(data.labelToId.map(([label, id]) => [id, label]));
237
+ this.nextLabel = data.nextLabel ?? this.labelToId.size;
238
+ this._isActive = true;
239
+ }
240
+ /** Persist index + label map to disk. */
241
+ _saveToDisk() {
242
+ if (!this.index)
243
+ return;
244
+ try {
245
+ this.index.writeIndexSync(this.indexPath);
246
+ writeFileSync(this.mapPath, JSON.stringify({
247
+ labelToId: Array.from(this.labelToId.entries()),
248
+ nextLabel: this.nextLabel,
249
+ }));
250
+ }
251
+ catch {
252
+ // Best effort — index can always be rebuilt from SQLite
253
+ }
254
+ }
255
+ }
256
+ //# sourceMappingURL=HnswSidecar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HnswSidecar.js","sourceRoot":"","sources":["../../../src/memory/store/HnswSidecar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6B1C,8EAA8E;AAC9E,cAAc;AACd,8EAA8E;AAE9E,MAAM,OAAO,WAAW;IAetB,YAAY,MAAyB;QAd7B,UAAK,GAAQ,IAAI,CAAC,CAAC,4CAA4C;QAC/D,oBAAe,GAAQ,IAAI,CAAC,CAAC,wBAAwB;QAK7D,4DAA4D;QACpD,cAAS,GAAwB,IAAI,GAAG,EAAE,CAAC;QACnD,4DAA4D;QACpD,cAAS,GAAwB,IAAI,GAAG,EAAE,CAAC;QAC3C,cAAS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AAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAEvC,iBAAiB;QACjB,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAChD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAG1B,CAAC;QAEF,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACzC,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,CACtB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CACjD,CAAC;QACF,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;QACvD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,CAAC;IAED,yCAAyC;IACjC,WAAW;QACjB,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,OAAO;QACxB,IAAI,CAAC;YACH,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC1C,aAAa,CACX,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,SAAS,CAAC;gBACb,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;gBAC/C,SAAS,EAAE,IAAI,CAAC,SAAS;aAC1B,CAAC,CACH,CAAC;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,wDAAwD;QAC1D,CAAC;IACH,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@framers/agentos",
3
- "version": "0.1.119",
3
+ "version": "0.1.120",
4
4
  "description": "Modular AgentOS orchestration library",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -217,6 +217,7 @@
217
217
  "@types/better-sqlite3": "^7.6.13",
218
218
  "@types/natural": "^5.1.5",
219
219
  "@types/node": "^20.12.12",
220
+ "better-sqlite3": "^12.4.1",
220
221
  "conventional-changelog-conventionalcommits": "^7.0.2",
221
222
  "eslint": "^9.11.0",
222
223
  "eslint-config-prettier": "^9.1.0",