@framers/agentos 0.1.101 → 0.1.102
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 +16 -0
- package/dist/memory/config.d.ts +39 -0
- package/dist/memory/config.d.ts.map +1 -1
- package/dist/memory/config.js.map +1 -1
- package/dist/memory/consolidation/ConsolidationLoop.d.ts +177 -0
- package/dist/memory/consolidation/ConsolidationLoop.d.ts.map +1 -0
- package/dist/memory/consolidation/ConsolidationLoop.js +517 -0
- package/dist/memory/consolidation/ConsolidationLoop.js.map +1 -0
- package/dist/memory/consolidation/ConsolidationPipeline.d.ts.map +1 -1
- package/dist/memory/consolidation/ConsolidationPipeline.js +7 -0
- package/dist/memory/consolidation/ConsolidationPipeline.js.map +1 -1
- package/dist/memory/consolidation/index.d.ts +8 -0
- package/dist/memory/consolidation/index.d.ts.map +1 -0
- package/dist/memory/consolidation/index.js +7 -0
- package/dist/memory/consolidation/index.js.map +1 -0
- package/dist/memory/decay/DecayModel.d.ts +33 -0
- package/dist/memory/decay/DecayModel.d.ts.map +1 -1
- package/dist/memory/decay/DecayModel.js +31 -0
- package/dist/memory/decay/DecayModel.js.map +1 -1
- package/dist/memory/facade/Memory.d.ts +228 -0
- package/dist/memory/facade/Memory.d.ts.map +1 -0
- package/dist/memory/facade/Memory.js +823 -0
- package/dist/memory/facade/Memory.js.map +1 -0
- package/dist/memory/facade/index.d.ts +13 -0
- package/dist/memory/facade/index.d.ts.map +1 -0
- package/dist/memory/facade/index.js +11 -0
- package/dist/memory/facade/index.js.map +1 -0
- package/dist/memory/facade/types.d.ts +606 -0
- package/dist/memory/facade/types.d.ts.map +1 -0
- package/dist/memory/facade/types.js +11 -0
- package/dist/memory/facade/types.js.map +1 -0
- package/dist/memory/feedback/RetrievalFeedbackSignal.d.ts +132 -0
- package/dist/memory/feedback/RetrievalFeedbackSignal.d.ts.map +1 -0
- package/dist/memory/feedback/RetrievalFeedbackSignal.js +178 -0
- package/dist/memory/feedback/RetrievalFeedbackSignal.js.map +1 -0
- package/dist/memory/feedback/index.d.ts +13 -0
- package/dist/memory/feedback/index.d.ts.map +1 -0
- package/dist/memory/feedback/index.js +12 -0
- package/dist/memory/feedback/index.js.map +1 -0
- package/dist/memory/index.d.ts +22 -0
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +24 -0
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/ingestion/ChunkingEngine.d.ts +143 -0
- package/dist/memory/ingestion/ChunkingEngine.d.ts.map +1 -0
- package/dist/memory/ingestion/ChunkingEngine.js +508 -0
- package/dist/memory/ingestion/ChunkingEngine.js.map +1 -0
- package/dist/memory/ingestion/DoclingLoader.d.ts +44 -0
- package/dist/memory/ingestion/DoclingLoader.d.ts.map +1 -0
- package/dist/memory/ingestion/DoclingLoader.js +228 -0
- package/dist/memory/ingestion/DoclingLoader.js.map +1 -0
- package/dist/memory/ingestion/DocxLoader.d.ts +37 -0
- package/dist/memory/ingestion/DocxLoader.d.ts.map +1 -0
- package/dist/memory/ingestion/DocxLoader.js +111 -0
- package/dist/memory/ingestion/DocxLoader.js.map +1 -0
- package/dist/memory/ingestion/FolderScanner.d.ts +116 -0
- package/dist/memory/ingestion/FolderScanner.d.ts.map +1 -0
- package/dist/memory/ingestion/FolderScanner.js +127 -0
- package/dist/memory/ingestion/FolderScanner.js.map +1 -0
- package/dist/memory/ingestion/HtmlLoader.d.ts +49 -0
- package/dist/memory/ingestion/HtmlLoader.d.ts.map +1 -0
- package/dist/memory/ingestion/HtmlLoader.js +202 -0
- package/dist/memory/ingestion/HtmlLoader.js.map +1 -0
- package/dist/memory/ingestion/IDocumentLoader.d.ts +63 -0
- package/dist/memory/ingestion/IDocumentLoader.d.ts.map +1 -0
- package/dist/memory/ingestion/IDocumentLoader.js +11 -0
- package/dist/memory/ingestion/IDocumentLoader.js.map +1 -0
- package/dist/memory/ingestion/LoaderRegistry.d.ts +140 -0
- package/dist/memory/ingestion/LoaderRegistry.d.ts.map +1 -0
- package/dist/memory/ingestion/LoaderRegistry.js +229 -0
- package/dist/memory/ingestion/LoaderRegistry.js.map +1 -0
- package/dist/memory/ingestion/MarkdownLoader.d.ts +50 -0
- package/dist/memory/ingestion/MarkdownLoader.d.ts.map +1 -0
- package/dist/memory/ingestion/MarkdownLoader.js +169 -0
- package/dist/memory/ingestion/MarkdownLoader.js.map +1 -0
- package/dist/memory/ingestion/MultimodalAggregator.d.ts +88 -0
- package/dist/memory/ingestion/MultimodalAggregator.d.ts.map +1 -0
- package/dist/memory/ingestion/MultimodalAggregator.js +96 -0
- package/dist/memory/ingestion/MultimodalAggregator.js.map +1 -0
- package/dist/memory/ingestion/OcrPdfLoader.d.ts +41 -0
- package/dist/memory/ingestion/OcrPdfLoader.d.ts.map +1 -0
- package/dist/memory/ingestion/OcrPdfLoader.js +149 -0
- package/dist/memory/ingestion/OcrPdfLoader.js.map +1 -0
- package/dist/memory/ingestion/PdfLoader.d.ts +78 -0
- package/dist/memory/ingestion/PdfLoader.d.ts.map +1 -0
- package/dist/memory/ingestion/PdfLoader.js +179 -0
- package/dist/memory/ingestion/PdfLoader.js.map +1 -0
- package/dist/memory/ingestion/TextLoader.d.ts +66 -0
- package/dist/memory/ingestion/TextLoader.d.ts.map +1 -0
- package/dist/memory/ingestion/TextLoader.js +207 -0
- package/dist/memory/ingestion/TextLoader.js.map +1 -0
- package/dist/memory/ingestion/UrlLoader.d.ts +95 -0
- package/dist/memory/ingestion/UrlLoader.d.ts.map +1 -0
- package/dist/memory/ingestion/UrlLoader.js +174 -0
- package/dist/memory/ingestion/UrlLoader.js.map +1 -0
- package/dist/memory/io/ChatGptImporter.d.ts +85 -0
- package/dist/memory/io/ChatGptImporter.d.ts.map +1 -0
- package/dist/memory/io/ChatGptImporter.js +231 -0
- package/dist/memory/io/ChatGptImporter.js.map +1 -0
- package/dist/memory/io/JsonExporter.d.ts +67 -0
- package/dist/memory/io/JsonExporter.d.ts.map +1 -0
- package/dist/memory/io/JsonExporter.js +132 -0
- package/dist/memory/io/JsonExporter.js.map +1 -0
- package/dist/memory/io/JsonImporter.d.ts +84 -0
- package/dist/memory/io/JsonImporter.d.ts.map +1 -0
- package/dist/memory/io/JsonImporter.js +234 -0
- package/dist/memory/io/JsonImporter.js.map +1 -0
- package/dist/memory/io/MarkdownExporter.d.ts +95 -0
- package/dist/memory/io/MarkdownExporter.d.ts.map +1 -0
- package/dist/memory/io/MarkdownExporter.js +130 -0
- package/dist/memory/io/MarkdownExporter.js.map +1 -0
- package/dist/memory/io/MarkdownImporter.d.ts +84 -0
- package/dist/memory/io/MarkdownImporter.d.ts.map +1 -0
- package/dist/memory/io/MarkdownImporter.js +166 -0
- package/dist/memory/io/MarkdownImporter.js.map +1 -0
- package/dist/memory/io/ObsidianExporter.d.ts +80 -0
- package/dist/memory/io/ObsidianExporter.d.ts.map +1 -0
- package/dist/memory/io/ObsidianExporter.js +127 -0
- package/dist/memory/io/ObsidianExporter.js.map +1 -0
- package/dist/memory/io/ObsidianImporter.d.ts +93 -0
- package/dist/memory/io/ObsidianImporter.d.ts.map +1 -0
- package/dist/memory/io/ObsidianImporter.js +221 -0
- package/dist/memory/io/ObsidianImporter.js.map +1 -0
- package/dist/memory/io/SqliteExporter.d.ts +47 -0
- package/dist/memory/io/SqliteExporter.d.ts.map +1 -0
- package/dist/memory/io/SqliteExporter.js +56 -0
- package/dist/memory/io/SqliteExporter.js.map +1 -0
- package/dist/memory/io/SqliteImporter.d.ts +82 -0
- package/dist/memory/io/SqliteImporter.d.ts.map +1 -0
- package/dist/memory/io/SqliteImporter.js +232 -0
- package/dist/memory/io/SqliteImporter.js.map +1 -0
- package/dist/memory/io/index.d.ts +31 -0
- package/dist/memory/io/index.d.ts.map +1 -0
- package/dist/memory/io/index.js +31 -0
- package/dist/memory/io/index.js.map +1 -0
- package/dist/memory/store/SqliteBrain.d.ts +125 -0
- package/dist/memory/store/SqliteBrain.d.ts.map +1 -0
- package/dist/memory/store/SqliteBrain.js +407 -0
- package/dist/memory/store/SqliteBrain.js.map +1 -0
- package/dist/memory/store/SqliteKnowledgeGraph.d.ts +259 -0
- package/dist/memory/store/SqliteKnowledgeGraph.d.ts.map +1 -0
- package/dist/memory/store/SqliteKnowledgeGraph.js +1062 -0
- package/dist/memory/store/SqliteKnowledgeGraph.js.map +1 -0
- package/dist/memory/store/SqliteMemoryGraph.d.ts +251 -0
- package/dist/memory/store/SqliteMemoryGraph.d.ts.map +1 -0
- package/dist/memory/store/SqliteMemoryGraph.js +637 -0
- package/dist/memory/store/SqliteMemoryGraph.js.map +1 -0
- package/dist/memory/tools/MemoryAddTool.d.ts +98 -0
- package/dist/memory/tools/MemoryAddTool.d.ts.map +1 -0
- package/dist/memory/tools/MemoryAddTool.js +131 -0
- package/dist/memory/tools/MemoryAddTool.js.map +1 -0
- package/dist/memory/tools/MemoryDeleteTool.d.ts +83 -0
- package/dist/memory/tools/MemoryDeleteTool.d.ts.map +1 -0
- package/dist/memory/tools/MemoryDeleteTool.js +96 -0
- package/dist/memory/tools/MemoryDeleteTool.js.map +1 -0
- package/dist/memory/tools/MemoryMergeTool.d.ts +95 -0
- package/dist/memory/tools/MemoryMergeTool.d.ts.map +1 -0
- package/dist/memory/tools/MemoryMergeTool.js +164 -0
- package/dist/memory/tools/MemoryMergeTool.js.map +1 -0
- package/dist/memory/tools/MemoryReflectTool.d.ts +86 -0
- package/dist/memory/tools/MemoryReflectTool.d.ts.map +1 -0
- package/dist/memory/tools/MemoryReflectTool.js +102 -0
- package/dist/memory/tools/MemoryReflectTool.js.map +1 -0
- package/dist/memory/tools/MemorySearchTool.d.ts +117 -0
- package/dist/memory/tools/MemorySearchTool.d.ts.map +1 -0
- package/dist/memory/tools/MemorySearchTool.js +162 -0
- package/dist/memory/tools/MemorySearchTool.js.map +1 -0
- package/dist/memory/tools/MemoryUpdateTool.d.ts +92 -0
- package/dist/memory/tools/MemoryUpdateTool.d.ts.map +1 -0
- package/dist/memory/tools/MemoryUpdateTool.js +125 -0
- package/dist/memory/tools/MemoryUpdateTool.js.map +1 -0
- package/dist/memory/tools/index.d.ts +32 -0
- package/dist/memory/tools/index.d.ts.map +1 -0
- package/dist/memory/tools/index.js +26 -0
- package/dist/memory/tools/index.js.map +1 -0
- package/package.json +6 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SqliteImporter.js","sourceRoot":"","sources":["../../../src/memory/io/SqliteImporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AA8CpC,8EAA8E;AAC9E,iBAAiB;AACjB,8EAA8E;AAE9E;;;;;;;;GAQG;AACH,MAAM,OAAO,cAAc;IACzB;;OAEG;IACH,YAA6B,KAAkB;QAAlB,UAAK,GAAL,KAAK,CAAa;IAAG,CAAC;IAEnD,4EAA4E;IAC5E,aAAa;IACb,4EAA4E;IAE5E;;;;;;;;OAQG;IACH,KAAK,CAAC,MAAM,CAAC,UAAkB;QAC7B,MAAM,MAAM,GAAiB,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;QAErE,uEAAuE;QACvE,IAAI,QAA2B,CAAC;QAChC,IAAI,CAAC;YACH,QAAQ,GAAG,IAAI,QAAQ,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,8BAA8B,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAChE,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,IAAI,CAAC;YACH,mEAAmE;YACnE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,GAAG,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;gBACH,IAAI,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC;oBACrC,MAAM,CAAC,OAAO,EAAE,CAAC;oBACjB,SAAS;gBACX,CAAC;gBAED,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;gBAC7E,IAAI,QAAQ,EAAE,CAAC;oBACb,MAAM,CAAC,OAAO,EAAE,CAAC;oBACjB,SAAS;gBACX,CAAC;gBAED,UAAU,CAAC,GAAG,CACZ,GAAG,CAAC,EAAE,IAAI,MAAM,MAAM,EAAE,EAAE,EAC1B,GAAG,CAAC,SAAS,EACb,GAAG,CAAC,SAAS,EACb,GAAG,CAAC,IAAI,IAAI,YAAY,EACxB,GAAG,CAAC,MAAM,IAAI,GAAG,EACjB,GAAG,CAAC,aAAa,IAAI,CAAC,EACtB,GAAG,CAAC,QAAQ,IAAI,IAAI,EACpB,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,GAAG,EAAE,CAC7B,CAAC;gBAEF,MAAM,CAAC,QAAQ,EAAE,CAAC;YACpB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,+EAA+E;gBAC/E,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACzD,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Barrel exports for the Memory I/O subsystem.
|
|
3
|
+
*
|
|
4
|
+
* All importers and exporters for the AgentOS memory brain are re-exported
|
|
5
|
+
* from this single entry point.
|
|
6
|
+
*
|
|
7
|
+
* **Exporters** — serialise a `SqliteBrain` to an external format:
|
|
8
|
+
* - `JsonExporter` — JSON file with optional base64-encoded embeddings.
|
|
9
|
+
* - `MarkdownExporter` — directory of `.md` files with YAML front-matter.
|
|
10
|
+
* - `ObsidianExporter` — Obsidian vault with `[[wikilinks]]` and `#tags`.
|
|
11
|
+
* - `SqliteExporter` — full-fidelity SQLite file copy via `VACUUM INTO`.
|
|
12
|
+
*
|
|
13
|
+
* **Importers** — merge external data into a `SqliteBrain`:
|
|
14
|
+
* - `JsonImporter` — parses a `JsonExporter` JSON file.
|
|
15
|
+
* - `MarkdownImporter` — walks a directory of YAML front-matter Markdown files.
|
|
16
|
+
* - `ObsidianImporter` — extends `MarkdownImporter` with wikilink → edge parsing.
|
|
17
|
+
* - `SqliteImporter` — merges another SQLite brain file (smart dedup + tag union).
|
|
18
|
+
* - `ChatGptImporter` — parses ChatGPT's `conversations.json` export format.
|
|
19
|
+
*
|
|
20
|
+
* @module memory/io
|
|
21
|
+
*/
|
|
22
|
+
export { JsonExporter } from './JsonExporter.js';
|
|
23
|
+
export { JsonImporter } from './JsonImporter.js';
|
|
24
|
+
export { MarkdownExporter } from './MarkdownExporter.js';
|
|
25
|
+
export { MarkdownImporter } from './MarkdownImporter.js';
|
|
26
|
+
export { ObsidianExporter } from './ObsidianExporter.js';
|
|
27
|
+
export { ObsidianImporter } from './ObsidianImporter.js';
|
|
28
|
+
export { SqliteExporter } from './SqliteExporter.js';
|
|
29
|
+
export { SqliteImporter } from './SqliteImporter.js';
|
|
30
|
+
export { ChatGptImporter } from './ChatGptImporter.js';
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/memory/io/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Barrel exports for the Memory I/O subsystem.
|
|
3
|
+
*
|
|
4
|
+
* All importers and exporters for the AgentOS memory brain are re-exported
|
|
5
|
+
* from this single entry point.
|
|
6
|
+
*
|
|
7
|
+
* **Exporters** — serialise a `SqliteBrain` to an external format:
|
|
8
|
+
* - `JsonExporter` — JSON file with optional base64-encoded embeddings.
|
|
9
|
+
* - `MarkdownExporter` — directory of `.md` files with YAML front-matter.
|
|
10
|
+
* - `ObsidianExporter` — Obsidian vault with `[[wikilinks]]` and `#tags`.
|
|
11
|
+
* - `SqliteExporter` — full-fidelity SQLite file copy via `VACUUM INTO`.
|
|
12
|
+
*
|
|
13
|
+
* **Importers** — merge external data into a `SqliteBrain`:
|
|
14
|
+
* - `JsonImporter` — parses a `JsonExporter` JSON file.
|
|
15
|
+
* - `MarkdownImporter` — walks a directory of YAML front-matter Markdown files.
|
|
16
|
+
* - `ObsidianImporter` — extends `MarkdownImporter` with wikilink → edge parsing.
|
|
17
|
+
* - `SqliteImporter` — merges another SQLite brain file (smart dedup + tag union).
|
|
18
|
+
* - `ChatGptImporter` — parses ChatGPT's `conversations.json` export format.
|
|
19
|
+
*
|
|
20
|
+
* @module memory/io
|
|
21
|
+
*/
|
|
22
|
+
export { JsonExporter } from './JsonExporter.js';
|
|
23
|
+
export { JsonImporter } from './JsonImporter.js';
|
|
24
|
+
export { MarkdownExporter } from './MarkdownExporter.js';
|
|
25
|
+
export { MarkdownImporter } from './MarkdownImporter.js';
|
|
26
|
+
export { ObsidianExporter } from './ObsidianExporter.js';
|
|
27
|
+
export { ObsidianImporter } from './ObsidianImporter.js';
|
|
28
|
+
export { SqliteExporter } from './SqliteExporter.js';
|
|
29
|
+
export { SqliteImporter } from './SqliteImporter.js';
|
|
30
|
+
export { ChatGptImporter } from './ChatGptImporter.js';
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/memory/io/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Unified SQLite connection manager for a single agent's long-term brain.
|
|
3
|
+
*
|
|
4
|
+
* One `brain.sqlite` file stores everything the memory ingestion engine needs:
|
|
5
|
+
* memory traces, knowledge graph nodes/edges, document ingestion records,
|
|
6
|
+
* conversation history, consolidation logs, and retrieval feedback signals.
|
|
7
|
+
*
|
|
8
|
+
* ## Cognitive science grounding
|
|
9
|
+
* The schema mirrors Tulving's LTM taxonomy:
|
|
10
|
+
* - `memory_traces` → episodic + semantic + procedural + prospective memories
|
|
11
|
+
* - `knowledge_nodes/edges` → semantic network (Collins & Quillian spreading-activation model)
|
|
12
|
+
* - `documents/chunks` → external world model (grounded episodic encoding)
|
|
13
|
+
* - `conversations/messages` → episodic conversational buffer
|
|
14
|
+
* - `consolidation_log` → slow-wave sleep analogue (offline consolidation events)
|
|
15
|
+
* - `retrieval_feedback` → Hebbian reinforcement ("neurons that fire together wire together")
|
|
16
|
+
*
|
|
17
|
+
* ## Storage design choices
|
|
18
|
+
* - **WAL mode**: allows concurrent reads during writes (important for multi-subsystem access).
|
|
19
|
+
* - **FTS5 with Porter tokenizer**: enables fast full-text search over memory content with
|
|
20
|
+
* morphological stemming (retrieval cue → "retriev*").
|
|
21
|
+
* - **Embeddings as BLOBs**: raw Float32Array buffers stored directly — no external vector DB
|
|
22
|
+
* dependency for the SQLite-backed path; vector similarity runs in-process via HNSW.
|
|
23
|
+
* - **JSON columns**: tags, emotions, metadata stored as JSON TEXT for schema flexibility
|
|
24
|
+
* without sacrificing query-ability via SQLite's json_extract().
|
|
25
|
+
*
|
|
26
|
+
* @module memory/store/SqliteBrain
|
|
27
|
+
*/
|
|
28
|
+
import Database from 'better-sqlite3';
|
|
29
|
+
/**
|
|
30
|
+
* Unified SQLite connection manager for a single agent's persistent brain.
|
|
31
|
+
*
|
|
32
|
+
* **Usage:**
|
|
33
|
+
* ```ts
|
|
34
|
+
* const brain = new SqliteBrain('/path/to/agent/brain.sqlite');
|
|
35
|
+
*
|
|
36
|
+
* // Direct DB access for subsystems
|
|
37
|
+
* const row = brain.db.prepare('SELECT * FROM memory_traces WHERE id = ?').get(id);
|
|
38
|
+
*
|
|
39
|
+
* // Meta helpers
|
|
40
|
+
* brain.setMeta('last_sync', Date.now().toString());
|
|
41
|
+
* const ver = brain.getMeta('schema_version'); // '1'
|
|
42
|
+
*
|
|
43
|
+
* brain.close();
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* Subsystems (MemoryTraceRepository, KnowledgeGraphStore, DocumentChunkStore, etc.)
|
|
47
|
+
* receive the `SqliteBrain` instance and call `brain.db` directly to prepare
|
|
48
|
+
* statements — this avoids redundant connection overhead across subsystems.
|
|
49
|
+
*/
|
|
50
|
+
export declare class SqliteBrain {
|
|
51
|
+
/**
|
|
52
|
+
* The raw `better-sqlite3` database handle.
|
|
53
|
+
*
|
|
54
|
+
* Exposed as `readonly` so subsystems can prepare their own statements
|
|
55
|
+
* without going through an intermediary layer. `better-sqlite3` is
|
|
56
|
+
* synchronous and thread-safe for single-writer, multi-reader scenarios.
|
|
57
|
+
*/
|
|
58
|
+
readonly db: Database.Database;
|
|
59
|
+
/**
|
|
60
|
+
* Create or open the agent's brain database at `dbPath`.
|
|
61
|
+
*
|
|
62
|
+
* Initialization sequence:
|
|
63
|
+
* 1. Open (or create) the SQLite file.
|
|
64
|
+
* 2. Enable WAL journal mode for concurrent read access.
|
|
65
|
+
* 3. Enable foreign key enforcement (OFF by default in SQLite).
|
|
66
|
+
* 4. Execute the full DDL schema (all `CREATE TABLE IF NOT EXISTS`).
|
|
67
|
+
* 5. Create the FTS5 virtual table for full-text memory search.
|
|
68
|
+
* 6. Seed `brain_meta` with `schema_version` and `created_at` if absent.
|
|
69
|
+
*
|
|
70
|
+
* @param dbPath - Absolute path to the `.sqlite` file. The file is created
|
|
71
|
+
* if it does not exist; parent directories must already exist.
|
|
72
|
+
*/
|
|
73
|
+
constructor(dbPath: string);
|
|
74
|
+
/**
|
|
75
|
+
* Execute all DDL statements inside a single transaction.
|
|
76
|
+
* `CREATE TABLE IF NOT EXISTS` is idempotent, so re-running on an existing
|
|
77
|
+
* database is safe — no data is lost.
|
|
78
|
+
*/
|
|
79
|
+
private _initSchema;
|
|
80
|
+
/**
|
|
81
|
+
* Seed `brain_meta` with mandatory keys on first creation.
|
|
82
|
+
* Uses INSERT OR IGNORE to be idempotent on subsequent opens.
|
|
83
|
+
*/
|
|
84
|
+
private _seedMeta;
|
|
85
|
+
/**
|
|
86
|
+
* Read a value from the `brain_meta` key-value store.
|
|
87
|
+
*
|
|
88
|
+
* @param key - The metadata key to look up.
|
|
89
|
+
* @returns The stored string value, or `undefined` if the key does not exist.
|
|
90
|
+
*/
|
|
91
|
+
getMeta(key: string): string | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* Upsert a value into the `brain_meta` key-value store.
|
|
94
|
+
*
|
|
95
|
+
* Uses `INSERT OR REPLACE` semantics — creates the row if absent, or
|
|
96
|
+
* overwrites if present.
|
|
97
|
+
*
|
|
98
|
+
* @param key - The metadata key.
|
|
99
|
+
* @param value - The string value to store.
|
|
100
|
+
*/
|
|
101
|
+
setMeta(key: string, value: string): void;
|
|
102
|
+
/**
|
|
103
|
+
* Check whether a given embedding dimension is compatible with this brain.
|
|
104
|
+
*
|
|
105
|
+
* On first call (no stored `embedding_dimensions`), returns `true` and stores
|
|
106
|
+
* the provided dimension for future compatibility checks.
|
|
107
|
+
*
|
|
108
|
+
* Subsequent calls compare `dimensions` against the stored value.
|
|
109
|
+
* Mismatches indicate that a different embedding model was used to encode
|
|
110
|
+
* memories — mixing dimensions would corrupt vector similarity searches.
|
|
111
|
+
*
|
|
112
|
+
* @param dimensions - The embedding vector length to check (e.g. 1536 for OpenAI ada-002).
|
|
113
|
+
* @returns `true` if compatible (or no prior value), `false` on mismatch.
|
|
114
|
+
*/
|
|
115
|
+
checkEmbeddingCompat(dimensions: number): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Close the database connection.
|
|
118
|
+
*
|
|
119
|
+
* Must be called when the agent shuts down to flush the WAL and release
|
|
120
|
+
* the file lock. Failing to close may leave the database in WAL mode with
|
|
121
|
+
* an unconsumed WAL file.
|
|
122
|
+
*/
|
|
123
|
+
close(): void;
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=SqliteBrain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SqliteBrain.d.ts","sourceRoot":"","sources":["../../../src/memory/store/SqliteBrain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAmPtC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,WAAW;IACtB;;;;;;OAMG;IACH,SAAgB,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAMtC;;;;;;;;;;;;;OAaG;gBACS,MAAM,EAAE,MAAM;IAuB1B;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAoBnB;;;OAGG;IACH,OAAO,CAAC,SAAS;IAiBjB;;;;;OAKG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAQxC;;;;;;;;OAQG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAMzC;;;;;;;;;;;;OAYG;IACH,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAYjD;;;;;;OAMG;IACH,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Unified SQLite connection manager for a single agent's long-term brain.
|
|
3
|
+
*
|
|
4
|
+
* One `brain.sqlite` file stores everything the memory ingestion engine needs:
|
|
5
|
+
* memory traces, knowledge graph nodes/edges, document ingestion records,
|
|
6
|
+
* conversation history, consolidation logs, and retrieval feedback signals.
|
|
7
|
+
*
|
|
8
|
+
* ## Cognitive science grounding
|
|
9
|
+
* The schema mirrors Tulving's LTM taxonomy:
|
|
10
|
+
* - `memory_traces` → episodic + semantic + procedural + prospective memories
|
|
11
|
+
* - `knowledge_nodes/edges` → semantic network (Collins & Quillian spreading-activation model)
|
|
12
|
+
* - `documents/chunks` → external world model (grounded episodic encoding)
|
|
13
|
+
* - `conversations/messages` → episodic conversational buffer
|
|
14
|
+
* - `consolidation_log` → slow-wave sleep analogue (offline consolidation events)
|
|
15
|
+
* - `retrieval_feedback` → Hebbian reinforcement ("neurons that fire together wire together")
|
|
16
|
+
*
|
|
17
|
+
* ## Storage design choices
|
|
18
|
+
* - **WAL mode**: allows concurrent reads during writes (important for multi-subsystem access).
|
|
19
|
+
* - **FTS5 with Porter tokenizer**: enables fast full-text search over memory content with
|
|
20
|
+
* morphological stemming (retrieval cue → "retriev*").
|
|
21
|
+
* - **Embeddings as BLOBs**: raw Float32Array buffers stored directly — no external vector DB
|
|
22
|
+
* dependency for the SQLite-backed path; vector similarity runs in-process via HNSW.
|
|
23
|
+
* - **JSON columns**: tags, emotions, metadata stored as JSON TEXT for schema flexibility
|
|
24
|
+
* without sacrificing query-ability via SQLite's json_extract().
|
|
25
|
+
*
|
|
26
|
+
* @module memory/store/SqliteBrain
|
|
27
|
+
*/
|
|
28
|
+
import Database from 'better-sqlite3';
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
// Constants
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
/** Current schema version. Increment when breaking schema changes are made. */
|
|
33
|
+
const SCHEMA_VERSION = '1';
|
|
34
|
+
// ---------------------------------------------------------------------------
|
|
35
|
+
// DDL — full schema
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
37
|
+
/**
|
|
38
|
+
* Brain metadata key-value store.
|
|
39
|
+
* Used for versioning, agent identity, and embedding configuration.
|
|
40
|
+
*/
|
|
41
|
+
const DDL_BRAIN_META = `
|
|
42
|
+
CREATE TABLE IF NOT EXISTS brain_meta (
|
|
43
|
+
key TEXT PRIMARY KEY,
|
|
44
|
+
value TEXT NOT NULL
|
|
45
|
+
);
|
|
46
|
+
`;
|
|
47
|
+
/**
|
|
48
|
+
* Core memory trace table (Tulving's unified trace model).
|
|
49
|
+
*
|
|
50
|
+
* Column notes:
|
|
51
|
+
* - `embedding` is a raw BLOB (Float32Array serialised as little-endian bytes).
|
|
52
|
+
* - `strength` is the Ebbinghaus retrievability R ∈ [0, 1].
|
|
53
|
+
* - `tags` / `emotions` / `metadata` are JSON TEXT columns.
|
|
54
|
+
* - `deleted` is a soft-delete flag (0 = active, 1 = tombstoned).
|
|
55
|
+
*/
|
|
56
|
+
const DDL_MEMORY_TRACES = `
|
|
57
|
+
CREATE TABLE IF NOT EXISTS memory_traces (
|
|
58
|
+
id TEXT PRIMARY KEY,
|
|
59
|
+
type TEXT NOT NULL,
|
|
60
|
+
scope TEXT NOT NULL,
|
|
61
|
+
content TEXT NOT NULL,
|
|
62
|
+
embedding BLOB,
|
|
63
|
+
strength REAL NOT NULL DEFAULT 1.0,
|
|
64
|
+
created_at INTEGER NOT NULL,
|
|
65
|
+
last_accessed INTEGER,
|
|
66
|
+
retrieval_count INTEGER NOT NULL DEFAULT 0,
|
|
67
|
+
tags TEXT NOT NULL DEFAULT '[]',
|
|
68
|
+
emotions TEXT NOT NULL DEFAULT '{}',
|
|
69
|
+
metadata TEXT NOT NULL DEFAULT '{}',
|
|
70
|
+
deleted INTEGER NOT NULL DEFAULT 0
|
|
71
|
+
);
|
|
72
|
+
`;
|
|
73
|
+
/**
|
|
74
|
+
* FTS5 virtual table for full-text search over memory content and tags.
|
|
75
|
+
* Uses the Porter tokenizer for morphological stemming.
|
|
76
|
+
*
|
|
77
|
+
* Linked to `memory_traces` via the external content mechanism so that
|
|
78
|
+
* content is not duplicated on disk.
|
|
79
|
+
*/
|
|
80
|
+
const DDL_MEMORY_TRACES_FTS = `
|
|
81
|
+
CREATE VIRTUAL TABLE IF NOT EXISTS memory_traces_fts USING fts5(
|
|
82
|
+
content,
|
|
83
|
+
tags,
|
|
84
|
+
content='memory_traces',
|
|
85
|
+
content_rowid='rowid',
|
|
86
|
+
tokenize='porter ascii'
|
|
87
|
+
);
|
|
88
|
+
`;
|
|
89
|
+
/**
|
|
90
|
+
* Knowledge graph nodes (semantic network).
|
|
91
|
+
* Each node represents a real-world entity or concept the agent has learned about.
|
|
92
|
+
*
|
|
93
|
+
* `properties` is a JSON TEXT column holding arbitrary typed attributes.
|
|
94
|
+
* `source` is a JSON TEXT provenance reference.
|
|
95
|
+
* `confidence` ∈ [0, 1] — certainty of this node's existence / accuracy.
|
|
96
|
+
*/
|
|
97
|
+
const DDL_KNOWLEDGE_NODES = `
|
|
98
|
+
CREATE TABLE IF NOT EXISTS knowledge_nodes (
|
|
99
|
+
id TEXT PRIMARY KEY,
|
|
100
|
+
type TEXT NOT NULL,
|
|
101
|
+
label TEXT NOT NULL,
|
|
102
|
+
properties TEXT NOT NULL DEFAULT '{}',
|
|
103
|
+
embedding BLOB,
|
|
104
|
+
confidence REAL NOT NULL DEFAULT 1.0,
|
|
105
|
+
source TEXT NOT NULL DEFAULT '{}',
|
|
106
|
+
created_at INTEGER NOT NULL
|
|
107
|
+
);
|
|
108
|
+
`;
|
|
109
|
+
/**
|
|
110
|
+
* Knowledge graph edges (typed relationships).
|
|
111
|
+
* Models semantic links between knowledge nodes (e.g. IS_A, HAS_PART, CAUSED_BY).
|
|
112
|
+
*
|
|
113
|
+
* `bidirectional = 1` means the edge applies in both directions (e.g. SIBLING_OF).
|
|
114
|
+
* `weight` ∈ [0, 1] represents relationship strength / confidence.
|
|
115
|
+
*/
|
|
116
|
+
const DDL_KNOWLEDGE_EDGES = `
|
|
117
|
+
CREATE TABLE IF NOT EXISTS knowledge_edges (
|
|
118
|
+
id TEXT PRIMARY KEY,
|
|
119
|
+
source_id TEXT NOT NULL REFERENCES knowledge_nodes(id),
|
|
120
|
+
target_id TEXT NOT NULL REFERENCES knowledge_nodes(id),
|
|
121
|
+
type TEXT NOT NULL,
|
|
122
|
+
weight REAL NOT NULL DEFAULT 1.0,
|
|
123
|
+
bidirectional INTEGER NOT NULL DEFAULT 0,
|
|
124
|
+
metadata TEXT NOT NULL DEFAULT '{}',
|
|
125
|
+
created_at INTEGER NOT NULL
|
|
126
|
+
);
|
|
127
|
+
`;
|
|
128
|
+
/**
|
|
129
|
+
* Ingested document registry.
|
|
130
|
+
*
|
|
131
|
+
* Tracks every external document (PDF, Markdown, web page, etc.) that has
|
|
132
|
+
* been chunked and embedded into this agent's brain.
|
|
133
|
+
*
|
|
134
|
+
* `content_hash` enables idempotent re-ingestion (skip if unchanged).
|
|
135
|
+
*/
|
|
136
|
+
const DDL_DOCUMENTS = `
|
|
137
|
+
CREATE TABLE IF NOT EXISTS documents (
|
|
138
|
+
id TEXT PRIMARY KEY,
|
|
139
|
+
path TEXT NOT NULL,
|
|
140
|
+
format TEXT NOT NULL,
|
|
141
|
+
title TEXT,
|
|
142
|
+
content_hash TEXT NOT NULL,
|
|
143
|
+
chunk_count INTEGER NOT NULL DEFAULT 0,
|
|
144
|
+
metadata TEXT NOT NULL DEFAULT '{}',
|
|
145
|
+
ingested_at INTEGER NOT NULL
|
|
146
|
+
);
|
|
147
|
+
`;
|
|
148
|
+
/**
|
|
149
|
+
* Document chunk table.
|
|
150
|
+
*
|
|
151
|
+
* Each chunk corresponds to a contiguous passage of text extracted from a
|
|
152
|
+
* parent document. `trace_id` links to the corresponding memory trace so
|
|
153
|
+
* retrieval pipelines can cross-reference vector search results.
|
|
154
|
+
*/
|
|
155
|
+
const DDL_DOCUMENT_CHUNKS = `
|
|
156
|
+
CREATE TABLE IF NOT EXISTS document_chunks (
|
|
157
|
+
id TEXT PRIMARY KEY,
|
|
158
|
+
document_id TEXT NOT NULL REFERENCES documents(id),
|
|
159
|
+
trace_id TEXT REFERENCES memory_traces(id),
|
|
160
|
+
content TEXT NOT NULL,
|
|
161
|
+
chunk_index INTEGER NOT NULL,
|
|
162
|
+
page_number INTEGER,
|
|
163
|
+
embedding BLOB
|
|
164
|
+
);
|
|
165
|
+
`;
|
|
166
|
+
/**
|
|
167
|
+
* Document image table.
|
|
168
|
+
*
|
|
169
|
+
* Stores visual assets extracted from documents (e.g. figures, diagrams).
|
|
170
|
+
* `caption` and `embedding` support multimodal retrieval.
|
|
171
|
+
*/
|
|
172
|
+
const DDL_DOCUMENT_IMAGES = `
|
|
173
|
+
CREATE TABLE IF NOT EXISTS document_images (
|
|
174
|
+
id TEXT PRIMARY KEY,
|
|
175
|
+
document_id TEXT NOT NULL REFERENCES documents(id),
|
|
176
|
+
chunk_id TEXT REFERENCES document_chunks(id),
|
|
177
|
+
data BLOB NOT NULL,
|
|
178
|
+
mime_type TEXT NOT NULL,
|
|
179
|
+
caption TEXT,
|
|
180
|
+
page_number INTEGER,
|
|
181
|
+
embedding BLOB
|
|
182
|
+
);
|
|
183
|
+
`;
|
|
184
|
+
/**
|
|
185
|
+
* Consolidation log.
|
|
186
|
+
*
|
|
187
|
+
* Records each offline consolidation run — the analogue of slow-wave sleep
|
|
188
|
+
* memory consolidation. Tracks how many traces were pruned, merged, derived
|
|
189
|
+
* (by inference), or compacted (losslessly compressed).
|
|
190
|
+
*/
|
|
191
|
+
const DDL_CONSOLIDATION_LOG = `
|
|
192
|
+
CREATE TABLE IF NOT EXISTS consolidation_log (
|
|
193
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
194
|
+
ran_at INTEGER NOT NULL,
|
|
195
|
+
pruned INTEGER NOT NULL DEFAULT 0,
|
|
196
|
+
merged INTEGER NOT NULL DEFAULT 0,
|
|
197
|
+
derived INTEGER NOT NULL DEFAULT 0,
|
|
198
|
+
compacted INTEGER NOT NULL DEFAULT 0,
|
|
199
|
+
duration_ms INTEGER NOT NULL DEFAULT 0
|
|
200
|
+
);
|
|
201
|
+
`;
|
|
202
|
+
/**
|
|
203
|
+
* Retrieval feedback signals.
|
|
204
|
+
*
|
|
205
|
+
* Captures explicit (thumbs up/down) or implicit (click, dwell time, follow-up)
|
|
206
|
+
* feedback on retrieved memory traces. Used by the spaced-repetition scheduler
|
|
207
|
+
* to modulate `strength` and `stability` updates (Hebbian reinforcement).
|
|
208
|
+
*
|
|
209
|
+
* `signal` examples: 'positive', 'negative', 'neutral', 'implicit_positive'.
|
|
210
|
+
*/
|
|
211
|
+
const DDL_RETRIEVAL_FEEDBACK = `
|
|
212
|
+
CREATE TABLE IF NOT EXISTS retrieval_feedback (
|
|
213
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
214
|
+
trace_id TEXT NOT NULL REFERENCES memory_traces(id),
|
|
215
|
+
signal TEXT NOT NULL,
|
|
216
|
+
query TEXT,
|
|
217
|
+
created_at INTEGER NOT NULL
|
|
218
|
+
);
|
|
219
|
+
`;
|
|
220
|
+
/**
|
|
221
|
+
* Conversation sessions.
|
|
222
|
+
*
|
|
223
|
+
* Provides a lightweight conversational buffer independent of external message
|
|
224
|
+
* stores. Primarily used for episodic memory encoding (conversation → trace).
|
|
225
|
+
*/
|
|
226
|
+
const DDL_CONVERSATIONS = `
|
|
227
|
+
CREATE TABLE IF NOT EXISTS conversations (
|
|
228
|
+
id TEXT PRIMARY KEY,
|
|
229
|
+
title TEXT,
|
|
230
|
+
created_at INTEGER NOT NULL,
|
|
231
|
+
updated_at INTEGER NOT NULL,
|
|
232
|
+
metadata TEXT NOT NULL DEFAULT '{}'
|
|
233
|
+
);
|
|
234
|
+
`;
|
|
235
|
+
/**
|
|
236
|
+
* Conversation messages.
|
|
237
|
+
*
|
|
238
|
+
* Each message belongs to a conversation. `role` follows the OpenAI convention:
|
|
239
|
+
* 'user' | 'assistant' | 'system' | 'tool'.
|
|
240
|
+
*/
|
|
241
|
+
const DDL_MESSAGES = `
|
|
242
|
+
CREATE TABLE IF NOT EXISTS messages (
|
|
243
|
+
id TEXT PRIMARY KEY,
|
|
244
|
+
conversation_id TEXT NOT NULL REFERENCES conversations(id),
|
|
245
|
+
role TEXT NOT NULL,
|
|
246
|
+
content TEXT NOT NULL,
|
|
247
|
+
created_at INTEGER NOT NULL,
|
|
248
|
+
metadata TEXT NOT NULL DEFAULT '{}'
|
|
249
|
+
);
|
|
250
|
+
`;
|
|
251
|
+
// ---------------------------------------------------------------------------
|
|
252
|
+
// SqliteBrain
|
|
253
|
+
// ---------------------------------------------------------------------------
|
|
254
|
+
/**
|
|
255
|
+
* Unified SQLite connection manager for a single agent's persistent brain.
|
|
256
|
+
*
|
|
257
|
+
* **Usage:**
|
|
258
|
+
* ```ts
|
|
259
|
+
* const brain = new SqliteBrain('/path/to/agent/brain.sqlite');
|
|
260
|
+
*
|
|
261
|
+
* // Direct DB access for subsystems
|
|
262
|
+
* const row = brain.db.prepare('SELECT * FROM memory_traces WHERE id = ?').get(id);
|
|
263
|
+
*
|
|
264
|
+
* // Meta helpers
|
|
265
|
+
* brain.setMeta('last_sync', Date.now().toString());
|
|
266
|
+
* const ver = brain.getMeta('schema_version'); // '1'
|
|
267
|
+
*
|
|
268
|
+
* brain.close();
|
|
269
|
+
* ```
|
|
270
|
+
*
|
|
271
|
+
* Subsystems (MemoryTraceRepository, KnowledgeGraphStore, DocumentChunkStore, etc.)
|
|
272
|
+
* receive the `SqliteBrain` instance and call `brain.db` directly to prepare
|
|
273
|
+
* statements — this avoids redundant connection overhead across subsystems.
|
|
274
|
+
*/
|
|
275
|
+
export class SqliteBrain {
|
|
276
|
+
// ---------------------------------------------------------------------------
|
|
277
|
+
// Constructor
|
|
278
|
+
// ---------------------------------------------------------------------------
|
|
279
|
+
/**
|
|
280
|
+
* Create or open the agent's brain database at `dbPath`.
|
|
281
|
+
*
|
|
282
|
+
* Initialization sequence:
|
|
283
|
+
* 1. Open (or create) the SQLite file.
|
|
284
|
+
* 2. Enable WAL journal mode for concurrent read access.
|
|
285
|
+
* 3. Enable foreign key enforcement (OFF by default in SQLite).
|
|
286
|
+
* 4. Execute the full DDL schema (all `CREATE TABLE IF NOT EXISTS`).
|
|
287
|
+
* 5. Create the FTS5 virtual table for full-text memory search.
|
|
288
|
+
* 6. Seed `brain_meta` with `schema_version` and `created_at` if absent.
|
|
289
|
+
*
|
|
290
|
+
* @param dbPath - Absolute path to the `.sqlite` file. The file is created
|
|
291
|
+
* if it does not exist; parent directories must already exist.
|
|
292
|
+
*/
|
|
293
|
+
constructor(dbPath) {
|
|
294
|
+
this.db = new Database(dbPath);
|
|
295
|
+
// Step 1: WAL mode — allows concurrent reads while a write is in progress.
|
|
296
|
+
// Critical for multi-subsystem access patterns (consolidator + retriever + encoder
|
|
297
|
+
// all touching the same file simultaneously).
|
|
298
|
+
this.db.pragma('journal_mode = WAL');
|
|
299
|
+
// Step 2: Foreign key enforcement — SQLite disables FK checks by default.
|
|
300
|
+
// We want referential integrity between chunks↔documents, edges↔nodes, etc.
|
|
301
|
+
this.db.pragma('foreign_keys = ON');
|
|
302
|
+
// Step 3: Apply full schema in a single transaction for atomicity.
|
|
303
|
+
this._initSchema();
|
|
304
|
+
// Step 4: Seed brain_meta defaults if this is a fresh database.
|
|
305
|
+
this._seedMeta();
|
|
306
|
+
}
|
|
307
|
+
// ---------------------------------------------------------------------------
|
|
308
|
+
// Private init helpers
|
|
309
|
+
// ---------------------------------------------------------------------------
|
|
310
|
+
/**
|
|
311
|
+
* Execute all DDL statements inside a single transaction.
|
|
312
|
+
* `CREATE TABLE IF NOT EXISTS` is idempotent, so re-running on an existing
|
|
313
|
+
* database is safe — no data is lost.
|
|
314
|
+
*/
|
|
315
|
+
_initSchema() {
|
|
316
|
+
const initTx = this.db.transaction(() => {
|
|
317
|
+
this.db.exec(DDL_BRAIN_META);
|
|
318
|
+
this.db.exec(DDL_MEMORY_TRACES);
|
|
319
|
+
this.db.exec(DDL_KNOWLEDGE_NODES);
|
|
320
|
+
this.db.exec(DDL_KNOWLEDGE_EDGES);
|
|
321
|
+
this.db.exec(DDL_DOCUMENTS);
|
|
322
|
+
this.db.exec(DDL_DOCUMENT_CHUNKS);
|
|
323
|
+
this.db.exec(DDL_DOCUMENT_IMAGES);
|
|
324
|
+
this.db.exec(DDL_CONSOLIDATION_LOG);
|
|
325
|
+
this.db.exec(DDL_RETRIEVAL_FEEDBACK);
|
|
326
|
+
this.db.exec(DDL_CONVERSATIONS);
|
|
327
|
+
this.db.exec(DDL_MESSAGES);
|
|
328
|
+
// FTS5 virtual table (must be last; depends on memory_traces existing)
|
|
329
|
+
this.db.exec(DDL_MEMORY_TRACES_FTS);
|
|
330
|
+
});
|
|
331
|
+
initTx();
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Seed `brain_meta` with mandatory keys on first creation.
|
|
335
|
+
* Uses INSERT OR IGNORE to be idempotent on subsequent opens.
|
|
336
|
+
*/
|
|
337
|
+
_seedMeta() {
|
|
338
|
+
const insert = this.db.prepare(`INSERT OR IGNORE INTO brain_meta (key, value) VALUES (?, ?)`);
|
|
339
|
+
const seedTx = this.db.transaction(() => {
|
|
340
|
+
insert.run('schema_version', SCHEMA_VERSION);
|
|
341
|
+
insert.run('created_at', Date.now().toString());
|
|
342
|
+
});
|
|
343
|
+
seedTx();
|
|
344
|
+
}
|
|
345
|
+
// ---------------------------------------------------------------------------
|
|
346
|
+
// Public API
|
|
347
|
+
// ---------------------------------------------------------------------------
|
|
348
|
+
/**
|
|
349
|
+
* Read a value from the `brain_meta` key-value store.
|
|
350
|
+
*
|
|
351
|
+
* @param key - The metadata key to look up.
|
|
352
|
+
* @returns The stored string value, or `undefined` if the key does not exist.
|
|
353
|
+
*/
|
|
354
|
+
getMeta(key) {
|
|
355
|
+
const row = this.db
|
|
356
|
+
.prepare('SELECT value FROM brain_meta WHERE key = ?')
|
|
357
|
+
.get(key);
|
|
358
|
+
return row?.value;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Upsert a value into the `brain_meta` key-value store.
|
|
362
|
+
*
|
|
363
|
+
* Uses `INSERT OR REPLACE` semantics — creates the row if absent, or
|
|
364
|
+
* overwrites if present.
|
|
365
|
+
*
|
|
366
|
+
* @param key - The metadata key.
|
|
367
|
+
* @param value - The string value to store.
|
|
368
|
+
*/
|
|
369
|
+
setMeta(key, value) {
|
|
370
|
+
this.db
|
|
371
|
+
.prepare('INSERT OR REPLACE INTO brain_meta (key, value) VALUES (?, ?)')
|
|
372
|
+
.run(key, value);
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Check whether a given embedding dimension is compatible with this brain.
|
|
376
|
+
*
|
|
377
|
+
* On first call (no stored `embedding_dimensions`), returns `true` and stores
|
|
378
|
+
* the provided dimension for future compatibility checks.
|
|
379
|
+
*
|
|
380
|
+
* Subsequent calls compare `dimensions` against the stored value.
|
|
381
|
+
* Mismatches indicate that a different embedding model was used to encode
|
|
382
|
+
* memories — mixing dimensions would corrupt vector similarity searches.
|
|
383
|
+
*
|
|
384
|
+
* @param dimensions - The embedding vector length to check (e.g. 1536 for OpenAI ada-002).
|
|
385
|
+
* @returns `true` if compatible (or no prior value), `false` on mismatch.
|
|
386
|
+
*/
|
|
387
|
+
checkEmbeddingCompat(dimensions) {
|
|
388
|
+
const stored = this.getMeta('embedding_dimensions');
|
|
389
|
+
if (stored === undefined) {
|
|
390
|
+
// First embedding model encounter — store and accept.
|
|
391
|
+
this.setMeta('embedding_dimensions', String(dimensions));
|
|
392
|
+
return true;
|
|
393
|
+
}
|
|
394
|
+
return parseInt(stored, 10) === dimensions;
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Close the database connection.
|
|
398
|
+
*
|
|
399
|
+
* Must be called when the agent shuts down to flush the WAL and release
|
|
400
|
+
* the file lock. Failing to close may leave the database in WAL mode with
|
|
401
|
+
* an unconsumed WAL file.
|
|
402
|
+
*/
|
|
403
|
+
close() {
|
|
404
|
+
this.db.close();
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
//# sourceMappingURL=SqliteBrain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SqliteBrain.js","sourceRoot":"","sources":["../../../src/memory/store/SqliteBrain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E,+EAA+E;AAC/E,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E;;;GAGG;AACH,MAAM,cAAc,GAAG;;;;;CAKtB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAA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