@framers/agentos 0.2.11 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/dist/ingest-router/executors/EntityExtractor.d.ts +23 -0
  2. package/dist/ingest-router/executors/EntityExtractor.d.ts.map +1 -0
  3. package/dist/ingest-router/executors/EntityExtractor.js +69 -0
  4. package/dist/ingest-router/executors/EntityExtractor.js.map +1 -0
  5. package/dist/ingest-router/executors/EntityLinkingIngestExecutor.d.ts +46 -0
  6. package/dist/ingest-router/executors/EntityLinkingIngestExecutor.d.ts.map +1 -0
  7. package/dist/ingest-router/executors/EntityLinkingIngestExecutor.js +45 -0
  8. package/dist/ingest-router/executors/EntityLinkingIngestExecutor.js.map +1 -0
  9. package/dist/ingest-router/executors/RawChunksIngestExecutor.d.ts +36 -0
  10. package/dist/ingest-router/executors/RawChunksIngestExecutor.d.ts.map +1 -0
  11. package/dist/ingest-router/executors/RawChunksIngestExecutor.js +33 -0
  12. package/dist/ingest-router/executors/RawChunksIngestExecutor.js.map +1 -0
  13. package/dist/ingest-router/executors/SkipIngestExecutor.d.ts +20 -0
  14. package/dist/ingest-router/executors/SkipIngestExecutor.d.ts.map +1 -0
  15. package/dist/ingest-router/executors/SkipIngestExecutor.js +28 -0
  16. package/dist/ingest-router/executors/SkipIngestExecutor.js.map +1 -0
  17. package/dist/ingest-router/executors/SummarizedIngestExecutor.d.ts +68 -0
  18. package/dist/ingest-router/executors/SummarizedIngestExecutor.d.ts.map +1 -0
  19. package/dist/ingest-router/executors/SummarizedIngestExecutor.js +56 -0
  20. package/dist/ingest-router/executors/SummarizedIngestExecutor.js.map +1 -0
  21. package/dist/ingest-router/executors/entity-types.d.ts +55 -0
  22. package/dist/ingest-router/executors/entity-types.d.ts.map +1 -0
  23. package/dist/ingest-router/executors/entity-types.js +17 -0
  24. package/dist/ingest-router/executors/entity-types.js.map +1 -0
  25. package/dist/ingest-router/executors/index.d.ts +37 -0
  26. package/dist/ingest-router/executors/index.d.ts.map +1 -0
  27. package/dist/ingest-router/executors/index.js +37 -0
  28. package/dist/ingest-router/executors/index.js.map +1 -0
  29. package/dist/ingest-router/index.d.ts +2 -0
  30. package/dist/ingest-router/index.d.ts.map +1 -1
  31. package/dist/ingest-router/index.js +14 -0
  32. package/dist/ingest-router/index.js.map +1 -1
  33. package/dist/memory/AgentMemory.js +1 -1
  34. package/dist/memory/AgentMemory.js.map +1 -1
  35. package/dist/memory/CognitiveMemoryManager.js +4 -4
  36. package/dist/memory/CognitiveMemoryManager.js.map +1 -1
  37. package/dist/memory/archive/IMemoryArchive.d.ts +2 -2
  38. package/dist/memory/archive/SqlStorageMemoryArchive.d.ts +17 -13
  39. package/dist/memory/archive/SqlStorageMemoryArchive.d.ts.map +1 -1
  40. package/dist/memory/archive/SqlStorageMemoryArchive.js +36 -28
  41. package/dist/memory/archive/SqlStorageMemoryArchive.js.map +1 -1
  42. package/dist/memory/core/config.d.ts +4 -4
  43. package/dist/memory/core/config.d.ts.map +1 -1
  44. package/dist/memory/index.d.ts +3 -3
  45. package/dist/memory/index.d.ts.map +1 -1
  46. package/dist/memory/index.js +3 -3
  47. package/dist/memory/index.js.map +1 -1
  48. package/dist/memory/io/ChatGptImporter.d.ts +5 -5
  49. package/dist/memory/io/ChatGptImporter.d.ts.map +1 -1
  50. package/dist/memory/io/ChatGptImporter.js +9 -7
  51. package/dist/memory/io/ChatGptImporter.js.map +1 -1
  52. package/dist/memory/io/CsvImporter.d.ts +4 -4
  53. package/dist/memory/io/CsvImporter.d.ts.map +1 -1
  54. package/dist/memory/io/CsvImporter.js +11 -8
  55. package/dist/memory/io/CsvImporter.js.map +1 -1
  56. package/dist/memory/io/JsonExporter.d.ts +5 -5
  57. package/dist/memory/io/JsonExporter.d.ts.map +1 -1
  58. package/dist/memory/io/JsonExporter.js +13 -12
  59. package/dist/memory/io/JsonExporter.js.map +1 -1
  60. package/dist/memory/io/JsonImporter.d.ts +5 -5
  61. package/dist/memory/io/JsonImporter.d.ts.map +1 -1
  62. package/dist/memory/io/JsonImporter.js +50 -34
  63. package/dist/memory/io/JsonImporter.js.map +1 -1
  64. package/dist/memory/io/MarkdownExporter.d.ts +4 -4
  65. package/dist/memory/io/MarkdownExporter.d.ts.map +1 -1
  66. package/dist/memory/io/MarkdownExporter.js +1 -1
  67. package/dist/memory/io/MarkdownExporter.js.map +1 -1
  68. package/dist/memory/io/MarkdownImporter.d.ts +6 -6
  69. package/dist/memory/io/MarkdownImporter.d.ts.map +1 -1
  70. package/dist/memory/io/MarkdownImporter.js +8 -7
  71. package/dist/memory/io/MarkdownImporter.js.map +1 -1
  72. package/dist/memory/io/ObsidianImporter.d.ts +4 -4
  73. package/dist/memory/io/ObsidianImporter.d.ts.map +1 -1
  74. package/dist/memory/io/ObsidianImporter.js +15 -10
  75. package/dist/memory/io/ObsidianImporter.js.map +1 -1
  76. package/dist/memory/io/SqliteExporter.d.ts +5 -5
  77. package/dist/memory/io/SqliteExporter.d.ts.map +1 -1
  78. package/dist/memory/io/SqliteExporter.js +3 -3
  79. package/dist/memory/io/SqliteExporter.js.map +1 -1
  80. package/dist/memory/io/SqliteImporter.d.ts +4 -4
  81. package/dist/memory/io/SqliteImporter.d.ts.map +1 -1
  82. package/dist/memory/io/SqliteImporter.js +23 -16
  83. package/dist/memory/io/SqliteImporter.js.map +1 -1
  84. package/dist/memory/io/facade/Memory.d.ts +58 -10
  85. package/dist/memory/io/facade/Memory.d.ts.map +1 -1
  86. package/dist/memory/io/facade/Memory.js +124 -50
  87. package/dist/memory/io/facade/Memory.js.map +1 -1
  88. package/dist/memory/io/facade/types.d.ts +1 -1
  89. package/dist/memory/io/index.d.ts +2 -2
  90. package/dist/memory/io/index.js +2 -2
  91. package/dist/memory/io/tools/MemoryAddTool.d.ts +2 -2
  92. package/dist/memory/io/tools/MemoryAddTool.d.ts.map +1 -1
  93. package/dist/memory/io/tools/MemoryAddTool.js +2 -2
  94. package/dist/memory/io/tools/MemoryAddTool.js.map +1 -1
  95. package/dist/memory/io/tools/MemoryDeleteTool.d.ts +2 -2
  96. package/dist/memory/io/tools/MemoryDeleteTool.d.ts.map +1 -1
  97. package/dist/memory/io/tools/MemoryDeleteTool.js +1 -1
  98. package/dist/memory/io/tools/MemoryDeleteTool.js.map +1 -1
  99. package/dist/memory/io/tools/MemoryMergeTool.d.ts +2 -2
  100. package/dist/memory/io/tools/MemoryMergeTool.d.ts.map +1 -1
  101. package/dist/memory/io/tools/MemoryMergeTool.js +4 -3
  102. package/dist/memory/io/tools/MemoryMergeTool.js.map +1 -1
  103. package/dist/memory/io/tools/MemoryReflectTool.d.ts +2 -2
  104. package/dist/memory/io/tools/MemoryReflectTool.d.ts.map +1 -1
  105. package/dist/memory/io/tools/MemoryReflectTool.js.map +1 -1
  106. package/dist/memory/io/tools/MemorySearchTool.d.ts +2 -2
  107. package/dist/memory/io/tools/MemorySearchTool.d.ts.map +1 -1
  108. package/dist/memory/io/tools/MemorySearchTool.js.map +1 -1
  109. package/dist/memory/io/tools/MemoryUpdateTool.d.ts +2 -2
  110. package/dist/memory/io/tools/MemoryUpdateTool.d.ts.map +1 -1
  111. package/dist/memory/io/tools/MemoryUpdateTool.js +5 -4
  112. package/dist/memory/io/tools/MemoryUpdateTool.js.map +1 -1
  113. package/dist/memory/pipeline/consolidation/ConsolidationLoop.d.ts +3 -3
  114. package/dist/memory/pipeline/consolidation/ConsolidationLoop.d.ts.map +1 -1
  115. package/dist/memory/pipeline/consolidation/ConsolidationLoop.js +22 -17
  116. package/dist/memory/pipeline/consolidation/ConsolidationLoop.js.map +1 -1
  117. package/dist/memory/retrieval/feedback/RetrievalFeedbackSignal.d.ts +3 -3
  118. package/dist/memory/retrieval/feedback/RetrievalFeedbackSignal.d.ts.map +1 -1
  119. package/dist/memory/retrieval/feedback/RetrievalFeedbackSignal.js +15 -12
  120. package/dist/memory/retrieval/feedback/RetrievalFeedbackSignal.js.map +1 -1
  121. package/dist/memory/retrieval/graph/index.d.ts +0 -1
  122. package/dist/memory/retrieval/graph/index.d.ts.map +1 -1
  123. package/dist/memory/retrieval/graph/index.js +4 -1
  124. package/dist/memory/retrieval/graph/index.js.map +1 -1
  125. package/dist/memory/retrieval/store/{SqliteBrain.d.ts → Brain.d.ts} +111 -23
  126. package/dist/memory/retrieval/store/Brain.d.ts.map +1 -0
  127. package/dist/memory/retrieval/store/{SqliteBrain.js → Brain.js} +367 -76
  128. package/dist/memory/retrieval/store/Brain.js.map +1 -0
  129. package/dist/memory/retrieval/store/HnswSidecar.d.ts +1 -1
  130. package/dist/memory/retrieval/store/HnswSidecar.js +1 -1
  131. package/dist/memory/retrieval/store/MemoryStore.d.ts +6 -6
  132. package/dist/memory/retrieval/store/MemoryStore.d.ts.map +1 -1
  133. package/dist/memory/retrieval/store/MemoryStore.js +10 -9
  134. package/dist/memory/retrieval/store/MemoryStore.js.map +1 -1
  135. package/dist/memory/retrieval/store/{SqliteKnowledgeGraph.d.ts → SqlKnowledgeGraph.d.ts} +12 -12
  136. package/dist/memory/retrieval/store/SqlKnowledgeGraph.d.ts.map +1 -0
  137. package/dist/memory/retrieval/store/{SqliteKnowledgeGraph.js → SqlKnowledgeGraph.js} +83 -64
  138. package/dist/memory/retrieval/store/SqlKnowledgeGraph.js.map +1 -0
  139. package/dist/memory/retrieval/store/{SqliteMemoryGraph.d.ts → SqlMemoryGraph.d.ts} +11 -11
  140. package/dist/memory/retrieval/store/SqlMemoryGraph.d.ts.map +1 -0
  141. package/dist/memory/retrieval/store/{SqliteMemoryGraph.js → SqlMemoryGraph.js} +26 -24
  142. package/dist/memory/retrieval/store/SqlMemoryGraph.js.map +1 -0
  143. package/dist/memory/retrieval/store/migrations/v1-to-v2.d.ts +31 -0
  144. package/dist/memory/retrieval/store/migrations/v1-to-v2.d.ts.map +1 -0
  145. package/dist/memory/retrieval/store/migrations/v1-to-v2.js +423 -0
  146. package/dist/memory/retrieval/store/migrations/v1-to-v2.js.map +1 -0
  147. package/dist/memory-router/backends/EntityRetrievalRanker.d.ts +54 -0
  148. package/dist/memory-router/backends/EntityRetrievalRanker.d.ts.map +1 -0
  149. package/dist/memory-router/backends/EntityRetrievalRanker.js +39 -0
  150. package/dist/memory-router/backends/EntityRetrievalRanker.js.map +1 -0
  151. package/dist/memory-router/backends/index.d.ts +16 -0
  152. package/dist/memory-router/backends/index.d.ts.map +1 -0
  153. package/dist/memory-router/backends/index.js +16 -0
  154. package/dist/memory-router/backends/index.js.map +1 -0
  155. package/dist/memory-router/index.d.ts +2 -0
  156. package/dist/memory-router/index.d.ts.map +1 -1
  157. package/dist/memory-router/index.js +4 -0
  158. package/dist/memory-router/index.js.map +1 -1
  159. package/dist/rag/utils/vectorMath.d.ts +1 -1
  160. package/dist/rag/utils/vectorMath.js +1 -1
  161. package/dist/rag/vector-search/HnswIndexSidecar.d.ts +1 -1
  162. package/dist/rag/vector-search/HnswIndexSidecar.js +1 -1
  163. package/package.json +2 -2
  164. package/dist/memory/retrieval/graph/knowledge/SqliteKnowledgeGraph.d.ts +0 -10
  165. package/dist/memory/retrieval/graph/knowledge/SqliteKnowledgeGraph.d.ts.map +0 -1
  166. package/dist/memory/retrieval/graph/knowledge/SqliteKnowledgeGraph.js +0 -10
  167. package/dist/memory/retrieval/graph/knowledge/SqliteKnowledgeGraph.js.map +0 -1
  168. package/dist/memory/retrieval/store/SqliteBrain.d.ts.map +0 -1
  169. package/dist/memory/retrieval/store/SqliteBrain.js.map +0 -1
  170. package/dist/memory/retrieval/store/SqliteKnowledgeGraph.d.ts.map +0 -1
  171. package/dist/memory/retrieval/store/SqliteKnowledgeGraph.js.map +0 -1
  172. package/dist/memory/retrieval/store/SqliteMemoryGraph.d.ts.map +0 -1
  173. package/dist/memory/retrieval/store/SqliteMemoryGraph.js.map +0 -1
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @file EntityExtractor.ts
3
+ * @description Mem0-v3-style entity extractor. Three classes:
4
+ * - proper nouns (standalone capitalized tokens)
5
+ * - quoted text (within "..." or '...')
6
+ * - compound noun phrases (consecutive capitalized tokens)
7
+ *
8
+ * Order of detection: quoted text first (preserves verbatim spans),
9
+ * then compound noun phrases (greedy, longest match), then proper
10
+ * nouns (whatever capitalized tokens are not already inside a compound).
11
+ *
12
+ * Reference: docs.mem0.ai/migration/oss-v2-to-v3 §"Entity Extraction".
13
+ *
14
+ * @module @framers/agentos/ingest-router/executors/EntityExtractor
15
+ */
16
+ import type { EntityExtractionResult, EntityLinkingOptions } from './entity-types.js';
17
+ export declare class EntityExtractor {
18
+ private readonly properNounMinLength;
19
+ private readonly compoundNounMaxLength;
20
+ constructor(opts?: EntityLinkingOptions);
21
+ extract(text: string): EntityExtractionResult;
22
+ }
23
+ //# sourceMappingURL=EntityExtractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityExtractor.d.ts","sourceRoot":"","sources":["../../../src/ingest-router/executors/EntityExtractor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAEV,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAE3B,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAS;IAC7C,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAS;gBAEnC,IAAI,GAAE,oBAAyB;IAK3C,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,sBAAsB;CAsD9C"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @file EntityExtractor.ts
3
+ * @description Mem0-v3-style entity extractor. Three classes:
4
+ * - proper nouns (standalone capitalized tokens)
5
+ * - quoted text (within "..." or '...')
6
+ * - compound noun phrases (consecutive capitalized tokens)
7
+ *
8
+ * Order of detection: quoted text first (preserves verbatim spans),
9
+ * then compound noun phrases (greedy, longest match), then proper
10
+ * nouns (whatever capitalized tokens are not already inside a compound).
11
+ *
12
+ * Reference: docs.mem0.ai/migration/oss-v2-to-v3 §"Entity Extraction".
13
+ *
14
+ * @module @framers/agentos/ingest-router/executors/EntityExtractor
15
+ */
16
+ export class EntityExtractor {
17
+ constructor(opts = {}) {
18
+ this.properNounMinLength = opts.properNounMinLength ?? 2;
19
+ this.compoundNounMaxLength = opts.compoundNounMaxLength ?? 5;
20
+ }
21
+ extract(text) {
22
+ const entities = [];
23
+ // 1. Quoted text — `"..."` or `'...'`. Captures verbatim spans
24
+ // that authors wrap in quotes (config values, paths, etc.).
25
+ const quotedRegex = /["']([^"'\n]{1,200}?)["']/g;
26
+ let match;
27
+ while ((match = quotedRegex.exec(text)) !== null) {
28
+ entities.push({
29
+ text: match[1],
30
+ kind: 'quoted-text',
31
+ positions: [match.index + 1],
32
+ });
33
+ }
34
+ // 2. Compound noun phrases — N consecutive capitalized tokens
35
+ // where N >= 2 and N <= compoundNounMaxLength. Greedy: the
36
+ // longest match wins.
37
+ const maxCompoundTokens = Math.max(2, this.compoundNounMaxLength);
38
+ const compoundPattern = new RegExp(`\\b[A-Z][a-zA-Z]+(?:\\s+[A-Z][a-zA-Z]+){1,${maxCompoundTokens - 1}}\\b`, 'g');
39
+ const compoundRanges = [];
40
+ while ((match = compoundPattern.exec(text)) !== null) {
41
+ const start = match.index;
42
+ const end = start + match[0].length;
43
+ compoundRanges.push({ start, end });
44
+ entities.push({
45
+ text: match[0],
46
+ kind: 'compound-noun-phrase',
47
+ positions: [start],
48
+ });
49
+ }
50
+ // 3. Proper nouns — single capitalized tokens NOT already covered
51
+ // by a compound noun phrase.
52
+ const properPattern = /\b[A-Z][a-zA-Z]+\b/g;
53
+ while ((match = properPattern.exec(text)) !== null) {
54
+ if (match[0].length < this.properNounMinLength)
55
+ continue;
56
+ const start = match.index;
57
+ const inCompound = compoundRanges.some((range) => start >= range.start && start < range.end);
58
+ if (inCompound)
59
+ continue;
60
+ entities.push({
61
+ text: match[0],
62
+ kind: 'proper-noun',
63
+ positions: [start],
64
+ });
65
+ }
66
+ return { entities, rawText: text };
67
+ }
68
+ }
69
+ //# sourceMappingURL=EntityExtractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityExtractor.js","sourceRoot":"","sources":["../../../src/ingest-router/executors/EntityExtractor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH,MAAM,OAAO,eAAe;IAI1B,YAAY,OAA6B,EAAE;QACzC,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,IAAI,CAAC,CAAC;QACzD,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,qBAAqB,IAAI,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,CAAC,IAAY;QAClB,MAAM,QAAQ,GAAsB,EAAE,CAAC;QAEvC,+DAA+D;QAC/D,+DAA+D;QAC/D,MAAM,WAAW,GAAG,4BAA4B,CAAC;QACjD,IAAI,KAA6B,CAAC;QAClC,OAAO,CAAC,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YACjD,QAAQ,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;gBACd,IAAI,EAAE,aAAa;gBACnB,SAAS,EAAE,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC;aAC7B,CAAC,CAAC;QACL,CAAC;QAED,8DAA8D;QAC9D,8DAA8D;QAC9D,yBAAyB;QACzB,MAAM,iBAAiB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAClE,MAAM,eAAe,GAAG,IAAI,MAAM,CAChC,6CAA6C,iBAAiB,GAAG,CAAC,MAAM,EACxE,GAAG,CACJ,CAAC;QACF,MAAM,cAAc,GAA0C,EAAE,CAAC;QACjE,OAAO,CAAC,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YACrD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;YAC1B,MAAM,GAAG,GAAG,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YACpC,cAAc,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;YACpC,QAAQ,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;gBACd,IAAI,EAAE,sBAAsB;gBAC5B,SAAS,EAAE,CAAC,KAAK,CAAC;aACnB,CAAC,CAAC;QACL,CAAC;QAED,kEAAkE;QAClE,gCAAgC;QAChC,MAAM,aAAa,GAAG,qBAAqB,CAAC;QAC5C,OAAO,CAAC,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YACnD,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,mBAAmB;gBAAE,SAAS;YACzD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;YAC1B,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,CACpC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,GAAG,KAAK,CAAC,GAAG,CACrD,CAAC;YACF,IAAI,UAAU;gBAAE,SAAS;YACzB,QAAQ,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;gBACd,IAAI,EAAE,aAAa;gBACnB,SAAS,EAAE,CAAC,KAAK,CAAC;aACnB,CAAC,CAAC;QACL,CAAC;QAED,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACrC,CAAC;CACF"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @file EntityLinkingIngestExecutor.ts
3
+ * @description Mem0-v3-style ingest executor for the IngestRouter
4
+ * `fact-graph` strategy. Extracts entities from content (proper nouns,
5
+ * quoted text, compound noun phrases) and surfaces them on the result
6
+ * for downstream entity-overlap indexing at recall time.
7
+ *
8
+ * Unlike Mem0 v2 (which kept a separate Neo4j/Memgraph graph store),
9
+ * v3 uses parallel entity columns + multi-signal hybrid search. This
10
+ * executor captures the v3 pattern: regex-based extraction at ingest,
11
+ * no LLM cost, entities flow alongside chunks for retrieval-time
12
+ * re-ranking via {@link EntityRetrievalRanker}.
13
+ *
14
+ * Reference: docs.mem0.ai/migration/oss-v2-to-v3.
15
+ *
16
+ * @module @framers/agentos/ingest-router/executors/EntityLinkingIngestExecutor
17
+ */
18
+ import type { IngestPayload } from './SummarizedIngestExecutor.js';
19
+ import type { EntityLinkingOptions } from './entity-types.js';
20
+ /**
21
+ * Outcome shape for the entity-linking executor.
22
+ */
23
+ export interface EntityLinkingOutcome {
24
+ writtenTraces: number;
25
+ summary: string;
26
+ embedTexts: string[];
27
+ /** Distinct entities found across all chunks, deduplicated. */
28
+ entities: string[];
29
+ /** Entities found per chunk, in chunk order. */
30
+ entitiesPerChunk: string[][];
31
+ tokensIn: number;
32
+ tokensOut: number;
33
+ }
34
+ /**
35
+ * Reference executor for the IngestRouter `fact-graph` strategy.
36
+ * Wires entity extraction at ingest; the bench (or any consumer)
37
+ * indexes the entities alongside chunks for entity-overlap re-ranking.
38
+ */
39
+ export declare class EntityLinkingIngestExecutor {
40
+ /** Strategy ID expected by IngestRouter's FunctionIngestDispatcher registry. */
41
+ readonly strategyId: "fact-graph";
42
+ private readonly extractor;
43
+ constructor(opts?: EntityLinkingOptions);
44
+ ingest(content: string, payload: IngestPayload): Promise<EntityLinkingOutcome>;
45
+ }
46
+ //# sourceMappingURL=EntityLinkingIngestExecutor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityLinkingIngestExecutor.d.ts","sourceRoot":"","sources":["../../../src/ingest-router/executors/EntityLinkingIngestExecutor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,gDAAgD;IAChD,gBAAgB,EAAE,MAAM,EAAE,EAAE,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,qBAAa,2BAA2B;IACtC,gFAAgF;IAChF,QAAQ,CAAC,UAAU,EAAG,YAAY,CAAU;IAE5C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkB;gBAEhC,IAAI,GAAE,oBAAyB;IAIrC,MAAM,CACV,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,oBAAoB,CAAC;CAiBjC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * @file EntityLinkingIngestExecutor.ts
3
+ * @description Mem0-v3-style ingest executor for the IngestRouter
4
+ * `fact-graph` strategy. Extracts entities from content (proper nouns,
5
+ * quoted text, compound noun phrases) and surfaces them on the result
6
+ * for downstream entity-overlap indexing at recall time.
7
+ *
8
+ * Unlike Mem0 v2 (which kept a separate Neo4j/Memgraph graph store),
9
+ * v3 uses parallel entity columns + multi-signal hybrid search. This
10
+ * executor captures the v3 pattern: regex-based extraction at ingest,
11
+ * no LLM cost, entities flow alongside chunks for retrieval-time
12
+ * re-ranking via {@link EntityRetrievalRanker}.
13
+ *
14
+ * Reference: docs.mem0.ai/migration/oss-v2-to-v3.
15
+ *
16
+ * @module @framers/agentos/ingest-router/executors/EntityLinkingIngestExecutor
17
+ */
18
+ import { EntityExtractor } from './EntityExtractor.js';
19
+ /**
20
+ * Reference executor for the IngestRouter `fact-graph` strategy.
21
+ * Wires entity extraction at ingest; the bench (or any consumer)
22
+ * indexes the entities alongside chunks for entity-overlap re-ranking.
23
+ */
24
+ export class EntityLinkingIngestExecutor {
25
+ constructor(opts = {}) {
26
+ /** Strategy ID expected by IngestRouter's FunctionIngestDispatcher registry. */
27
+ this.strategyId = 'fact-graph';
28
+ this.extractor = new EntityExtractor(opts);
29
+ }
30
+ async ingest(content, payload) {
31
+ const chunks = payload.chunks ?? [content];
32
+ const entitiesPerChunk = chunks.map((chunk) => this.extractor.extract(chunk).entities.map((e) => e.text));
33
+ const allEntities = Array.from(new Set(entitiesPerChunk.flat()));
34
+ return {
35
+ writtenTraces: chunks.length,
36
+ summary: '',
37
+ embedTexts: chunks,
38
+ entities: allEntities,
39
+ entitiesPerChunk,
40
+ tokensIn: 0,
41
+ tokensOut: 0,
42
+ };
43
+ }
44
+ }
45
+ //# sourceMappingURL=EntityLinkingIngestExecutor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityLinkingIngestExecutor.js","sourceRoot":"","sources":["../../../src/ingest-router/executors/EntityLinkingIngestExecutor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAmBvD;;;;GAIG;AACH,MAAM,OAAO,2BAA2B;IAMtC,YAAY,OAA6B,EAAE;QAL3C,gFAAgF;QACvE,eAAU,GAAG,YAAqB,CAAC;QAK1C,IAAI,CAAC,SAAS,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,MAAM,CACV,OAAe,EACf,OAAsB;QAEtB,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC;QAC3C,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAC5C,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAC1D,CAAC;QACF,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAEjE,OAAO;YACL,aAAa,EAAE,MAAM,CAAC,MAAM;YAC5B,OAAO,EAAE,EAAE;YACX,UAAU,EAAE,MAAM;YAClB,QAAQ,EAAE,WAAW;YACrB,gBAAgB;YAChB,QAAQ,EAAE,CAAC;YACX,SAAS,EAAE,CAAC;SACb,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @file RawChunksIngestExecutor.ts
3
+ * @description Trivial reference executor for the IngestRouter
4
+ * `raw-chunks` strategy. Passes content through unchanged so the
5
+ * downstream embedder sees the original chunks.
6
+ *
7
+ * Use case: high-volume / cost-sensitive workloads where retrieval
8
+ * does the work and per-session preprocessing isn't worth the LLM
9
+ * cost. The default IngestRouter preset (`raw-chunks`) routes every
10
+ * content kind through this executor.
11
+ *
12
+ * @module @framers/agentos/ingest-router/executors/RawChunksIngestExecutor
13
+ */
14
+ import type { IngestPayload } from './SummarizedIngestExecutor.js';
15
+ /**
16
+ * Outcome shape returned by {@link RawChunksIngestExecutor.ingest}.
17
+ * Mirrors the shape returned by {@link SummarizedIngestExecutor.ingest}
18
+ * so consumers can swap executors without rewriting downstream code.
19
+ * `summary` is always the empty string for raw chunks.
20
+ */
21
+ export interface RawChunksOutcome {
22
+ writtenTraces: number;
23
+ summary: string;
24
+ embedTexts: string[];
25
+ tokensIn: number;
26
+ tokensOut: number;
27
+ }
28
+ /**
29
+ * No-op preprocessor: returns chunks as-is. Zero LLM cost.
30
+ */
31
+ export declare class RawChunksIngestExecutor {
32
+ /** Strategy ID expected by IngestRouter's FunctionIngestDispatcher registry. */
33
+ readonly strategyId: "raw-chunks";
34
+ ingest(content: string, payload: IngestPayload): Promise<RawChunksOutcome>;
35
+ }
36
+ //# sourceMappingURL=RawChunksIngestExecutor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RawChunksIngestExecutor.d.ts","sourceRoot":"","sources":["../../../src/ingest-router/executors/RawChunksIngestExecutor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,qBAAa,uBAAuB;IAClC,gFAAgF;IAChF,QAAQ,CAAC,UAAU,EAAG,YAAY,CAAU;IAEtC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAUjF"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @file RawChunksIngestExecutor.ts
3
+ * @description Trivial reference executor for the IngestRouter
4
+ * `raw-chunks` strategy. Passes content through unchanged so the
5
+ * downstream embedder sees the original chunks.
6
+ *
7
+ * Use case: high-volume / cost-sensitive workloads where retrieval
8
+ * does the work and per-session preprocessing isn't worth the LLM
9
+ * cost. The default IngestRouter preset (`raw-chunks`) routes every
10
+ * content kind through this executor.
11
+ *
12
+ * @module @framers/agentos/ingest-router/executors/RawChunksIngestExecutor
13
+ */
14
+ /**
15
+ * No-op preprocessor: returns chunks as-is. Zero LLM cost.
16
+ */
17
+ export class RawChunksIngestExecutor {
18
+ constructor() {
19
+ /** Strategy ID expected by IngestRouter's FunctionIngestDispatcher registry. */
20
+ this.strategyId = 'raw-chunks';
21
+ }
22
+ async ingest(content, payload) {
23
+ const chunks = payload.chunks ?? [content];
24
+ return {
25
+ writtenTraces: chunks.length,
26
+ summary: '',
27
+ embedTexts: chunks,
28
+ tokensIn: 0,
29
+ tokensOut: 0,
30
+ };
31
+ }
32
+ }
33
+ //# sourceMappingURL=RawChunksIngestExecutor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RawChunksIngestExecutor.js","sourceRoot":"","sources":["../../../src/ingest-router/executors/RawChunksIngestExecutor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAkBH;;GAEG;AACH,MAAM,OAAO,uBAAuB;IAApC;QACE,gFAAgF;QACvE,eAAU,GAAG,YAAqB,CAAC;IAY9C,CAAC;IAVC,KAAK,CAAC,MAAM,CAAC,OAAe,EAAE,OAAsB;QAClD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO;YACL,aAAa,EAAE,MAAM,CAAC,MAAM;YAC5B,OAAO,EAAE,EAAE;YACX,UAAU,EAAE,MAAM;YAClB,QAAQ,EAAE,CAAC;YACX,SAAS,EAAE,CAAC;SACb,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @file SkipIngestExecutor.ts
3
+ * @description No-op executor for the IngestRouter `skip` strategy.
4
+ * Discards content; writes nothing. Useful for the routing-table case
5
+ * where short conversations or low-value content shouldn't pollute the
6
+ * memory store.
7
+ *
8
+ * @module @framers/agentos/ingest-router/executors/SkipIngestExecutor
9
+ */
10
+ import type { IngestPayload } from './SummarizedIngestExecutor.js';
11
+ import type { RawChunksOutcome } from './RawChunksIngestExecutor.js';
12
+ /**
13
+ * Discards content. Returns the same shape as other executors so the
14
+ * dispatcher's outcome type stays uniform.
15
+ */
16
+ export declare class SkipIngestExecutor {
17
+ readonly strategyId: "skip";
18
+ ingest(_content: string, _payload: IngestPayload): Promise<RawChunksOutcome>;
19
+ }
20
+ //# sourceMappingURL=SkipIngestExecutor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkipIngestExecutor.d.ts","sourceRoot":"","sources":["../../../src/ingest-router/executors/SkipIngestExecutor.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE;;;GAGG;AACH,qBAAa,kBAAkB;IAC7B,QAAQ,CAAC,UAAU,EAAG,MAAM,CAAU;IAEhC,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC;CASnF"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @file SkipIngestExecutor.ts
3
+ * @description No-op executor for the IngestRouter `skip` strategy.
4
+ * Discards content; writes nothing. Useful for the routing-table case
5
+ * where short conversations or low-value content shouldn't pollute the
6
+ * memory store.
7
+ *
8
+ * @module @framers/agentos/ingest-router/executors/SkipIngestExecutor
9
+ */
10
+ /**
11
+ * Discards content. Returns the same shape as other executors so the
12
+ * dispatcher's outcome type stays uniform.
13
+ */
14
+ export class SkipIngestExecutor {
15
+ constructor() {
16
+ this.strategyId = 'skip';
17
+ }
18
+ async ingest(_content, _payload) {
19
+ return {
20
+ writtenTraces: 0,
21
+ summary: '',
22
+ embedTexts: [],
23
+ tokensIn: 0,
24
+ tokensOut: 0,
25
+ };
26
+ }
27
+ }
28
+ //# sourceMappingURL=SkipIngestExecutor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkipIngestExecutor.js","sourceRoot":"","sources":["../../../src/ingest-router/executors/SkipIngestExecutor.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IAA/B;QACW,eAAU,GAAG,MAAe,CAAC;IAWxC,CAAC;IATC,KAAK,CAAC,MAAM,CAAC,QAAgB,EAAE,QAAuB;QACpD,OAAO;YACL,aAAa,EAAE,CAAC;YAChB,OAAO,EAAE,EAAE;YACX,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,CAAC;YACX,SAAS,EAAE,CAAC;SACb,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * @file SummarizedIngestExecutor.ts
3
+ * @description Anthropic Contextual Retrieval reference executor for
4
+ * the IngestRouter `summarized` strategy.
5
+ *
6
+ * Wraps the existing {@link SessionSummarizer} (in
7
+ * `@framers/agentos/memory`) which carries the conversation-tuned
8
+ * summarization prompt + persistent disk cache + cost-tracking. This
9
+ * executor is the IngestRouter-shaped facade over that primitive, so
10
+ * the production SessionSummarizer is the single source of truth for
11
+ * session-level summarization across both the bench and the
12
+ * IngestRouter dispatcher path.
13
+ *
14
+ * Cost model: ~$0.003 per session at gpt-5-mini. SessionSummarizer's
15
+ * SHA-256 disk cache means re-runs against the same sessions are $0.
16
+ *
17
+ * @module @framers/agentos/ingest-router/executors/SummarizedIngestExecutor
18
+ */
19
+ import { SessionSummarizer } from '../../memory/ingest/SessionSummarizer.js';
20
+ /**
21
+ * Outcome shape returned by {@link SummarizedIngestExecutor.ingest}.
22
+ * Mirrors the shape of every other executor's outcome so the dispatch
23
+ * type stays uniform across strategies.
24
+ */
25
+ export interface IngestOutcome {
26
+ writtenTraces: number;
27
+ summary: string;
28
+ embedTexts: string[];
29
+ tokensIn: number;
30
+ tokensOut: number;
31
+ }
32
+ /**
33
+ * Per-call payload. The executor needs the sessionId for SessionSummarizer
34
+ * cache lookups (also used for stable identification in logging) and
35
+ * the optional chunks list for splitting content.
36
+ */
37
+ export interface IngestPayload {
38
+ sessionId: string;
39
+ chunks?: string[];
40
+ }
41
+ /**
42
+ * Reference executor for the IngestRouter `summarized` strategy. Wires
43
+ * the existing SessionSummarizer through the IngestRouter dispatcher
44
+ * pattern so consumers using IngestRouter get Anthropic Contextual
45
+ * Retrieval out of the box.
46
+ */
47
+ export declare class SummarizedIngestExecutor {
48
+ /** Strategy ID expected by IngestRouter's FunctionIngestDispatcher registry. */
49
+ readonly strategyId: "summarized";
50
+ private readonly summarizer;
51
+ constructor(opts: {
52
+ summarizer: SessionSummarizer;
53
+ });
54
+ /**
55
+ * Ingest a session's content. Delegates to the wrapped
56
+ * SessionSummarizer for the LLM call (which handles caching, cost
57
+ * tracking, and prompt management). Returns the summary prepended
58
+ * to every chunk, ready for embedding.
59
+ *
60
+ * Per-call tokensIn/tokensOut are reported as 0 because the
61
+ * SessionSummarizer's disk cache obscures whether a particular
62
+ * `summarize()` call hit the cache or fired the LLM. Callers that
63
+ * need precise per-call cost should inspect
64
+ * {@link SessionSummarizer.stats} directly.
65
+ */
66
+ ingest(content: string, payload: IngestPayload): Promise<IngestOutcome>;
67
+ }
68
+ //# sourceMappingURL=SummarizedIngestExecutor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SummarizedIngestExecutor.d.ts","sourceRoot":"","sources":["../../../src/ingest-router/executors/SummarizedIngestExecutor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAE7E;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;;;GAKG;AACH,qBAAa,wBAAwB;IACnC,gFAAgF;IAChF,QAAQ,CAAC,UAAU,EAAG,YAAY,CAAU;IAE5C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoB;gBAEnC,IAAI,EAAE;QAAE,UAAU,EAAE,iBAAiB,CAAA;KAAE;IAInD;;;;;;;;;;;OAWG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;CAa9E"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * @file SummarizedIngestExecutor.ts
3
+ * @description Anthropic Contextual Retrieval reference executor for
4
+ * the IngestRouter `summarized` strategy.
5
+ *
6
+ * Wraps the existing {@link SessionSummarizer} (in
7
+ * `@framers/agentos/memory`) which carries the conversation-tuned
8
+ * summarization prompt + persistent disk cache + cost-tracking. This
9
+ * executor is the IngestRouter-shaped facade over that primitive, so
10
+ * the production SessionSummarizer is the single source of truth for
11
+ * session-level summarization across both the bench and the
12
+ * IngestRouter dispatcher path.
13
+ *
14
+ * Cost model: ~$0.003 per session at gpt-5-mini. SessionSummarizer's
15
+ * SHA-256 disk cache means re-runs against the same sessions are $0.
16
+ *
17
+ * @module @framers/agentos/ingest-router/executors/SummarizedIngestExecutor
18
+ */
19
+ /**
20
+ * Reference executor for the IngestRouter `summarized` strategy. Wires
21
+ * the existing SessionSummarizer through the IngestRouter dispatcher
22
+ * pattern so consumers using IngestRouter get Anthropic Contextual
23
+ * Retrieval out of the box.
24
+ */
25
+ export class SummarizedIngestExecutor {
26
+ constructor(opts) {
27
+ /** Strategy ID expected by IngestRouter's FunctionIngestDispatcher registry. */
28
+ this.strategyId = 'summarized';
29
+ this.summarizer = opts.summarizer;
30
+ }
31
+ /**
32
+ * Ingest a session's content. Delegates to the wrapped
33
+ * SessionSummarizer for the LLM call (which handles caching, cost
34
+ * tracking, and prompt management). Returns the summary prepended
35
+ * to every chunk, ready for embedding.
36
+ *
37
+ * Per-call tokensIn/tokensOut are reported as 0 because the
38
+ * SessionSummarizer's disk cache obscures whether a particular
39
+ * `summarize()` call hit the cache or fired the LLM. Callers that
40
+ * need precise per-call cost should inspect
41
+ * {@link SessionSummarizer.stats} directly.
42
+ */
43
+ async ingest(content, payload) {
44
+ const summary = await this.summarizer.summarize(payload.sessionId, content);
45
+ const chunks = payload.chunks ?? [content];
46
+ const embedTexts = chunks.map((chunk) => `${summary}\n\n${chunk}`);
47
+ return {
48
+ writtenTraces: chunks.length,
49
+ summary,
50
+ embedTexts,
51
+ tokensIn: 0,
52
+ tokensOut: 0,
53
+ };
54
+ }
55
+ }
56
+ //# sourceMappingURL=SummarizedIngestExecutor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SummarizedIngestExecutor.js","sourceRoot":"","sources":["../../../src/ingest-router/executors/SummarizedIngestExecutor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AA2BH;;;;;GAKG;AACH,MAAM,OAAO,wBAAwB;IAMnC,YAAY,IAAuC;QALnD,gFAAgF;QACvE,eAAU,GAAG,YAAqB,CAAC;QAK1C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACpC,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,MAAM,CAAC,OAAe,EAAE,OAAsB;QAClD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC5E,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC;QAC3C,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,OAAO,OAAO,KAAK,EAAE,CAAC,CAAC;QAEnE,OAAO;YACL,aAAa,EAAE,MAAM,CAAC,MAAM;YAC5B,OAAO;YACP,UAAU;YACV,QAAQ,EAAE,CAAC;YACX,SAAS,EAAE,CAAC;SACb,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * @file entity-types.ts
3
+ * @description Types for the Mem0-v3-style entity-linking ingest
4
+ * executor (Stage I).
5
+ *
6
+ * Mem0 v3 dropped its graph store in favor of single-pass ADD-only
7
+ * fact extraction with multi-signal hybrid search. Entity extraction
8
+ * powers the entity-overlap re-rank signal at recall time. See spec
9
+ * §3.2 + STAGE_L_PHASE_A_FINDINGS for why this is the next-priority
10
+ * accuracy push.
11
+ *
12
+ * Reference: docs.mem0.ai/migration/oss-v2-to-v3.
13
+ *
14
+ * @module @framers/agentos/ingest-router/executors/entity-types
15
+ */
16
+ /**
17
+ * Three entity kinds extracted at ingest. Mem0 v3 spec.
18
+ */
19
+ export type EntityKind = 'proper-noun' | 'quoted-text' | 'compound-noun-phrase';
20
+ /**
21
+ * One extracted entity with its kind + character offsets.
22
+ */
23
+ export interface ExtractedEntity {
24
+ /** The literal entity string as it appears in the source text. */
25
+ text: string;
26
+ /** Classification of how the entity was identified. */
27
+ kind: EntityKind;
28
+ /** Character offsets in the source where this entity was matched. */
29
+ positions: number[];
30
+ }
31
+ /**
32
+ * Result of running EntityExtractor on a piece of text.
33
+ */
34
+ export interface EntityExtractionResult {
35
+ /** Every entity found, in detection order. */
36
+ entities: ExtractedEntity[];
37
+ /** The raw text the extractor ran against. */
38
+ rawText: string;
39
+ }
40
+ /**
41
+ * Tunable parameters for entity extraction.
42
+ */
43
+ export interface EntityLinkingOptions {
44
+ /**
45
+ * Minimum length for a token to count as a proper noun. Default 2.
46
+ * Filters out single-letter capitals (e.g., "I", "A").
47
+ */
48
+ properNounMinLength?: number;
49
+ /**
50
+ * Maximum number of consecutive capitalized tokens to count as one
51
+ * compound noun phrase. Default 5.
52
+ */
53
+ compoundNounMaxLength?: number;
54
+ }
55
+ //# sourceMappingURL=entity-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-types.d.ts","sourceRoot":"","sources":["../../../src/ingest-router/executors/entity-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,aAAa,GAAG,sBAAsB,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,IAAI,EAAE,UAAU,CAAC;IACjB,qEAAqE;IACrE,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,8CAA8C;IAC9C,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @file entity-types.ts
3
+ * @description Types for the Mem0-v3-style entity-linking ingest
4
+ * executor (Stage I).
5
+ *
6
+ * Mem0 v3 dropped its graph store in favor of single-pass ADD-only
7
+ * fact extraction with multi-signal hybrid search. Entity extraction
8
+ * powers the entity-overlap re-rank signal at recall time. See spec
9
+ * §3.2 + STAGE_L_PHASE_A_FINDINGS for why this is the next-priority
10
+ * accuracy push.
11
+ *
12
+ * Reference: docs.mem0.ai/migration/oss-v2-to-v3.
13
+ *
14
+ * @module @framers/agentos/ingest-router/executors/entity-types
15
+ */
16
+ export {};
17
+ //# sourceMappingURL=entity-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-types.js","sourceRoot":"","sources":["../../../src/ingest-router/executors/entity-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @file executors/index.ts
3
+ * @description Sub-barrel for IngestRouter reference executors. The
4
+ * top-level `@framers/agentos/ingest-router` barrel re-exports these
5
+ * symbols so consumers can write
6
+ * `import { SummarizedIngestExecutor } from '../../ingest-router'`.
7
+ *
8
+ * Reference executors ship in agentos core (not in extension packages)
9
+ * so the IngestRouter strategy IDs (`summarized`, `raw-chunks`, `skip`)
10
+ * work out of the box rather than being empty promises.
11
+ *
12
+ * The summarized executor wraps the existing
13
+ * {@link SessionSummarizer} from `@framers/agentos/memory` so the
14
+ * production summarization primitive is the single source of truth.
15
+ */
16
+ export { SummarizedIngestExecutor } from './SummarizedIngestExecutor.js';
17
+ export type { IngestOutcome, IngestPayload } from './SummarizedIngestExecutor.js';
18
+ export { RawChunksIngestExecutor } from './RawChunksIngestExecutor.js';
19
+ export type { RawChunksOutcome } from './RawChunksIngestExecutor.js';
20
+ export { SkipIngestExecutor } from './SkipIngestExecutor.js';
21
+ export { EntityExtractor } from './EntityExtractor.js';
22
+ export { EntityLinkingIngestExecutor } from './EntityLinkingIngestExecutor.js';
23
+ export type { EntityLinkingOutcome } from './EntityLinkingIngestExecutor.js';
24
+ export type { EntityKind, ExtractedEntity, EntityExtractionResult, EntityLinkingOptions, } from './entity-types.js';
25
+ import { SummarizedIngestExecutor } from './SummarizedIngestExecutor.js';
26
+ import { RawChunksIngestExecutor } from './RawChunksIngestExecutor.js';
27
+ import { SkipIngestExecutor } from './SkipIngestExecutor.js';
28
+ import { EntityLinkingIngestExecutor } from './EntityLinkingIngestExecutor.js';
29
+ import type { SessionSummarizer } from '../../memory/ingest/SessionSummarizer.js';
30
+ import type { EntityLinkingOptions } from './entity-types.js';
31
+ export declare function createSummarizedIngestExecutor(opts: {
32
+ summarizer: SessionSummarizer;
33
+ }): SummarizedIngestExecutor;
34
+ export declare function createRawChunksIngestExecutor(): RawChunksIngestExecutor;
35
+ export declare function createSkipIngestExecutor(): SkipIngestExecutor;
36
+ export declare function createEntityLinkingIngestExecutor(opts?: EntityLinkingOptions): EntityLinkingIngestExecutor;
37
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ingest-router/executors/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,YAAY,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,YAAY,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,YAAY,EACV,UAAU,EACV,eAAe,EACf,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAClF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,wBAAgB,8BAA8B,CAAC,IAAI,EAAE;IACnD,UAAU,EAAE,iBAAiB,CAAC;CAC/B,GAAG,wBAAwB,CAE3B;AAED,wBAAgB,6BAA6B,IAAI,uBAAuB,CAEvE;AAED,wBAAgB,wBAAwB,IAAI,kBAAkB,CAE7D;AAED,wBAAgB,iCAAiC,CAC/C,IAAI,GAAE,oBAAyB,GAC9B,2BAA2B,CAE7B"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @file executors/index.ts
3
+ * @description Sub-barrel for IngestRouter reference executors. The
4
+ * top-level `@framers/agentos/ingest-router` barrel re-exports these
5
+ * symbols so consumers can write
6
+ * `import { SummarizedIngestExecutor } from '../../ingest-router'`.
7
+ *
8
+ * Reference executors ship in agentos core (not in extension packages)
9
+ * so the IngestRouter strategy IDs (`summarized`, `raw-chunks`, `skip`)
10
+ * work out of the box rather than being empty promises.
11
+ *
12
+ * The summarized executor wraps the existing
13
+ * {@link SessionSummarizer} from `@framers/agentos/memory` so the
14
+ * production summarization primitive is the single source of truth.
15
+ */
16
+ export { SummarizedIngestExecutor } from './SummarizedIngestExecutor.js';
17
+ export { RawChunksIngestExecutor } from './RawChunksIngestExecutor.js';
18
+ export { SkipIngestExecutor } from './SkipIngestExecutor.js';
19
+ export { EntityExtractor } from './EntityExtractor.js';
20
+ export { EntityLinkingIngestExecutor } from './EntityLinkingIngestExecutor.js';
21
+ import { SummarizedIngestExecutor } from './SummarizedIngestExecutor.js';
22
+ import { RawChunksIngestExecutor } from './RawChunksIngestExecutor.js';
23
+ import { SkipIngestExecutor } from './SkipIngestExecutor.js';
24
+ import { EntityLinkingIngestExecutor } from './EntityLinkingIngestExecutor.js';
25
+ export function createSummarizedIngestExecutor(opts) {
26
+ return new SummarizedIngestExecutor(opts);
27
+ }
28
+ export function createRawChunksIngestExecutor() {
29
+ return new RawChunksIngestExecutor();
30
+ }
31
+ export function createSkipIngestExecutor() {
32
+ return new SkipIngestExecutor();
33
+ }
34
+ export function createEntityLinkingIngestExecutor(opts = {}) {
35
+ return new EntityLinkingIngestExecutor(opts);
36
+ }
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ingest-router/executors/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAS/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAI/E,MAAM,UAAU,8BAA8B,CAAC,IAE9C;IACC,OAAO,IAAI,wBAAwB,CAAC,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,6BAA6B;IAC3C,OAAO,IAAI,uBAAuB,EAAE,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,wBAAwB;IACtC,OAAO,IAAI,kBAAkB,EAAE,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,OAA6B,EAAE;IAE/B,OAAO,IAAI,2BAA2B,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC"}