@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.
Files changed (176) hide show
  1. package/README.md +16 -0
  2. package/dist/memory/config.d.ts +39 -0
  3. package/dist/memory/config.d.ts.map +1 -1
  4. package/dist/memory/config.js.map +1 -1
  5. package/dist/memory/consolidation/ConsolidationLoop.d.ts +177 -0
  6. package/dist/memory/consolidation/ConsolidationLoop.d.ts.map +1 -0
  7. package/dist/memory/consolidation/ConsolidationLoop.js +517 -0
  8. package/dist/memory/consolidation/ConsolidationLoop.js.map +1 -0
  9. package/dist/memory/consolidation/ConsolidationPipeline.d.ts.map +1 -1
  10. package/dist/memory/consolidation/ConsolidationPipeline.js +7 -0
  11. package/dist/memory/consolidation/ConsolidationPipeline.js.map +1 -1
  12. package/dist/memory/consolidation/index.d.ts +8 -0
  13. package/dist/memory/consolidation/index.d.ts.map +1 -0
  14. package/dist/memory/consolidation/index.js +7 -0
  15. package/dist/memory/consolidation/index.js.map +1 -0
  16. package/dist/memory/decay/DecayModel.d.ts +33 -0
  17. package/dist/memory/decay/DecayModel.d.ts.map +1 -1
  18. package/dist/memory/decay/DecayModel.js +31 -0
  19. package/dist/memory/decay/DecayModel.js.map +1 -1
  20. package/dist/memory/facade/Memory.d.ts +228 -0
  21. package/dist/memory/facade/Memory.d.ts.map +1 -0
  22. package/dist/memory/facade/Memory.js +823 -0
  23. package/dist/memory/facade/Memory.js.map +1 -0
  24. package/dist/memory/facade/index.d.ts +13 -0
  25. package/dist/memory/facade/index.d.ts.map +1 -0
  26. package/dist/memory/facade/index.js +11 -0
  27. package/dist/memory/facade/index.js.map +1 -0
  28. package/dist/memory/facade/types.d.ts +606 -0
  29. package/dist/memory/facade/types.d.ts.map +1 -0
  30. package/dist/memory/facade/types.js +11 -0
  31. package/dist/memory/facade/types.js.map +1 -0
  32. package/dist/memory/feedback/RetrievalFeedbackSignal.d.ts +132 -0
  33. package/dist/memory/feedback/RetrievalFeedbackSignal.d.ts.map +1 -0
  34. package/dist/memory/feedback/RetrievalFeedbackSignal.js +178 -0
  35. package/dist/memory/feedback/RetrievalFeedbackSignal.js.map +1 -0
  36. package/dist/memory/feedback/index.d.ts +13 -0
  37. package/dist/memory/feedback/index.d.ts.map +1 -0
  38. package/dist/memory/feedback/index.js +12 -0
  39. package/dist/memory/feedback/index.js.map +1 -0
  40. package/dist/memory/index.d.ts +22 -0
  41. package/dist/memory/index.d.ts.map +1 -1
  42. package/dist/memory/index.js +24 -0
  43. package/dist/memory/index.js.map +1 -1
  44. package/dist/memory/ingestion/ChunkingEngine.d.ts +143 -0
  45. package/dist/memory/ingestion/ChunkingEngine.d.ts.map +1 -0
  46. package/dist/memory/ingestion/ChunkingEngine.js +508 -0
  47. package/dist/memory/ingestion/ChunkingEngine.js.map +1 -0
  48. package/dist/memory/ingestion/DoclingLoader.d.ts +44 -0
  49. package/dist/memory/ingestion/DoclingLoader.d.ts.map +1 -0
  50. package/dist/memory/ingestion/DoclingLoader.js +228 -0
  51. package/dist/memory/ingestion/DoclingLoader.js.map +1 -0
  52. package/dist/memory/ingestion/DocxLoader.d.ts +37 -0
  53. package/dist/memory/ingestion/DocxLoader.d.ts.map +1 -0
  54. package/dist/memory/ingestion/DocxLoader.js +111 -0
  55. package/dist/memory/ingestion/DocxLoader.js.map +1 -0
  56. package/dist/memory/ingestion/FolderScanner.d.ts +116 -0
  57. package/dist/memory/ingestion/FolderScanner.d.ts.map +1 -0
  58. package/dist/memory/ingestion/FolderScanner.js +127 -0
  59. package/dist/memory/ingestion/FolderScanner.js.map +1 -0
  60. package/dist/memory/ingestion/HtmlLoader.d.ts +49 -0
  61. package/dist/memory/ingestion/HtmlLoader.d.ts.map +1 -0
  62. package/dist/memory/ingestion/HtmlLoader.js +202 -0
  63. package/dist/memory/ingestion/HtmlLoader.js.map +1 -0
  64. package/dist/memory/ingestion/IDocumentLoader.d.ts +63 -0
  65. package/dist/memory/ingestion/IDocumentLoader.d.ts.map +1 -0
  66. package/dist/memory/ingestion/IDocumentLoader.js +11 -0
  67. package/dist/memory/ingestion/IDocumentLoader.js.map +1 -0
  68. package/dist/memory/ingestion/LoaderRegistry.d.ts +140 -0
  69. package/dist/memory/ingestion/LoaderRegistry.d.ts.map +1 -0
  70. package/dist/memory/ingestion/LoaderRegistry.js +229 -0
  71. package/dist/memory/ingestion/LoaderRegistry.js.map +1 -0
  72. package/dist/memory/ingestion/MarkdownLoader.d.ts +50 -0
  73. package/dist/memory/ingestion/MarkdownLoader.d.ts.map +1 -0
  74. package/dist/memory/ingestion/MarkdownLoader.js +169 -0
  75. package/dist/memory/ingestion/MarkdownLoader.js.map +1 -0
  76. package/dist/memory/ingestion/MultimodalAggregator.d.ts +88 -0
  77. package/dist/memory/ingestion/MultimodalAggregator.d.ts.map +1 -0
  78. package/dist/memory/ingestion/MultimodalAggregator.js +96 -0
  79. package/dist/memory/ingestion/MultimodalAggregator.js.map +1 -0
  80. package/dist/memory/ingestion/OcrPdfLoader.d.ts +41 -0
  81. package/dist/memory/ingestion/OcrPdfLoader.d.ts.map +1 -0
  82. package/dist/memory/ingestion/OcrPdfLoader.js +149 -0
  83. package/dist/memory/ingestion/OcrPdfLoader.js.map +1 -0
  84. package/dist/memory/ingestion/PdfLoader.d.ts +78 -0
  85. package/dist/memory/ingestion/PdfLoader.d.ts.map +1 -0
  86. package/dist/memory/ingestion/PdfLoader.js +179 -0
  87. package/dist/memory/ingestion/PdfLoader.js.map +1 -0
  88. package/dist/memory/ingestion/TextLoader.d.ts +66 -0
  89. package/dist/memory/ingestion/TextLoader.d.ts.map +1 -0
  90. package/dist/memory/ingestion/TextLoader.js +207 -0
  91. package/dist/memory/ingestion/TextLoader.js.map +1 -0
  92. package/dist/memory/ingestion/UrlLoader.d.ts +95 -0
  93. package/dist/memory/ingestion/UrlLoader.d.ts.map +1 -0
  94. package/dist/memory/ingestion/UrlLoader.js +174 -0
  95. package/dist/memory/ingestion/UrlLoader.js.map +1 -0
  96. package/dist/memory/io/ChatGptImporter.d.ts +85 -0
  97. package/dist/memory/io/ChatGptImporter.d.ts.map +1 -0
  98. package/dist/memory/io/ChatGptImporter.js +231 -0
  99. package/dist/memory/io/ChatGptImporter.js.map +1 -0
  100. package/dist/memory/io/JsonExporter.d.ts +67 -0
  101. package/dist/memory/io/JsonExporter.d.ts.map +1 -0
  102. package/dist/memory/io/JsonExporter.js +132 -0
  103. package/dist/memory/io/JsonExporter.js.map +1 -0
  104. package/dist/memory/io/JsonImporter.d.ts +84 -0
  105. package/dist/memory/io/JsonImporter.d.ts.map +1 -0
  106. package/dist/memory/io/JsonImporter.js +234 -0
  107. package/dist/memory/io/JsonImporter.js.map +1 -0
  108. package/dist/memory/io/MarkdownExporter.d.ts +95 -0
  109. package/dist/memory/io/MarkdownExporter.d.ts.map +1 -0
  110. package/dist/memory/io/MarkdownExporter.js +130 -0
  111. package/dist/memory/io/MarkdownExporter.js.map +1 -0
  112. package/dist/memory/io/MarkdownImporter.d.ts +84 -0
  113. package/dist/memory/io/MarkdownImporter.d.ts.map +1 -0
  114. package/dist/memory/io/MarkdownImporter.js +166 -0
  115. package/dist/memory/io/MarkdownImporter.js.map +1 -0
  116. package/dist/memory/io/ObsidianExporter.d.ts +80 -0
  117. package/dist/memory/io/ObsidianExporter.d.ts.map +1 -0
  118. package/dist/memory/io/ObsidianExporter.js +127 -0
  119. package/dist/memory/io/ObsidianExporter.js.map +1 -0
  120. package/dist/memory/io/ObsidianImporter.d.ts +93 -0
  121. package/dist/memory/io/ObsidianImporter.d.ts.map +1 -0
  122. package/dist/memory/io/ObsidianImporter.js +221 -0
  123. package/dist/memory/io/ObsidianImporter.js.map +1 -0
  124. package/dist/memory/io/SqliteExporter.d.ts +47 -0
  125. package/dist/memory/io/SqliteExporter.d.ts.map +1 -0
  126. package/dist/memory/io/SqliteExporter.js +56 -0
  127. package/dist/memory/io/SqliteExporter.js.map +1 -0
  128. package/dist/memory/io/SqliteImporter.d.ts +82 -0
  129. package/dist/memory/io/SqliteImporter.d.ts.map +1 -0
  130. package/dist/memory/io/SqliteImporter.js +232 -0
  131. package/dist/memory/io/SqliteImporter.js.map +1 -0
  132. package/dist/memory/io/index.d.ts +31 -0
  133. package/dist/memory/io/index.d.ts.map +1 -0
  134. package/dist/memory/io/index.js +31 -0
  135. package/dist/memory/io/index.js.map +1 -0
  136. package/dist/memory/store/SqliteBrain.d.ts +125 -0
  137. package/dist/memory/store/SqliteBrain.d.ts.map +1 -0
  138. package/dist/memory/store/SqliteBrain.js +407 -0
  139. package/dist/memory/store/SqliteBrain.js.map +1 -0
  140. package/dist/memory/store/SqliteKnowledgeGraph.d.ts +259 -0
  141. package/dist/memory/store/SqliteKnowledgeGraph.d.ts.map +1 -0
  142. package/dist/memory/store/SqliteKnowledgeGraph.js +1062 -0
  143. package/dist/memory/store/SqliteKnowledgeGraph.js.map +1 -0
  144. package/dist/memory/store/SqliteMemoryGraph.d.ts +251 -0
  145. package/dist/memory/store/SqliteMemoryGraph.d.ts.map +1 -0
  146. package/dist/memory/store/SqliteMemoryGraph.js +637 -0
  147. package/dist/memory/store/SqliteMemoryGraph.js.map +1 -0
  148. package/dist/memory/tools/MemoryAddTool.d.ts +98 -0
  149. package/dist/memory/tools/MemoryAddTool.d.ts.map +1 -0
  150. package/dist/memory/tools/MemoryAddTool.js +131 -0
  151. package/dist/memory/tools/MemoryAddTool.js.map +1 -0
  152. package/dist/memory/tools/MemoryDeleteTool.d.ts +83 -0
  153. package/dist/memory/tools/MemoryDeleteTool.d.ts.map +1 -0
  154. package/dist/memory/tools/MemoryDeleteTool.js +96 -0
  155. package/dist/memory/tools/MemoryDeleteTool.js.map +1 -0
  156. package/dist/memory/tools/MemoryMergeTool.d.ts +95 -0
  157. package/dist/memory/tools/MemoryMergeTool.d.ts.map +1 -0
  158. package/dist/memory/tools/MemoryMergeTool.js +164 -0
  159. package/dist/memory/tools/MemoryMergeTool.js.map +1 -0
  160. package/dist/memory/tools/MemoryReflectTool.d.ts +86 -0
  161. package/dist/memory/tools/MemoryReflectTool.d.ts.map +1 -0
  162. package/dist/memory/tools/MemoryReflectTool.js +102 -0
  163. package/dist/memory/tools/MemoryReflectTool.js.map +1 -0
  164. package/dist/memory/tools/MemorySearchTool.d.ts +117 -0
  165. package/dist/memory/tools/MemorySearchTool.d.ts.map +1 -0
  166. package/dist/memory/tools/MemorySearchTool.js +162 -0
  167. package/dist/memory/tools/MemorySearchTool.js.map +1 -0
  168. package/dist/memory/tools/MemoryUpdateTool.d.ts +92 -0
  169. package/dist/memory/tools/MemoryUpdateTool.d.ts.map +1 -0
  170. package/dist/memory/tools/MemoryUpdateTool.js +125 -0
  171. package/dist/memory/tools/MemoryUpdateTool.js.map +1 -0
  172. package/dist/memory/tools/index.d.ts +32 -0
  173. package/dist/memory/tools/index.d.ts.map +1 -0
  174. package/dist/memory/tools/index.js +26 -0
  175. package/dist/memory/tools/index.js.map +1 -0
  176. package/package.json +6 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/memory/facade/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAMD;;;;;;GAMG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAC;IAE1C;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;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AC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAC;IAE3B;;OAEG;IACH,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC;IAEzB;;;OAGG;IACH,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAE1B;;OAEG;IACH,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAE1B;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @fileoverview Public API types for the Memory facade.
