@easbot/memory 0.1.13 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +79 -0
- package/README.md +20 -104
- package/dist/chunks/chunk-5SBYP5H4.cjs +4 -0
- package/dist/chunks/chunk-MS352GPQ.mjs +4 -0
- package/dist/chunks/log-FDVK2LXU.cjs +1 -0
- package/dist/chunks/log-WWZ27AYI.mjs +1 -0
- package/dist/index.cjs +47 -53
- package/dist/index.d.cts +92 -23
- package/dist/index.d.ts +92 -23
- package/dist/index.mjs +47 -53
- package/package.json +8 -5
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { MemoryKnowledgeConfigWithModels } from '@easbot/types';
|
|
1
|
+
import { KnowledgeSearchOptions, MemoryKnowledgeConfigWithModels } from '@easbot/types';
|
|
2
2
|
export { GRAPH_ENTITY_TYPE_DEFINITIONS, GRAPH_RELATION_TYPE_DEFINITIONS } from '@easbot/types';
|
|
3
3
|
import Database, { Database as Database$1 } from 'better-sqlite3';
|
|
4
4
|
export { EmbeddingModel, LanguageModel } from 'ai';
|
|
5
5
|
|
|
6
|
-
type MemoryCategory = 'user_preference' | 'task_context' | 'technical_fact' | 'decision' | 'relationship' | 'reminder' | 'error_pattern' | 'workflow' | 'exploration_finding' | 'experience_summary' | 'tool_usage' | 'skill_creation' | 'other';
|
|
6
|
+
type MemoryCategory = 'user_preference' | 'task_context' | 'technical_fact' | 'decision' | 'relationship' | 'reminder' | 'error_pattern' | 'workflow' | 'exploration_finding' | 'experience_summary' | 'tool_usage' | 'skill_creation' | 'test' | 'other';
|
|
7
7
|
declare const MEMORY_CATEGORIES: MemoryCategory[];
|
|
8
8
|
type MemorySource = 'session_self_write' | 'historical';
|
|
9
9
|
interface MemoryFact {
|
|
@@ -19,8 +19,8 @@ interface MemoryFact {
|
|
|
19
19
|
tags?: string[];
|
|
20
20
|
nodeIds?: number[];
|
|
21
21
|
filePath?: string;
|
|
22
|
-
createdAt:
|
|
23
|
-
updatedAt:
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
24
|
}
|
|
25
25
|
interface MemoryVector {
|
|
26
26
|
factId: string;
|
|
@@ -47,19 +47,14 @@ interface SessionMessage {
|
|
|
47
47
|
providerId?: string;
|
|
48
48
|
createdAt: number;
|
|
49
49
|
}
|
|
50
|
-
interface MemoryQuery {
|
|
50
|
+
interface MemoryQuery extends KnowledgeSearchOptions {
|
|
51
51
|
agentId: string;
|
|
52
52
|
sessionId?: string;
|
|
53
|
-
query?: string;
|
|
54
53
|
category?: MemoryCategory;
|
|
55
54
|
minImportance?: number;
|
|
56
55
|
source?: MemorySource;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
toTime?: number;
|
|
60
|
-
minScore?: number;
|
|
61
|
-
vectorWeight?: number;
|
|
62
|
-
textWeight?: number;
|
|
56
|
+
fromTime?: string;
|
|
57
|
+
toTime?: string;
|
|
63
58
|
candidateFactIds?: string[];
|
|
64
59
|
}
|
|
65
60
|
interface MemoryRecallResult {
|
|
@@ -69,18 +64,15 @@ interface MemoryRecallResult {
|
|
|
69
64
|
agentId: string;
|
|
70
65
|
snippet: string;
|
|
71
66
|
score: number;
|
|
72
|
-
createdAt:
|
|
67
|
+
createdAt: string;
|
|
73
68
|
source: MemorySource;
|
|
74
69
|
filePath?: string;
|
|
75
70
|
nodes?: Array<{
|
|
76
71
|
id: number;
|
|
77
72
|
name: string;
|
|
78
73
|
type: string;
|
|
79
|
-
edges?: Array<{
|
|
80
|
-
|
|
81
|
-
targetId: number;
|
|
82
|
-
targetName: string;
|
|
83
|
-
targetType: string;
|
|
74
|
+
edges?: Array<MemoryEdge & {
|
|
75
|
+
direction?: 'in' | 'out';
|
|
84
76
|
}>;
|
|
85
77
|
}>;
|
|
86
78
|
}
|
|
@@ -88,6 +80,17 @@ type MemorySystemConfig = MemoryKnowledgeConfigWithModels;
|
|
|
88
80
|
interface IMemorySystem {
|
|
89
81
|
remember(fact: Omit<MemoryFact, 'id' | 'createdAt' | 'updatedAt'>): Promise<MemoryFact>;
|
|
90
82
|
query(query: string, options?: MemoryQuery): Promise<MemoryRecallResult[]>;
|
|
83
|
+
queryEdgesByNodeId(nodeId: number, options?: {
|
|
84
|
+
maxDepth?: number;
|
|
85
|
+
}): Promise<{
|
|
86
|
+
node?: {
|
|
87
|
+
id: number;
|
|
88
|
+
name: string;
|
|
89
|
+
type: string;
|
|
90
|
+
};
|
|
91
|
+
nodes: MemoryNode[];
|
|
92
|
+
edges: MemoryEdge[];
|
|
93
|
+
}>;
|
|
91
94
|
forget(agentId: string, memoryId: string): Promise<void>;
|
|
92
95
|
update(agentId: string, memoryId: string, patch: {
|
|
93
96
|
content?: string;
|
|
@@ -102,6 +105,24 @@ interface IMemorySystem {
|
|
|
102
105
|
archive(): Promise<void>;
|
|
103
106
|
clear(): Promise<void>;
|
|
104
107
|
close(): Promise<void>;
|
|
108
|
+
sync(): Promise<{
|
|
109
|
+
synced: number;
|
|
110
|
+
created: number;
|
|
111
|
+
updated: number;
|
|
112
|
+
errors: string[];
|
|
113
|
+
}>;
|
|
114
|
+
getStatus(): Promise<{
|
|
115
|
+
dbPath: string;
|
|
116
|
+
workspaceDir: string;
|
|
117
|
+
factsCount: number;
|
|
118
|
+
nodesCount: number;
|
|
119
|
+
edgesCount: number;
|
|
120
|
+
shortTermCount: number;
|
|
121
|
+
embeddingLlmAvailable: boolean;
|
|
122
|
+
graphLlmAvailable: boolean;
|
|
123
|
+
healthy: boolean;
|
|
124
|
+
meta: Record<string, string>;
|
|
125
|
+
}>;
|
|
105
126
|
}
|
|
106
127
|
declare class MemoryError extends Error {
|
|
107
128
|
readonly code: string;
|
|
@@ -143,8 +164,8 @@ interface MemoryNode {
|
|
|
143
164
|
name: string;
|
|
144
165
|
type: string;
|
|
145
166
|
properties?: Record<string, unknown>;
|
|
146
|
-
createdAt:
|
|
147
|
-
updatedAt:
|
|
167
|
+
createdAt: string;
|
|
168
|
+
updatedAt: string;
|
|
148
169
|
}
|
|
149
170
|
interface MemoryEdge {
|
|
150
171
|
id: number;
|
|
@@ -152,7 +173,8 @@ interface MemoryEdge {
|
|
|
152
173
|
target: number;
|
|
153
174
|
relation: string;
|
|
154
175
|
properties?: Record<string, unknown>;
|
|
155
|
-
createdAt:
|
|
176
|
+
createdAt: string;
|
|
177
|
+
targetNode?: MemoryNode;
|
|
156
178
|
}
|
|
157
179
|
interface MemoryNodeWithEdges extends MemoryNode {
|
|
158
180
|
edges?: MemoryEdge[];
|
|
@@ -215,6 +237,8 @@ declare class MemoryDatabaseManager {
|
|
|
215
237
|
getPath(): string;
|
|
216
238
|
close(): void;
|
|
217
239
|
healthCheck(): boolean;
|
|
240
|
+
getMeta(key: string): string | null;
|
|
241
|
+
setMeta(key: string, value: string): void;
|
|
218
242
|
}
|
|
219
243
|
|
|
220
244
|
declare class MemoryFormatter {
|
|
@@ -259,7 +283,9 @@ declare class GraphStore {
|
|
|
259
283
|
upsertEdge(source: number, target: number, relation: string, properties?: Record<string, unknown>): Promise<number>;
|
|
260
284
|
queryNodes(filter?: NodeQueryFilter): Promise<MemoryNode[]>;
|
|
261
285
|
queryEdges(filter?: EdgeQueryFilter): Promise<MemoryEdge[]>;
|
|
262
|
-
queryNeighbors(nodeId: number, depth?: number
|
|
286
|
+
queryNeighbors(nodeId: number, depth?: number, options?: {
|
|
287
|
+
maxEdgesPerNode?: number;
|
|
288
|
+
}): Promise<MemoryNodeWithEdges[]>;
|
|
263
289
|
}
|
|
264
290
|
|
|
265
291
|
declare class MemorySystem implements IMemorySystem {
|
|
@@ -274,6 +300,18 @@ declare class MemorySystem implements IMemorySystem {
|
|
|
274
300
|
initialize(): Promise<void>;
|
|
275
301
|
remember(fact: Omit<MemoryFact, 'id' | 'createdAt' | 'updatedAt'>): Promise<MemoryFact>;
|
|
276
302
|
query(query: string, options?: MemoryQuery): Promise<MemoryRecallResult[]>;
|
|
303
|
+
queryEdgesByNodeId(nodeId: number, options?: {
|
|
304
|
+
maxDepth?: number;
|
|
305
|
+
maxEdgesPerNode?: number;
|
|
306
|
+
}): Promise<{
|
|
307
|
+
node?: {
|
|
308
|
+
id: number;
|
|
309
|
+
name: string;
|
|
310
|
+
type: string;
|
|
311
|
+
};
|
|
312
|
+
nodes: MemoryNode[];
|
|
313
|
+
edges: MemoryEdge[];
|
|
314
|
+
}>;
|
|
277
315
|
forget(agentId: string, memoryId: string): Promise<void>;
|
|
278
316
|
update(agentId: string, memoryId: string, patch: {
|
|
279
317
|
content?: string;
|
|
@@ -289,12 +327,35 @@ declare class MemorySystem implements IMemorySystem {
|
|
|
289
327
|
cleanupOrphanRecords(): Promise<void>;
|
|
290
328
|
clear(): Promise<void>;
|
|
291
329
|
close(): Promise<void>;
|
|
330
|
+
getStatus(): Promise<{
|
|
331
|
+
dbPath: string;
|
|
332
|
+
workspaceDir: string;
|
|
333
|
+
factsCount: number;
|
|
334
|
+
nodesCount: number;
|
|
335
|
+
edgesCount: number;
|
|
336
|
+
shortTermCount: number;
|
|
337
|
+
embeddingLlmAvailable: boolean;
|
|
338
|
+
graphLlmAvailable: boolean;
|
|
339
|
+
healthy: boolean;
|
|
340
|
+
meta: Record<string, string>;
|
|
341
|
+
}>;
|
|
342
|
+
sync(): Promise<{
|
|
343
|
+
synced: number;
|
|
344
|
+
created: number;
|
|
345
|
+
updated: number;
|
|
346
|
+
errors: string[];
|
|
347
|
+
}>;
|
|
348
|
+
private hasMemoryFiles;
|
|
349
|
+
private clearFiles;
|
|
350
|
+
private rowToFact;
|
|
292
351
|
private extractEntities;
|
|
293
352
|
private extractEntitiesWithLlm;
|
|
294
353
|
private buildEntityExtractionPrompt;
|
|
295
354
|
private storeEntitiesAndRelations;
|
|
355
|
+
private mergeEntitiesAndRelations;
|
|
296
356
|
private embed;
|
|
297
357
|
private embedAndStore;
|
|
358
|
+
private writeVector;
|
|
298
359
|
private writeFts;
|
|
299
360
|
private parseEntityExtractionResult;
|
|
300
361
|
private normalizeExtractionResult;
|
|
@@ -306,4 +367,12 @@ declare class MemorySystem implements IMemorySystem {
|
|
|
306
367
|
}
|
|
307
368
|
declare function createMemorySystem(config: MemorySystemConfig): Promise<IMemorySystem>;
|
|
308
369
|
|
|
309
|
-
|
|
370
|
+
declare function initLog(options: {
|
|
371
|
+
print: boolean;
|
|
372
|
+
logDir: string;
|
|
373
|
+
logFile?: string;
|
|
374
|
+
dev?: boolean;
|
|
375
|
+
level?: 'DEBUG' | 'INFO' | 'WARN' | 'ERROR';
|
|
376
|
+
}): Promise<void>;
|
|
377
|
+
|
|
378
|
+
export { type ArchiveRecord, type ArchiveResult, type EdgeQueryFilter, GraphStore, type IMemorySystem, MEMORY_CATEGORIES, MemoryArchiver, type MemoryCategory, MemoryDatabaseError, MemoryDatabaseManager, type MemoryEdge, MemoryEmbeddingError, MemoryError, MemoryErrorCode, type MemoryFact, MemoryFileError, MemoryFileManager, MemoryFormatter, type MemoryNode, type MemoryNodeWithEdges, MemoryNotFoundError, MemoryPermissionError, type MemoryQuery, type MemoryRecallResult, MemorySearchError, type MemorySource, MemorySystem, type MemorySystemConfig, MemoryValidationError, type MemoryVector, type NodeQueryFilter, type SessionMessage, type ShortTermEntry, addWord, closeTokenizer, createMemorySystem, initLog, initTokenizer, isInitialized, loadCustomDict, toFtsTokens, toFtsTokensForSearch, tokenize, tokenizeForSearch };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { MemoryKnowledgeConfigWithModels } from '@easbot/types';
|
|
1
|
+
import { KnowledgeSearchOptions, MemoryKnowledgeConfigWithModels } from '@easbot/types';
|
|
2
2
|
export { GRAPH_ENTITY_TYPE_DEFINITIONS, GRAPH_RELATION_TYPE_DEFINITIONS } from '@easbot/types';
|
|
3
3
|
import Database, { Database as Database$1 } from 'better-sqlite3';
|
|
4
4
|
export { EmbeddingModel, LanguageModel } from 'ai';
|
|
5
5
|
|
|
6
|
-
type MemoryCategory = 'user_preference' | 'task_context' | 'technical_fact' | 'decision' | 'relationship' | 'reminder' | 'error_pattern' | 'workflow' | 'exploration_finding' | 'experience_summary' | 'tool_usage' | 'skill_creation' | 'other';
|
|
6
|
+
type MemoryCategory = 'user_preference' | 'task_context' | 'technical_fact' | 'decision' | 'relationship' | 'reminder' | 'error_pattern' | 'workflow' | 'exploration_finding' | 'experience_summary' | 'tool_usage' | 'skill_creation' | 'test' | 'other';
|
|
7
7
|
declare const MEMORY_CATEGORIES: MemoryCategory[];
|
|
8
8
|
type MemorySource = 'session_self_write' | 'historical';
|
|
9
9
|
interface MemoryFact {
|
|
@@ -19,8 +19,8 @@ interface MemoryFact {
|
|
|
19
19
|
tags?: string[];
|
|
20
20
|
nodeIds?: number[];
|
|
21
21
|
filePath?: string;
|
|
22
|
-
createdAt:
|
|
23
|
-
updatedAt:
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
24
|
}
|
|
25
25
|
interface MemoryVector {
|
|
26
26
|
factId: string;
|
|
@@ -47,19 +47,14 @@ interface SessionMessage {
|
|
|
47
47
|
providerId?: string;
|
|
48
48
|
createdAt: number;
|
|
49
49
|
}
|
|
50
|
-
interface MemoryQuery {
|
|
50
|
+
interface MemoryQuery extends KnowledgeSearchOptions {
|
|
51
51
|
agentId: string;
|
|
52
52
|
sessionId?: string;
|
|
53
|
-
query?: string;
|
|
54
53
|
category?: MemoryCategory;
|
|
55
54
|
minImportance?: number;
|
|
56
55
|
source?: MemorySource;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
toTime?: number;
|
|
60
|
-
minScore?: number;
|
|
61
|
-
vectorWeight?: number;
|
|
62
|
-
textWeight?: number;
|
|
56
|
+
fromTime?: string;
|
|
57
|
+
toTime?: string;
|
|
63
58
|
candidateFactIds?: string[];
|
|
64
59
|
}
|
|
65
60
|
interface MemoryRecallResult {
|
|
@@ -69,18 +64,15 @@ interface MemoryRecallResult {
|
|
|
69
64
|
agentId: string;
|
|
70
65
|
snippet: string;
|
|
71
66
|
score: number;
|
|
72
|
-
createdAt:
|
|
67
|
+
createdAt: string;
|
|
73
68
|
source: MemorySource;
|
|
74
69
|
filePath?: string;
|
|
75
70
|
nodes?: Array<{
|
|
76
71
|
id: number;
|
|
77
72
|
name: string;
|
|
78
73
|
type: string;
|
|
79
|
-
edges?: Array<{
|
|
80
|
-
|
|
81
|
-
targetId: number;
|
|
82
|
-
targetName: string;
|
|
83
|
-
targetType: string;
|
|
74
|
+
edges?: Array<MemoryEdge & {
|
|
75
|
+
direction?: 'in' | 'out';
|
|
84
76
|
}>;
|
|
85
77
|
}>;
|
|
86
78
|
}
|
|
@@ -88,6 +80,17 @@ type MemorySystemConfig = MemoryKnowledgeConfigWithModels;
|
|
|
88
80
|
interface IMemorySystem {
|
|
89
81
|
remember(fact: Omit<MemoryFact, 'id' | 'createdAt' | 'updatedAt'>): Promise<MemoryFact>;
|
|
90
82
|
query(query: string, options?: MemoryQuery): Promise<MemoryRecallResult[]>;
|
|
83
|
+
queryEdgesByNodeId(nodeId: number, options?: {
|
|
84
|
+
maxDepth?: number;
|
|
85
|
+
}): Promise<{
|
|
86
|
+
node?: {
|
|
87
|
+
id: number;
|
|
88
|
+
name: string;
|
|
89
|
+
type: string;
|
|
90
|
+
};
|
|
91
|
+
nodes: MemoryNode[];
|
|
92
|
+
edges: MemoryEdge[];
|
|
93
|
+
}>;
|
|
91
94
|
forget(agentId: string, memoryId: string): Promise<void>;
|
|
92
95
|
update(agentId: string, memoryId: string, patch: {
|
|
93
96
|
content?: string;
|
|
@@ -102,6 +105,24 @@ interface IMemorySystem {
|
|
|
102
105
|
archive(): Promise<void>;
|
|
103
106
|
clear(): Promise<void>;
|
|
104
107
|
close(): Promise<void>;
|
|
108
|
+
sync(): Promise<{
|
|
109
|
+
synced: number;
|
|
110
|
+
created: number;
|
|
111
|
+
updated: number;
|
|
112
|
+
errors: string[];
|
|
113
|
+
}>;
|
|
114
|
+
getStatus(): Promise<{
|
|
115
|
+
dbPath: string;
|
|
116
|
+
workspaceDir: string;
|
|
117
|
+
factsCount: number;
|
|
118
|
+
nodesCount: number;
|
|
119
|
+
edgesCount: number;
|
|
120
|
+
shortTermCount: number;
|
|
121
|
+
embeddingLlmAvailable: boolean;
|
|
122
|
+
graphLlmAvailable: boolean;
|
|
123
|
+
healthy: boolean;
|
|
124
|
+
meta: Record<string, string>;
|
|
125
|
+
}>;
|
|
105
126
|
}
|
|
106
127
|
declare class MemoryError extends Error {
|
|
107
128
|
readonly code: string;
|
|
@@ -143,8 +164,8 @@ interface MemoryNode {
|
|
|
143
164
|
name: string;
|
|
144
165
|
type: string;
|
|
145
166
|
properties?: Record<string, unknown>;
|
|
146
|
-
createdAt:
|
|
147
|
-
updatedAt:
|
|
167
|
+
createdAt: string;
|
|
168
|
+
updatedAt: string;
|
|
148
169
|
}
|
|
149
170
|
interface MemoryEdge {
|
|
150
171
|
id: number;
|
|
@@ -152,7 +173,8 @@ interface MemoryEdge {
|
|
|
152
173
|
target: number;
|
|
153
174
|
relation: string;
|
|
154
175
|
properties?: Record<string, unknown>;
|
|
155
|
-
createdAt:
|
|
176
|
+
createdAt: string;
|
|
177
|
+
targetNode?: MemoryNode;
|
|
156
178
|
}
|
|
157
179
|
interface MemoryNodeWithEdges extends MemoryNode {
|
|
158
180
|
edges?: MemoryEdge[];
|
|
@@ -215,6 +237,8 @@ declare class MemoryDatabaseManager {
|
|
|
215
237
|
getPath(): string;
|
|
216
238
|
close(): void;
|
|
217
239
|
healthCheck(): boolean;
|
|
240
|
+
getMeta(key: string): string | null;
|
|
241
|
+
setMeta(key: string, value: string): void;
|
|
218
242
|
}
|
|
219
243
|
|
|
220
244
|
declare class MemoryFormatter {
|
|
@@ -259,7 +283,9 @@ declare class GraphStore {
|
|
|
259
283
|
upsertEdge(source: number, target: number, relation: string, properties?: Record<string, unknown>): Promise<number>;
|
|
260
284
|
queryNodes(filter?: NodeQueryFilter): Promise<MemoryNode[]>;
|
|
261
285
|
queryEdges(filter?: EdgeQueryFilter): Promise<MemoryEdge[]>;
|
|
262
|
-
queryNeighbors(nodeId: number, depth?: number
|
|
286
|
+
queryNeighbors(nodeId: number, depth?: number, options?: {
|
|
287
|
+
maxEdgesPerNode?: number;
|
|
288
|
+
}): Promise<MemoryNodeWithEdges[]>;
|
|
263
289
|
}
|
|
264
290
|
|
|
265
291
|
declare class MemorySystem implements IMemorySystem {
|
|
@@ -274,6 +300,18 @@ declare class MemorySystem implements IMemorySystem {
|
|
|
274
300
|
initialize(): Promise<void>;
|
|
275
301
|
remember(fact: Omit<MemoryFact, 'id' | 'createdAt' | 'updatedAt'>): Promise<MemoryFact>;
|
|
276
302
|
query(query: string, options?: MemoryQuery): Promise<MemoryRecallResult[]>;
|
|
303
|
+
queryEdgesByNodeId(nodeId: number, options?: {
|
|
304
|
+
maxDepth?: number;
|
|
305
|
+
maxEdgesPerNode?: number;
|
|
306
|
+
}): Promise<{
|
|
307
|
+
node?: {
|
|
308
|
+
id: number;
|
|
309
|
+
name: string;
|
|
310
|
+
type: string;
|
|
311
|
+
};
|
|
312
|
+
nodes: MemoryNode[];
|
|
313
|
+
edges: MemoryEdge[];
|
|
314
|
+
}>;
|
|
277
315
|
forget(agentId: string, memoryId: string): Promise<void>;
|
|
278
316
|
update(agentId: string, memoryId: string, patch: {
|
|
279
317
|
content?: string;
|
|
@@ -289,12 +327,35 @@ declare class MemorySystem implements IMemorySystem {
|
|
|
289
327
|
cleanupOrphanRecords(): Promise<void>;
|
|
290
328
|
clear(): Promise<void>;
|
|
291
329
|
close(): Promise<void>;
|
|
330
|
+
getStatus(): Promise<{
|
|
331
|
+
dbPath: string;
|
|
332
|
+
workspaceDir: string;
|
|
333
|
+
factsCount: number;
|
|
334
|
+
nodesCount: number;
|
|
335
|
+
edgesCount: number;
|
|
336
|
+
shortTermCount: number;
|
|
337
|
+
embeddingLlmAvailable: boolean;
|
|
338
|
+
graphLlmAvailable: boolean;
|
|
339
|
+
healthy: boolean;
|
|
340
|
+
meta: Record<string, string>;
|
|
341
|
+
}>;
|
|
342
|
+
sync(): Promise<{
|
|
343
|
+
synced: number;
|
|
344
|
+
created: number;
|
|
345
|
+
updated: number;
|
|
346
|
+
errors: string[];
|
|
347
|
+
}>;
|
|
348
|
+
private hasMemoryFiles;
|
|
349
|
+
private clearFiles;
|
|
350
|
+
private rowToFact;
|
|
292
351
|
private extractEntities;
|
|
293
352
|
private extractEntitiesWithLlm;
|
|
294
353
|
private buildEntityExtractionPrompt;
|
|
295
354
|
private storeEntitiesAndRelations;
|
|
355
|
+
private mergeEntitiesAndRelations;
|
|
296
356
|
private embed;
|
|
297
357
|
private embedAndStore;
|
|
358
|
+
private writeVector;
|
|
298
359
|
private writeFts;
|
|
299
360
|
private parseEntityExtractionResult;
|
|
300
361
|
private normalizeExtractionResult;
|
|
@@ -306,4 +367,12 @@ declare class MemorySystem implements IMemorySystem {
|
|
|
306
367
|
}
|
|
307
368
|
declare function createMemorySystem(config: MemorySystemConfig): Promise<IMemorySystem>;
|
|
308
369
|
|
|
309
|
-
|
|
370
|
+
declare function initLog(options: {
|
|
371
|
+
print: boolean;
|
|
372
|
+
logDir: string;
|
|
373
|
+
logFile?: string;
|
|
374
|
+
dev?: boolean;
|
|
375
|
+
level?: 'DEBUG' | 'INFO' | 'WARN' | 'ERROR';
|
|
376
|
+
}): Promise<void>;
|
|
377
|
+
|
|
378
|
+
export { type ArchiveRecord, type ArchiveResult, type EdgeQueryFilter, GraphStore, type IMemorySystem, MEMORY_CATEGORIES, MemoryArchiver, type MemoryCategory, MemoryDatabaseError, MemoryDatabaseManager, type MemoryEdge, MemoryEmbeddingError, MemoryError, MemoryErrorCode, type MemoryFact, MemoryFileError, MemoryFileManager, MemoryFormatter, type MemoryNode, type MemoryNodeWithEdges, MemoryNotFoundError, MemoryPermissionError, type MemoryQuery, type MemoryRecallResult, MemorySearchError, type MemorySource, MemorySystem, type MemorySystemConfig, MemoryValidationError, type MemoryVector, type NodeQueryFilter, type SessionMessage, type ShortTermEntry, addWord, closeTokenizer, createMemorySystem, initLog, initTokenizer, isInitialized, loadCustomDict, toFtsTokens, toFtsTokensForSearch, tokenize, tokenizeForSearch };
|