@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,259 @@
1
+ /**
2
+ * @fileoverview SQLite-backed implementation of IKnowledgeGraph.
3
+ *
4
+ * Persists knowledge entities (nodes), relations (edges), and episodic memories
5
+ * to the `knowledge_nodes` and `knowledge_edges` tables managed by SqliteBrain.
6
+ *
7
+ * Episodic memories are stored as knowledge_nodes with `type = 'memory'` and
8
+ * their memory-specific fields packed into the `properties` JSON column.
9
+ *
10
+ * Graph traversal (BFS/DFS, shortest path, neighbourhood) is implemented via
11
+ * SQLite recursive Common Table Expressions (CTEs).
12
+ *
13
+ * Semantic search loads embeddings from BLOB columns and computes cosine
14
+ * similarity in-process — no external vector DB needed for the SQLite path.
15
+ *
16
+ * @module memory/store/SqliteKnowledgeGraph
17
+ */
18
+ import type { IKnowledgeGraph, KnowledgeEntity, KnowledgeRelation, EpisodicMemory, EntityId, RelationId, EntityType, RelationType, KnowledgeQueryOptions, TraversalOptions, TraversalResult, SemanticSearchOptions, SemanticSearchResult, KnowledgeGraphStats } from '../../core/knowledge/IKnowledgeGraph.js';
19
+ import type { SqliteBrain } from './SqliteBrain.js';
20
+ /**
21
+ * Persistent knowledge graph backed by SQLite via SqliteBrain.
22
+ *
23
+ * Implements the full `IKnowledgeGraph` interface using the `knowledge_nodes`
24
+ * and `knowledge_edges` tables. Extended entity/relation fields that don't
25
+ * have dedicated columns are serialized into the JSON `properties` / `metadata`
26
+ * columns.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const brain = new SqliteBrain('/tmp/agent-brain.sqlite');
31
+ * const graph = new SqliteKnowledgeGraph(brain);
32
+ * await graph.initialize();
33
+ *
34
+ * const entity = await graph.upsertEntity({
35
+ * type: 'person',
36
+ * label: 'Alice',
37
+ * properties: { role: 'engineer' },
38
+ * confidence: 0.95,
39
+ * source: { type: 'user_input', timestamp: new Date().toISOString() },
40
+ * });
41
+ * ```
42
+ */
43
+ export declare class SqliteKnowledgeGraph implements IKnowledgeGraph {
44
+ /** The shared SQLite brain instance. */
45
+ private readonly brain;
46
+ /**
47
+ * @param brain - A SqliteBrain instance whose `db` handle is used for all queries.
48
+ */
49
+ constructor(brain: SqliteBrain);
50
+ /**
51
+ * Initialize the knowledge graph.
52
+ *
53
+ * The schema is already created by SqliteBrain's constructor, so this is
54
+ * effectively a no-op. Provided to satisfy the IKnowledgeGraph contract.
55
+ */
56
+ initialize(): Promise<void>;
57
+ /**
58
+ * Insert or update a knowledge entity.
59
+ *
60
+ * If `entity.id` is provided and exists, the row is updated (INSERT OR REPLACE).
61
+ * If omitted, a new UUID is generated.
62
+ *
63
+ * Extended fields (ownerId, tags, metadata, updatedAt) are packed into the
64
+ * `properties` JSON column as underscore-prefixed keys to avoid collisions
65
+ * with user-supplied properties.
66
+ */
67
+ upsertEntity(entity: Omit<KnowledgeEntity, 'id' | 'createdAt' | 'updatedAt'> & {
68
+ id?: EntityId;
69
+ }): Promise<KnowledgeEntity>;
70
+ /**
71
+ * Retrieve a single entity by its ID.
72
+ * Returns `undefined` if the entity does not exist.
73
+ */
74
+ getEntity(id: EntityId): Promise<KnowledgeEntity | undefined>;
75
+ /**
76
+ * Query entities with optional filters.
77
+ *
78
+ * Supports filtering by entity type, tags, owner, minimum confidence,
79
+ * full-text search, pagination (limit/offset), and time ranges.
80
+ */
81
+ queryEntities(options?: KnowledgeQueryOptions): Promise<KnowledgeEntity[]>;
82
+ /**
83
+ * Delete an entity and all its associated relations (incoming and outgoing).
84
+ * Returns `true` if the entity existed and was deleted.
85
+ */
86
+ deleteEntity(id: EntityId): Promise<boolean>;
87
+ /**
88
+ * Insert or update a knowledge relation (edge).
89
+ *
90
+ * Extended edge fields (label, properties, confidence, source, validFrom,
91
+ * validTo) are packed into the `metadata` JSON column.
92
+ */
93
+ upsertRelation(relation: Omit<KnowledgeRelation, 'id' | 'createdAt'> & {
94
+ id?: RelationId;
95
+ }): Promise<KnowledgeRelation>;
96
+ /**
97
+ * Get all relations for a given entity.
98
+ *
99
+ * @param entityId - The entity whose relations to retrieve.
100
+ * @param options - Optional filters: direction ('outgoing'|'incoming'|'both'), types.
101
+ */
102
+ getRelations(entityId: EntityId, options?: {
103
+ direction?: 'outgoing' | 'incoming' | 'both';
104
+ types?: RelationType[];
105
+ }): Promise<KnowledgeRelation[]>;
106
+ /**
107
+ * Delete a single relation by its ID.
108
+ * Returns `true` if the relation existed and was deleted.
109
+ */
110
+ deleteRelation(id: RelationId): Promise<boolean>;
111
+ /**
112
+ * Record an episodic memory.
113
+ *
114
+ * Memories are stored as knowledge_nodes with `type = 'memory'`. The
115
+ * memory-specific fields are packed into the `properties` JSON column.
116
+ */
117
+ recordMemory(memory: Omit<EpisodicMemory, 'id' | 'createdAt' | 'accessCount' | 'lastAccessedAt'>): Promise<EpisodicMemory>;
118
+ /**
119
+ * Get an episodic memory by ID.
120
+ *
121
+ * Looks up the knowledge_node with the given ID and `type = 'memory'`,
122
+ * then unpacks the memory-specific fields from the `properties` JSON.
123
+ */
124
+ getMemory(id: string): Promise<EpisodicMemory | undefined>;
125
+ /**
126
+ * Query episodic memories with optional filters.
127
+ *
128
+ * Supports filtering by memory sub-type, participants, minimum importance,
129
+ * time range, and result limit.
130
+ */
131
+ queryMemories(options?: {
132
+ types?: EpisodicMemory['type'][];
133
+ participants?: string[];
134
+ minImportance?: number;
135
+ timeRange?: {
136
+ from?: string;
137
+ to?: string;
138
+ };
139
+ limit?: number;
140
+ }): Promise<EpisodicMemory[]>;
141
+ /**
142
+ * Recall relevant memories via keyword search against summaries.
143
+ *
144
+ * Performs a case-insensitive substring match on the label (which contains
145
+ * the summary text). Increments accessCount and updates lastAccessedAt for
146
+ * each returned memory (Hebbian reinforcement).
147
+ *
148
+ * Full semantic (embedding-based) recall requires the Memory facade.
149
+ */
150
+ recallMemories(query: string, topK?: number): Promise<EpisodicMemory[]>;
151
+ /**
152
+ * Traverse the graph from a starting entity using BFS.
153
+ *
154
+ * Uses a recursive CTE (Common Table Expression) to walk the graph up to
155
+ * `maxDepth` hops from the start node. Results are grouped by depth level.
156
+ *
157
+ * @param startEntityId - ID of the entity to start traversal from.
158
+ * @param options - Optional: maxDepth, relationTypes, direction, minWeight, maxNodes.
159
+ */
160
+ traverse(startEntityId: EntityId, options?: TraversalOptions): Promise<TraversalResult>;
161
+ /**
162
+ * Find the shortest path between two entities using a bidirectional BFS
163
+ * implemented via a recursive CTE.
164
+ *
165
+ * Returns an ordered array of `{ entity, relation? }` steps from source to
166
+ * target, or `null` if no path exists within `maxDepth` hops.
167
+ */
168
+ findPath(sourceId: EntityId, targetId: EntityId, maxDepth?: number): Promise<Array<{
169
+ entity: KnowledgeEntity;
170
+ relation?: KnowledgeRelation;
171
+ }> | null>;
172
+ /**
173
+ * Get the neighbourhood of an entity — all entities and relations within
174
+ * `depth` hops.
175
+ *
176
+ * @param entityId - Centre entity.
177
+ * @param depth - Maximum number of hops (default 1).
178
+ */
179
+ getNeighborhood(entityId: EntityId, depth?: number): Promise<{
180
+ entities: KnowledgeEntity[];
181
+ relations: KnowledgeRelation[];
182
+ }>;
183
+ /**
184
+ * Semantic search across entities and/or memories.
185
+ *
186
+ * Loads all embeddings from `knowledge_nodes`, computes cosine similarity
187
+ * against the query embedding (if present in `options`), and returns the
188
+ * top-K results above the minimum similarity threshold.
189
+ *
190
+ * NOTE: This implementation requires the caller to provide a query embedding
191
+ * via a pre-processing step. If no nodes have embeddings, an empty array is
192
+ * returned. For full text-to-embedding semantic search, use the Memory facade.
193
+ */
194
+ semanticSearch(options: SemanticSearchOptions): Promise<SemanticSearchResult[]>;
195
+ /**
196
+ * Extract entities and relations from text.
197
+ *
198
+ * This operation requires an LLM and is not supported at the store level.
199
+ * Use the Memory facade for LLM-powered extraction.
200
+ *
201
+ * @throws {Error} Always — extraction requires an LLM.
202
+ */
203
+ extractFromText(_text: string, _options?: {
204
+ extractRelations?: boolean;
205
+ entityTypes?: EntityType[];
206
+ }): Promise<{
207
+ entities: KnowledgeEntity[];
208
+ relations: KnowledgeRelation[];
209
+ }>;
210
+ /**
211
+ * Merge multiple entities into one primary entity.
212
+ *
213
+ * All relations (edges) pointing to or from the non-primary entities are
214
+ * re-linked to the primary entity. The non-primary entities are then deleted.
215
+ *
216
+ * @param entityIds - All entity IDs involved in the merge.
217
+ * @param primaryId - The ID that survives the merge.
218
+ */
219
+ mergeEntities(entityIds: EntityId[], primaryId: EntityId): Promise<KnowledgeEntity>;
220
+ /**
221
+ * Decay the confidence of all memory-type nodes by a multiplicative factor.
222
+ *
223
+ * This simulates the Ebbinghaus forgetting curve — memories that are not
224
+ * accessed (reinforced) gradually fade.
225
+ *
226
+ * @param decayFactor - Multiplicative factor in (0, 1). Default 0.95.
227
+ * @returns The number of memory nodes whose confidence was reduced.
228
+ */
229
+ decayMemories(decayFactor?: number): Promise<number>;
230
+ /**
231
+ * Get aggregate statistics about the knowledge graph.
232
+ *
233
+ * Returns counts of entities, relations, memories, breakdowns by type,
234
+ * average confidence, and oldest/newest entry timestamps.
235
+ */
236
+ getStats(): Promise<KnowledgeGraphStats>;
237
+ /**
238
+ * Delete all rows from knowledge_nodes and knowledge_edges.
239
+ * Wipes the knowledge graph completely.
240
+ */
241
+ clear(): Promise<void>;
242
+ /**
243
+ * Convert a raw `knowledge_nodes` row into a `KnowledgeEntity` domain object.
244
+ * Unpacks extended fields from the `properties` JSON column.
245
+ */
246
+ private _rowToEntity;
247
+ /**
248
+ * Convert a raw `knowledge_edges` row into a `KnowledgeRelation` domain object.
249
+ * Unpacks extended fields from the `metadata` JSON column.
250
+ */
251
+ private _rowToRelation;
252
+ /**
253
+ * Convert a raw `knowledge_nodes` row (with `type = 'memory'`) into an
254
+ * `EpisodicMemory` domain object. Unpacks memory-specific fields from the
255
+ * `properties` JSON column.
256
+ */
257
+ private _rowToMemory;
258
+ }
259
+ //# sourceMappingURL=SqliteKnowledgeGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SqliteKnowledgeGraph.d.ts","sourceRoot":"","sources":["../../../src/memory/store/SqliteKnowledgeGraph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,QAAQ,EACR,UAAU,EACV,UAAU,EACV,YAAY,EACZ,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EAEpB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AA6JpD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,oBAAqB,YAAW,eAAe;IAC1D,wCAAwC;IACxC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IAEpC;;OAEG;gBACS,KAAK,EAAE,WAAW;IAQ9B;;;;;OAKG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IASjC;;;;;;;;;OASG;IACG,YAAY,CAChB,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,IAAI,GAAG,WAAW,GAAG,WAAW,CAAC,GAAG;Q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