3
+ *
4
+ * These types form the stable, public-facing contract for the Memory subsystem.
5
+ * They are intentionally independent of internal cognitive-science machinery so
6
+ * consumers only need to import from this file rather than from deep internals.
7
+ *
8
+ * @module memory/facade/types
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/memory/facade/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
@@ -0,0 +1,132 @@
1
+ /**
2
+ * @fileoverview Retrieval feedback signal — detects which injected memory
3
+ * traces were actually used vs ignored by the LLM response.
4
+ *
5
+ * ## Why this exists
6
+ * When the memory system injects context traces into a prompt, not all of
7
+ * them will be relevant to the model's generated response. Tracking which
8
+ * memories were actually referenced allows the spaced-repetition engine to:
9
+ * - Reinforce genuinely helpful memories (via `updateOnRetrieval`).
10
+ * - Accelerate decay on repeatedly-ignored memories (via `penalizeUnused`).
11
+ *
12
+ * ## Detection heuristic
13
+ * A keyword overlap heuristic is used instead of a full LLM call to keep
14
+ * the feedback loop non-blocking and low-latency:
15
+ * 1. Extract unique words > 4 characters from each trace's content.
16
+ * 2. Check how many of those keywords appear in the LLM's response.
17
+ * 3. If matchRatio > 0.30 → signal = 'used', otherwise 'ignored'.
18
+ *
19
+ * An optional `similarityFn` can be injected for higher-fidelity semantic
20
+ * detection, but is not required for the default path.
21
+ *
22
+ * ## Persistence
23
+ * Each feedback event is written synchronously to the `retrieval_feedback`
24
+ * table in the agent's `SqliteBrain`. The `detect()` method therefore
25
+ * requires that a corresponding row exists in `memory_traces` for every
26
+ * trace passed in (i.e. the trace must already be persisted).
27
+ *
28
+ * @module agentos/memory/feedback/RetrievalFeedbackSignal
29
+ */
30
+ import type { MemoryTrace } from '../types.js';
31
+ import type { SqliteBrain } from '../store/SqliteBrain.js';
32
+ /**
33
+ * A single retrieval feedback event for one memory trace.
34
+ *
35
+ * `signal`:
36
+ * - `'used'` — the LLM's response contained enough keywords from this trace
37
+ * to be considered referenced (matchRatio > 0.30).
38
+ * - `'ignored'` — the LLM did not appear to use this trace in its response.
39
+ *
40
+ * `context` carries the query or situational description that was active at
41
+ * feedback time. Stored in the `query` column of `retrieval_feedback`.
42
+ */
43
+ export interface RetrievalFeedback {
44
+ /** The ID of the memory trace this feedback relates to. */
45
+ traceId: string;
46
+ /** Whether the trace was referenced by the LLM response. */
47
+ signal: 'used' | 'ignored';
48
+ /** Optional contextual string (e.g. the original user query). */
49
+ context?: string;
50
+ /** Unix ms timestamp when the feedback was recorded. */
51
+ timestamp: number;
52
+ }
53
+ /**
54
+ * Detects which injected memory traces were used vs ignored by the LLM, and
55
+ * persists those signals to the `retrieval_feedback` table.
56
+ *
57
+ * **Lifecycle:**
58
+ * 1. Before generation: retrieve relevant traces and inject them into the prompt.
59
+ * 2. After response delivery (non-blocking): call `detect(injectedTraces, response)`.
60
+ * 3. The decay pipeline reads `getStats(traceId)` during consolidation and
61
+ * applies `penalizeUnused` / `updateOnRetrieval` accordingly.
62
+ */
63
+ export declare class RetrievalFeedbackSignal {
64
+ private readonly brain;
65
+ private readonly similarityFn?;
66
+ /**
67
+ * @param brain - The agent's SQLite brain; used to persist and query feedback rows.
68
+ * @param similarityFn - Optional semantic similarity function for higher-fidelity detection.
69
+ * Receives two strings and returns a promise of a similarity score in [0, 1].
70
+ * When provided, the score supplements the keyword heuristic, but the
71
+ * current implementation uses the keyword path only (reserved for future use).
72
+ */
73
+ constructor(brain: SqliteBrain, similarityFn?: ((a: string, b: string) => Promise<number>) | undefined);
74
+ /**
75
+ * Detect which of the injected traces were referenced in `response`, persist
76
+ * the signals to `retrieval_feedback`, and return the full feedback array.
77
+ *
78
+ * **Keyword heuristic:**
79
+ * - Extract all words > 4 characters from each trace's `content` field,
80
+ * lowercased and stripped of non-alphanumeric characters.
81
+ * - Compute `matchRatio = (words found in response) / (unique keywords)`.
82
+ * - Signal = `'used'` if matchRatio > 0.30, else `'ignored'`.
83
+ *
84
+ * When a trace has no qualifying keywords (all words ≤ 4 characters), it is
85
+ * treated as `'ignored'` — there is nothing to match against.
86
+ *
87
+ * **Note:** `detect()` is synchronous under the hood (better-sqlite3) but
88
+ * declared `async` to allow future replacement with an LLM-backed detector.
89
+ *
90
+ * @param injectedTraces - Memory traces that were injected into the prompt.
91
+ * @param response - The LLM's generated response text.
92
+ * @returns Array of `RetrievalFeedback` events, one per injected trace.
93
+ */
94
+ detect(injectedTraces: MemoryTrace[], response: string): Promise<RetrievalFeedback[]>;
95
+ /**
96
+ * Retrieve the feedback history for a single trace, ordered by most-recent
97
+ * first.
98
+ *
99
+ * @param traceId - The memory trace ID to look up.
100
+ * @param limit - Maximum number of rows to return. Defaults to 100.
101
+ * @returns Array of `RetrievalFeedback` events, most-recent first.
102
+ */
103
+ getHistory(traceId: string, limit?: number): RetrievalFeedback[];
104
+ /**
105
+ * Return aggregate counts of `'used'` and `'ignored'` signals for a trace.
106
+ *
107
+ * Useful for the consolidation pipeline to decide whether to apply
108
+ * `penalizeUnused` (many ignores) or `updateOnRetrieval` (many used).
109
+ *
110
+ * @param traceId - The memory trace ID to aggregate.
111
+ * @returns `{ used, ignored }` counts.
112
+ */
113
+ getStats(traceId: string): {
114
+ used: number;
115
+ ignored: number;
116
+ };
117
+ /**
118
+ * Extract unique keywords from a text string.
119
+ *
120
+ * A keyword is any word that:
121
+ * - Has more than 4 characters after stripping non-alphanumeric characters.
122
+ * - Is lowercased.
123
+ *
124
+ * Short stop-words (≤ 4 chars) are excluded because they appear in almost
125
+ * every response and would inflate `matchRatio` without providing signal.
126
+ *
127
+ * @param text - The source text (typically a trace's `content` field).
128
+ * @returns Deduplicated array of lowercase keywords longer than 4 characters.
129
+ */
130
+ private _extractKeywords;
131
+ }
132
+ //# sourceMappingURL=RetrievalFeedbackSignal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RetrievalFeedbackSignal.d.ts","sourceRoot":"","sources":["../../../src/memory/feedback/RetrievalFeedbackSignal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAM3D;;;;;;;;;;GAUG;AACH,MAAM,WAAW,iBAAiB;IAChC,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAC;CACnB;AAmBD;;;;;;;;;GASG;AACH,qBAAa,uBAAuB;IAShC,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;IAThC;;;;;;OAMG;gBAEgB,KAAK,EAAE,WAAW,EAClB,YAAY,CAAC,GAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,aAAA;IAO3E;;;;;;;;;;;;;;;;;;;OAmBG;IACG,MAAM,CACV,cAAc,EAAE,WAAW,EAAE,EAC7B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAkC/B;;;;;;;OAOG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,SAAM,GAAG,iBAAiB,EAAE;IAmB7D;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;IAyB5D;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,gBAAgB;CAUzB"}
@@ -0,0 +1,178 @@
1
+ /**
2
+ * @fileoverview Retrieval feedback signal — detects which injected memory
3
+ * traces were actually used vs ignored by the LLM response.
4
+ *
5
+ * ## Why this exists
6
+ * When the memory system injects context traces into a prompt, not all of
7
+ * them will be relevant to the model's generated response. Tracking which
8
+ * memories were actually referenced allows the spaced-repetition engine to:
9
+ * - Reinforce genuinely helpful memories (via `updateOnRetrieval`).
10
+ * - Accelerate decay on repeatedly-ignored memories (via `penalizeUnused`).
11
+ *
12
+ * ## Detection heuristic
13
+ * A keyword overlap heuristic is used instead of a full LLM call to keep
14
+ * the feedback loop non-blocking and low-latency:
15
+ * 1. Extract unique words > 4 characters from each trace's content.
16
+ * 2. Check how many of those keywords appear in the LLM's response.
17
+ * 3. If matchRatio > 0.30 → signal = 'used', otherwise 'ignored'.
18
+ *
19
+ * An optional `similarityFn` can be injected for higher-fidelity semantic
20
+ * detection, but is not required for the default path.
21
+ *
22
+ * ## Persistence
23
+ * Each feedback event is written synchronously to the `retrieval_feedback`
24
+ * table in the agent's `SqliteBrain`. The `detect()` method therefore
25
+ * requires that a corresponding row exists in `memory_traces` for every
26
+ * trace passed in (i.e. the trace must already be persisted).
27
+ *
28
+ * @module agentos/memory/feedback/RetrievalFeedbackSignal
29
+ */
30
+ // ---------------------------------------------------------------------------
31
+ // RetrievalFeedbackSignal
32
+ // ---------------------------------------------------------------------------
33
+ /**
34
+ * Detects which injected memory traces were used vs ignored by the LLM, and
35
+ * persists those signals to the `retrieval_feedback` table.
36
+ *
37
+ * **Lifecycle:**
38
+ * 1. Before generation: retrieve relevant traces and inject them into the prompt.
39
+ * 2. After response delivery (non-blocking): call `detect(injectedTraces, response)`.
40
+ * 3. The decay pipeline reads `getStats(traceId)` during consolidation and
41
+ * applies `penalizeUnused` / `updateOnRetrieval` accordingly.
42
+ */
43
+ export class RetrievalFeedbackSignal {
44
+ /**
45
+ * @param brain - The agent's SQLite brain; used to persist and query feedback rows.
46
+ * @param similarityFn - Optional semantic similarity function for higher-fidelity detection.
47
+ * Receives two strings and returns a promise of a similarity score in [0, 1].
48
+ * When provided, the score supplements the keyword heuristic, but the
49
+ * current implementation uses the keyword path only (reserved for future use).
50
+ */
51
+ constructor(brain, similarityFn) {
52
+ this.brain = brain;
53
+ this.similarityFn = similarityFn;
54
+ }
55
+ // ---------------------------------------------------------------------------
56
+ // Public API
57
+ // ---------------------------------------------------------------------------
58
+ /**
59
+ * Detect which of the injected traces were referenced in `response`, persist
60
+ * the signals to `retrieval_feedback`, and return the full feedback array.
61
+ *
62
+ * **Keyword heuristic:**
63
+ * - Extract all words > 4 characters from each trace's `content` field,
64
+ * lowercased and stripped of non-alphanumeric characters.
65
+ * - Compute `matchRatio = (words found in response) / (unique keywords)`.
66
+ * - Signal = `'used'` if matchRatio > 0.30, else `'ignored'`.
67
+ *
68
+ * When a trace has no qualifying keywords (all words ≤ 4 characters), it is
69
+ * treated as `'ignored'` — there is nothing to match against.
70
+ *
71
+ * **Note:** `detect()` is synchronous under the hood (better-sqlite3) but
72
+ * declared `async` to allow future replacement with an LLM-backed detector.
73
+ *
74
+ * @param injectedTraces - Memory traces that were injected into the prompt.
75
+ * @param response - The LLM's generated response text.
76
+ * @returns Array of `RetrievalFeedback` events, one per injected trace.
77
+ */
78
+ async detect(injectedTraces, response) {
79
+ const responseLower = response.toLowerCase();
80
+ const feedbacks = [];
81
+ const now = Date.now();
82
+ const insertStmt = this.brain.db.prepare(`INSERT INTO retrieval_feedback (trace_id, signal, query, created_at)
83
+ VALUES (?, ?, ?, ?)`);
84
+ for (const trace of injectedTraces) {
85
+ const keywords = this._extractKeywords(trace.content);
86
+ let signal = 'ignored';
87
+ if (keywords.length > 0) {
88
+ const matchCount = keywords.filter((kw) => responseLower.includes(kw)).length;
89
+ const matchRatio = matchCount / keywords.length;
90
+ if (matchRatio > 0.3) {
91
+ signal = 'used';
92
+ }
93
+ }
94
+ insertStmt.run(trace.id, signal, null, now);
95
+ feedbacks.push({
96
+ traceId: trace.id,
97
+ signal,
98
+ timestamp: now,
99
+ });
100
+ }
101
+ return feedbacks;
102
+ }
103
+ /**
104
+ * Retrieve the feedback history for a single trace, ordered by most-recent
105
+ * first.
106
+ *
107
+ * @param traceId - The memory trace ID to look up.
108
+ * @param limit - Maximum number of rows to return. Defaults to 100.
109
+ * @returns Array of `RetrievalFeedback` events, most-recent first.
110
+ */
111
+ getHistory(traceId, limit = 100) {
112
+ const rows = this.brain.db
113
+ .prepare(`SELECT id, trace_id, signal, query, created_at
114
+ FROM retrieval_feedback
115
+ WHERE trace_id = ?
116
+ ORDER BY created_at DESC, id DESC
117
+ LIMIT ?`)
118
+ .all(traceId, limit);
119
+ return rows.map((row) => ({
120
+ traceId: row.trace_id,
121
+ signal: row.signal,
122
+ context: row.query ?? undefined,
123
+ timestamp: row.created_at,
124
+ }));
125
+ }
126
+ /**
127
+ * Return aggregate counts of `'used'` and `'ignored'` signals for a trace.
128
+ *
129
+ * Useful for the consolidation pipeline to decide whether to apply
130
+ * `penalizeUnused` (many ignores) or `updateOnRetrieval` (many used).
131
+ *
132
+ * @param traceId - The memory trace ID to aggregate.
133
+ * @returns `{ used, ignored }` counts.
134
+ */
135
+ getStats(traceId) {
136
+ const rows = this.brain.db
137
+ .prepare(`SELECT signal, COUNT(*) AS count
138
+ FROM retrieval_feedback
139
+ WHERE trace_id = ?
140
+ GROUP BY signal`)
141
+ .all(traceId);
142
+ let used = 0;
143
+ let ignored = 0;
144
+ for (const row of rows) {
145
+ if (row.signal === 'used')
146
+ used = row.count;
147
+ else if (row.signal === 'ignored')
148
+ ignored = row.count;
149
+ }
150
+ return { used, ignored };
151
+ }
152
+ // ---------------------------------------------------------------------------
153
+ // Private helpers
154
+ // ---------------------------------------------------------------------------
155
+ /**
156
+ * Extract unique keywords from a text string.
157
+ *
158
+ * A keyword is any word that:
159
+ * - Has more than 4 characters after stripping non-alphanumeric characters.
160
+ * - Is lowercased.
161
+ *
162
+ * Short stop-words (≤ 4 chars) are excluded because they appear in almost
163
+ * every response and would inflate `matchRatio` without providing signal.
164
+ *
165
+ * @param text - The source text (typically a trace's `content` field).
166
+ * @returns Deduplicated array of lowercase keywords longer than 4 characters.
167
+ */
168
+ _extractKeywords(text) {
169
+ const words = text
170
+ .toLowerCase()
171
+ .split(/\s+/)
172
+ .map((w) => w.replace(/[^a-z0-9]/g, ''))
173
+ .filter((w) => w.length > 4);
174
+ // Return deduplicated list using a Set for uniqueness.
175
+ return [...new Set(words)];
176
+ }
177
+ }
178
+ //# sourceMappingURL=RetrievalFeedbackSignal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RetrievalFeedbackSignal.js","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,EAAE,CAAC;IAC3B,CAAC;IAED,8EAA8E;IAC9E,kBAAkB;IAClB,8EAA8E;IAE9E;;;;;;;;;;;;OAYG;IACK,gBAAgB,CAAC,IAAY;QACnC,MAAM,KAAK,GAAG,IAAI;aACf,WAAW,EAAE;aACb,KAAK,CAAC,KAAK,CAAC;aACZ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;aACvC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAE/B,uDAAuD;QACvD,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7B,CAAC;CACF"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @fileoverview Barrel export for the retrieval feedback subsystem.
3
+ *
4
+ * The feedback module provides:
5
+ * - `RetrievalFeedbackSignal` — detects used vs ignored memory traces and
6
+ * persists those signals to the agent's SQLite brain.
7
+ * - `RetrievalFeedback` — the typed event shape for a single feedback record.
8
+ *
9
+ * @module agentos/memory/feedback
10
+ */
11
+ export { RetrievalFeedbackSignal } from './RetrievalFeedbackSignal.js';
12
+ export type { RetrievalFeedback } from './RetrievalFeedbackSignal.js';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/memory/feedback/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,YAAY,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @fileoverview Barrel export for the retrieval feedback subsystem.
3
+ *
4
+ * The feedback module provides:
5
+ * - `RetrievalFeedbackSignal` — detects used vs ignored memory traces and
6
+ * persists those signals to the agent's SQLite brain.
7
+ * - `RetrievalFeedback` — the typed event shape for a single feedback record.
8
+ *
9
+ * @module agentos/memory/feedback
10
+ */
11
+ export { RetrievalFeedbackSignal } from './RetrievalFeedbackSignal.js';
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/memory/feedback/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -56,4 +56,26 @@ export { MarkdownWorkingMemory } from './working/MarkdownWorkingMemory.js';
56
56
  export type { WriteResult } from './working/MarkdownWorkingMemory.js';
57
57
  export { UpdateWorkingMemoryTool } from './working/UpdateWorkingMemoryTool.js';
58
58
  export { ReadWorkingMemoryTool } from './working/ReadWorkingMemoryTool.js';
59
+ export { Memory } from './facade/index.js';
60
+ export type { ScoredTrace } from './facade/index.js';
61
+ export type { MemoryConfig, EmbeddingConfig, ExtendedConsolidationConfig, IngestionConfig, RememberOptions, RecallOptions, IngestOptions, IngestResult, ExportOptions, ImportOptions, ImportResult, ConsolidationResult as MemoryConsolidationResult, MemoryHealth, LoadOptions, LoadedDocument, DocumentMetadata, DocumentChunk, ExtractedImage, ExtractedTable, } from './facade/index.js';
62
+ export type { IDocumentLoader } from './ingestion/IDocumentLoader.js';
63
+ export { TextLoader } from './ingestion/TextLoader.js';
64
+ export { MarkdownLoader } from './ingestion/MarkdownLoader.js';
65
+ export { HtmlLoader } from './ingestion/HtmlLoader.js';
66
+ export { PdfLoader } from './ingestion/PdfLoader.js';
67
+ export { DocxLoader } from './ingestion/DocxLoader.js';
68
+ export { LoaderRegistry } from './ingestion/LoaderRegistry.js';
69
+ export { FolderScanner } from './ingestion/FolderScanner.js';
70
+ export { ChunkingEngine } from './ingestion/ChunkingEngine.js';
71
+ export { MultimodalAggregator } from './ingestion/MultimodalAggregator.js';
72
+ export { UrlLoader } from './ingestion/UrlLoader.js';
73
+ export { RetrievalFeedbackSignal } from './feedback/index.js';
74
+ export type { RetrievalFeedback } from './feedback/index.js';
75
+ export { ConsolidationLoop } from './consolidation/index.js';
76
+ export { JsonExporter, JsonImporter, MarkdownExporter, MarkdownImporter, ObsidianExporter, ObsidianImporter, SqliteExporter, SqliteImporter, ChatGptImporter, } from './io/index.js';
77
+ export { SqliteBrain } from './store/SqliteBrain.js';
78
+ export { SqliteKnowledgeGraph } from './store/SqliteKnowledgeGraph.js';
79
+ export { SqliteMemoryGraph } from './store/SqliteMemoryGraph.js';
80
+ export { MemoryAddTool, MemoryUpdateTool, MemoryDeleteTool, MemoryMergeTool, MemorySearchTool, MemoryReflectTool, } from './tools/index.js';
59
81
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/memory/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACV,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAGpB,YAAY,EACV,qBAAqB,EACrB,4BAA4B,EAC5B,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,WAAW,EACX,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,EAC1B,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,kBA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AM,gDAAgD,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AAGrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,YAAY,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/memory/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACV,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAGpB,YAAY,EACV,qBAAqB,EACrB,4BAA4B,EAC5B,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,WAAW,EACX,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,EAC1B,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EAC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E,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAG7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,eAAe,GAChB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGjE,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC"}
@@ -47,4 +47,28 @@ export { DEFAULT_INFINITE_CONTEXT_CONFIG } from './context/types.js';
47
47
  export { MarkdownWorkingMemory } from './working/MarkdownWorkingMemory.js';
48
48
  export { UpdateWorkingMemoryTool } from './working/UpdateWorkingMemoryTool.js';
49
49
  export { ReadWorkingMemoryTool } from './working/ReadWorkingMemoryTool.js';
50
+ // --- Memory Facade (Phase 1: Ingestion + Self-Improving Graph) ---
51
+ export { Memory } from './facade/index.js';
52
+ export { TextLoader } from './ingestion/TextLoader.js';
53
+ export { MarkdownLoader } from './ingestion/MarkdownLoader.js';
54
+ export { HtmlLoader } from './ingestion/HtmlLoader.js';
55
+ export { PdfLoader } from './ingestion/PdfLoader.js';
56
+ export { DocxLoader } from './ingestion/DocxLoader.js';
57
+ export { LoaderRegistry } from './ingestion/LoaderRegistry.js';
58
+ export { FolderScanner } from './ingestion/FolderScanner.js';
59
+ export { ChunkingEngine } from './ingestion/ChunkingEngine.js';
60
+ export { MultimodalAggregator } from './ingestion/MultimodalAggregator.js';
61
+ export { UrlLoader } from './ingestion/UrlLoader.js';
62
+ // --- Retrieval Feedback ---
63
+ export { RetrievalFeedbackSignal } from './feedback/index.js';
64
+ // --- Self-Improving Consolidation ---
65
+ export { ConsolidationLoop } from './consolidation/index.js';
66
+ // --- Import/Export ---
67
+ export { JsonExporter, JsonImporter, MarkdownExporter, MarkdownImporter, ObsidianExporter, ObsidianImporter, SqliteExporter, SqliteImporter, ChatGptImporter, } from './io/index.js';
68
+ // --- SQLite Storage ---
69
+ export { SqliteBrain } from './store/SqliteBrain.js';
70
+ export { SqliteKnowledgeGraph } from './store/SqliteKnowledgeGraph.js';
71
+ export { SqliteMemoryGraph } from './store/SqliteMemoryGraph.js';
72
+ // --- Agent Memory Tools ---
73
+ export { MemoryAddTool, MemoryUpdateTool, MemoryDeleteTool, MemoryMergeTool, MemorySearchTool, MemoryReflectTool, } from './tools/index.js';
50
74
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/memory/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAoCH,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAErB,mBAAmB;AACnB,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,EAC1B,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,6BAA6B,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,cAAc,EACd,eAAe,GAChB,MAAM,eAAe,CAAC;AAEvB,yBAAyB;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,6BAA6B;AAC7B,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,143 @@
1
+ /**
2
+ * @fileoverview ChunkingEngine — splits raw document text into `DocumentChunk`
3
+ * slices ready for embedding and vector-store ingestion.
4
+ *
5
+ * Four strategies are supported:
6
+ *
7
+ * - **fixed** — split at a fixed character count with word-boundary
8
+ * awareness and configurable overlap.
9
+ * - **semantic** — embed individual sentences and split where cosine
10
+ * similarity drops below a threshold (topic boundaries).
11
+ * Falls back to `fixed` when no `embedFn` is supplied.
12
+ * - **hierarchical**— honour Markdown heading structure; each heading creates
13
+ * a new chunk boundary with the heading stored in metadata.
14
+ * Long sections are sub-split with `fixed`.
15
+ * - **layout** — preserve fenced code blocks and pipe-delimited tables as
16
+ * atomic chunks; surrounding prose is split with `fixed`.
17
+ *
18
+ * @module memory/ingestion/ChunkingEngine
19
+ */
20
+ import type { DocumentChunk } from '../facade/types.js';
21
+ /**
22
+ * The four supported chunking strategies.
23
+ *
24
+ * - `'fixed'` — character-count split with overlap.
25
+ * - `'semantic'` — embedding-guided topic-boundary split.
26
+ * - `'hierarchical'`— Markdown heading-aware split.
27
+ * - `'layout'` — code/table-aware split that preserves special blocks.
28
+ */
29
+ export type ChunkStrategy = 'fixed' | 'semantic' | 'hierarchical' | 'layout';
30
+ /**
31
+ * Options controlling how the `ChunkingEngine` splits a document.
32
+ *
33
+ * All fields except `strategy` are optional and fall back to sensible defaults.
34
+ */
35
+ export interface ChunkOptions {
36
+ /**
37
+ * Algorithm used to split the content.
38
+ * @see ChunkStrategy
39
+ */
40
+ strategy: ChunkStrategy;
41
+ /**
42
+ * Target character count for each produced chunk.
43
+ * @default 512
44
+ */
45
+ chunkSize?: number;
46
+ /**
47
+ * Number of characters to overlap between consecutive chunks.
48
+ * Prevents context loss at split boundaries.
49
+ * @default 64
50
+ */
51
+ chunkOverlap?: number;
52
+ /**
53
+ * Async function that embeds a batch of strings into dense vectors.
54
+ * Required for the `'semantic'` strategy; ignored by all others.
55
+ * When omitted and `strategy` is `'semantic'`, the engine falls back to
56
+ * the `'fixed'` strategy.
57
+ *
58
+ * @param texts - Batch of strings to embed.
59
+ * @returns Promise resolving to one vector (number[]) per input string.
60
+ */
61
+ embedFn?: (texts: string[]) => Promise<number[][]>;
62
+ }
63
+ /**
64
+ * Splits raw document text into an ordered array of `DocumentChunk` objects
65
+ * suitable for embedding and storage in a vector index.
66
+ *
67
+ * @example
68
+ * ```typescript
69
+ * const engine = new ChunkingEngine();
70
+ * const chunks = await engine.chunk(content, { strategy: 'fixed', chunkSize: 512 });
71
+ * ```
72
+ */
73
+ export declare class ChunkingEngine {
74
+ /**
75
+ * Chunks the provided `content` string according to the given `options`.
76
+ *
77
+ * All strategy implementations are async to accommodate the optional
78
+ * `embedFn` used by the semantic strategy.
79
+ *
80
+ * @param content - Full document text to split.
81
+ * @param options - Chunking strategy and tuning parameters.
82
+ * @returns Ordered array of `DocumentChunk` objects with sequential indices.
83
+ */
84
+ chunk(content: string, options: ChunkOptions): Promise<DocumentChunk[]>;
85
+ /**
86
+ * Splits content at a fixed character count with word-boundary awareness
87
+ * and configurable overlap between consecutive chunks.
88
+ *
89
+ * @param content - Text to split.
90
+ * @param chunkSize - Target character count per chunk.
91
+ * @param chunkOverlap - Overlap in characters between consecutive chunks.
92
+ * @returns Ordered `DocumentChunk[]`.
93
+ */
94
+ private _chunkFixed;
95
+ /**
96
+ * Embeds individual sentences and inserts split points wherever the cosine
97
+ * similarity between consecutive sentence embeddings drops below
98
+ * {@link SEMANTIC_SPLIT_THRESHOLD} (topic boundary heuristic).
99
+ *
100
+ * When `embedFn` is not supplied the method falls back to `_chunkFixed`.
101
+ *
102
+ * Any resulting group that exceeds `2 × chunkSize` characters is further
103
+ * sub-split with the fixed strategy.
104
+ *
105
+ * @param content - Text to split.
106
+ * @param chunkSize - Target character count per chunk.
107
+ * @param chunkOverlap - Overlap used when sub-splitting oversized groups.
108
+ * @param embedFn - Optional batch embedding function.
109
+ * @returns Ordered `DocumentChunk[]`.
110
+ */
111
+ private _chunkSemantic;
112
+ /**
113
+ * Recognises Markdown heading lines (`# H1`, `## H2`, …, `###### H6`) and
114
+ * creates a new chunk boundary at each heading. The heading text is stored
115
+ * in `DocumentChunk.heading` and its level in `metadata.headingLevel`.
116
+ *
117
+ * Sections whose text exceeds `chunkSize` are sub-split with the fixed
118
+ * strategy while preserving the heading metadata.
119
+ *
120
+ * @param content - Markdown-formatted text.
121
+ * @param chunkSize - Maximum characters per output chunk.
122
+ * @param chunkOverlap - Overlap used when sub-splitting oversized sections.
123
+ * @returns Ordered `DocumentChunk[]`.
124
+ */
125
+ private _chunkHierarchical;
126
+ /**
127
+ * Detects fenced code blocks (``` … ```) and pipe-delimited tables and
128
+ * emits each as an atomic chunk (never split mid-block). Surrounding prose
129
+ * is split with the fixed strategy.
130
+ *
131
+ * Chunk metadata:
132
+ * - Code blocks: `{ type: 'code' }`
133
+ * - Tables: `{ type: 'table' }`
134
+ * - Prose: no special metadata.
135
+ *
136
+ * @param content - Text potentially containing code blocks and tables.
137
+ * @param chunkSize - Target character count for prose chunks.
138
+ * @param chunkOverlap - Overlap for prose fixed-splits.
139
+ * @returns Ordered `DocumentChunk[]`.
140
+ */
141
+ private _chunkLayout;
142
+ }
143
+ //# sourceMappingURL=ChunkingEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChunkingEngine.d.ts","sourceRoot":"","sources":["../../../src/memory/ingestion/ChunkingEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAMxD;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,UAAU,GAAG,cAAc,GAAG,QAAQ,CAAC;AAE7E;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,QAAQ,EAAE,aAAa,CAAC;IAExB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;CACpD;AAiID;;;;;;;;;GASG;AACH,qBAAa,cAAc;IAKzB;;;;;;;;;OASG;IACG,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IA6B7E;;;;;;;;OAQG;IACH,OAAO,CAAC,WAAW;IAYnB;;;;;;;;;;;;;;;OAeG;YACW,cAAc;IAkF5B;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,kBAAkB;IAmJ1B;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,YAAY;CA6GrB"}