@deepagents/agent 0.36.0 → 0.37.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.
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -930
- package/dist/index.js.map +4 -4
- package/package.json +7 -8
- package/dist/lib/memory.d.ts +0 -701
- package/dist/lib/memory.d.ts.map +0 -1
package/dist/lib/memory.d.ts
DELETED
|
@@ -1,701 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Memory System - Inspired by human memory architecture
|
|
3
|
-
*
|
|
4
|
-
* This system implements a multi-layered memory architecture:
|
|
5
|
-
*
|
|
6
|
-
* 1. Working Memory: Short-term, context-specific information (current conversation)
|
|
7
|
-
* 2. Episodic Memory: Event-based memories with temporal context
|
|
8
|
-
* 3. Semantic Memory: Facts, concepts, and general knowledge
|
|
9
|
-
* 4. Procedural Memory: Learned patterns and associations
|
|
10
|
-
*/
|
|
11
|
-
export interface MemoryEntry {
|
|
12
|
-
id: string;
|
|
13
|
-
content: string;
|
|
14
|
-
type: 'episodic' | 'semantic' | 'procedural';
|
|
15
|
-
timestamp: number;
|
|
16
|
-
tags: string[];
|
|
17
|
-
importance: number;
|
|
18
|
-
accessCount: number;
|
|
19
|
-
lastAccessed: number;
|
|
20
|
-
context?: Record<string, any>;
|
|
21
|
-
relationships?: string[];
|
|
22
|
-
decay?: number;
|
|
23
|
-
}
|
|
24
|
-
export interface MemoryQuery {
|
|
25
|
-
query: string;
|
|
26
|
-
type?: 'episodic' | 'semantic' | 'procedural';
|
|
27
|
-
limit?: number;
|
|
28
|
-
minImportance?: number;
|
|
29
|
-
tags?: string[];
|
|
30
|
-
timeRange?: {
|
|
31
|
-
start?: number;
|
|
32
|
-
end?: number;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export interface MemoryStats {
|
|
36
|
-
totalMemories: number;
|
|
37
|
-
byType: Record<string, number>;
|
|
38
|
-
mostAccessed: MemoryEntry[];
|
|
39
|
-
recentMemories: MemoryEntry[];
|
|
40
|
-
averageImportance: number;
|
|
41
|
-
}
|
|
42
|
-
export declare class MemoryStore {
|
|
43
|
-
private store;
|
|
44
|
-
constructor(name?: string);
|
|
45
|
-
/**
|
|
46
|
-
* Generate a unique memory ID
|
|
47
|
-
*/
|
|
48
|
-
private generateId;
|
|
49
|
-
/**
|
|
50
|
-
* Calculate memory decay based on time and access patterns
|
|
51
|
-
*/
|
|
52
|
-
private calculateDecay;
|
|
53
|
-
/**
|
|
54
|
-
* Store a new memory
|
|
55
|
-
*/
|
|
56
|
-
write(entry: Omit<MemoryEntry, 'id' | 'timestamp' | 'accessCount' | 'lastAccessed' | 'decay'>): MemoryEntry;
|
|
57
|
-
/**
|
|
58
|
-
* Retrieve a memory by ID
|
|
59
|
-
*/
|
|
60
|
-
get(id: string): MemoryEntry | null;
|
|
61
|
-
/**
|
|
62
|
-
* Search memories based on query
|
|
63
|
-
*/
|
|
64
|
-
lookup(query: MemoryQuery): MemoryEntry[];
|
|
65
|
-
/**
|
|
66
|
-
* Update an existing memory
|
|
67
|
-
*/
|
|
68
|
-
correct(id: string, updates: Partial<Omit<MemoryEntry, 'id' | 'timestamp'>>): MemoryEntry | null;
|
|
69
|
-
/**
|
|
70
|
-
* Delete a memory (forget)
|
|
71
|
-
*/
|
|
72
|
-
forget(id: string): boolean;
|
|
73
|
-
/**
|
|
74
|
-
* Get related memories
|
|
75
|
-
*/
|
|
76
|
-
getRelated(id: string, limit?: number): MemoryEntry[];
|
|
77
|
-
/**
|
|
78
|
-
* Get memory statistics
|
|
79
|
-
*/
|
|
80
|
-
getStats(): MemoryStats;
|
|
81
|
-
/**
|
|
82
|
-
* Consolidate memories (prune low-importance, rarely accessed memories)
|
|
83
|
-
*/
|
|
84
|
-
consolidate(threshold?: number): number;
|
|
85
|
-
/**
|
|
86
|
-
* Clear all memories
|
|
87
|
-
*/
|
|
88
|
-
clear(): void;
|
|
89
|
-
/**
|
|
90
|
-
* Export all memories
|
|
91
|
-
*/
|
|
92
|
-
export(): Record<string, MemoryEntry>;
|
|
93
|
-
/**
|
|
94
|
-
* Import memories
|
|
95
|
-
*/
|
|
96
|
-
import(memories: Record<string, MemoryEntry>): void;
|
|
97
|
-
/**
|
|
98
|
-
* Write a semantic memory (facts, concepts, general knowledge)
|
|
99
|
-
*
|
|
100
|
-
* @example
|
|
101
|
-
* store.writeSemantic("React is a JavaScript library for building UIs", {
|
|
102
|
-
* tags: ["react", "javascript"],
|
|
103
|
-
* importance: 8
|
|
104
|
-
* });
|
|
105
|
-
*/
|
|
106
|
-
writeSemantic(content: string, options?: {
|
|
107
|
-
importance?: number;
|
|
108
|
-
tags?: string[];
|
|
109
|
-
context?: Record<string, any>;
|
|
110
|
-
relationships?: string[];
|
|
111
|
-
}): MemoryEntry;
|
|
112
|
-
/**
|
|
113
|
-
* Write an episodic memory (events, conversations, experiences)
|
|
114
|
-
*
|
|
115
|
-
* @example
|
|
116
|
-
* store.writeEpisodic("User completed onboarding", {
|
|
117
|
-
* tags: ["milestone", "user123"],
|
|
118
|
-
* context: { userId: "user123", timestamp: Date.now() }
|
|
119
|
-
* });
|
|
120
|
-
*/
|
|
121
|
-
writeEpisodic(content: string, options?: {
|
|
122
|
-
importance?: number;
|
|
123
|
-
tags?: string[];
|
|
124
|
-
context?: Record<string, any>;
|
|
125
|
-
relationships?: string[];
|
|
126
|
-
}): MemoryEntry;
|
|
127
|
-
/**
|
|
128
|
-
* Write a procedural memory (patterns, behaviors, methods)
|
|
129
|
-
*
|
|
130
|
-
* @example
|
|
131
|
-
* store.writeProcedural("When user asks for help, first check documentation", {
|
|
132
|
-
* tags: ["pattern", "help"],
|
|
133
|
-
* importance: 7
|
|
134
|
-
* });
|
|
135
|
-
*/
|
|
136
|
-
writeProcedural(content: string, options?: {
|
|
137
|
-
importance?: number;
|
|
138
|
-
tags?: string[];
|
|
139
|
-
context?: Record<string, any>;
|
|
140
|
-
relationships?: string[];
|
|
141
|
-
}): MemoryEntry;
|
|
142
|
-
/**
|
|
143
|
-
* Store a user preference (convenience wrapper for semantic memory)
|
|
144
|
-
*
|
|
145
|
-
* @example
|
|
146
|
-
* store.storePreference("user123", "theme", "dark");
|
|
147
|
-
*/
|
|
148
|
-
storePreference(userId: string, preference: string, value: any, importance?: number): MemoryEntry;
|
|
149
|
-
/**
|
|
150
|
-
* Record a conversation exchange (convenience wrapper for episodic memory)
|
|
151
|
-
*
|
|
152
|
-
* @example
|
|
153
|
-
* store.recordConversation("user123", "session456", "user", "How do I use React hooks?");
|
|
154
|
-
*/
|
|
155
|
-
recordConversation(userId: string, sessionId: string, role: 'user' | 'assistant' | 'system', message: string, importance?: number): MemoryEntry;
|
|
156
|
-
/**
|
|
157
|
-
* Record a user action/event (convenience wrapper for episodic memory)
|
|
158
|
-
*
|
|
159
|
-
* @example
|
|
160
|
-
* store.recordAction("user123", "completed_tutorial", { tutorialId: "intro" });
|
|
161
|
-
*/
|
|
162
|
-
recordAction(userId: string, action: string, details?: Record<string, any>, importance?: number): MemoryEntry;
|
|
163
|
-
/**
|
|
164
|
-
* Learn a pattern from observations (convenience wrapper for procedural memory)
|
|
165
|
-
*
|
|
166
|
-
* @example
|
|
167
|
-
* store.learnPattern("optimization-workflow", "Profile before optimizing", {
|
|
168
|
-
* conditions: "Performance issues reported",
|
|
169
|
-
* relatedMemories: ["mem_123"]
|
|
170
|
-
* });
|
|
171
|
-
*/
|
|
172
|
-
learnPattern(patternName: string, description: string, options?: {
|
|
173
|
-
importance?: number;
|
|
174
|
-
conditions?: string;
|
|
175
|
-
relatedMemories?: string[];
|
|
176
|
-
context?: Record<string, any>;
|
|
177
|
-
}): MemoryEntry;
|
|
178
|
-
/**
|
|
179
|
-
* Store a fact or knowledge (convenience wrapper for semantic memory)
|
|
180
|
-
*
|
|
181
|
-
* @example
|
|
182
|
-
* store.storeFact("JavaScript", "JavaScript is a programming language", {
|
|
183
|
-
* source: "documentation",
|
|
184
|
-
* relatedTo: ["mem_456"]
|
|
185
|
-
* });
|
|
186
|
-
*/
|
|
187
|
-
storeFact(topic: string, fact: string, options?: {
|
|
188
|
-
importance?: number;
|
|
189
|
-
source?: string;
|
|
190
|
-
relatedTo?: string[];
|
|
191
|
-
tags?: string[];
|
|
192
|
-
}): MemoryEntry;
|
|
193
|
-
/**
|
|
194
|
-
* Record a milestone or achievement (convenience wrapper for episodic memory)
|
|
195
|
-
*
|
|
196
|
-
* @example
|
|
197
|
-
* store.recordMilestone("user123", "first-project-completed", "User completed their first project");
|
|
198
|
-
*/
|
|
199
|
-
recordMilestone(userId: string, milestoneType: string, description: string, importance?: number): MemoryEntry;
|
|
200
|
-
/**
|
|
201
|
-
* Store contextual information about current session (working memory)
|
|
202
|
-
* Note: These should have lower importance as they're temporary
|
|
203
|
-
*
|
|
204
|
-
* @example
|
|
205
|
-
* store.storeSessionContext("session456", "user-preferences-loaded", { theme: "dark" });
|
|
206
|
-
*/
|
|
207
|
-
storeSessionContext(sessionId: string, contextKey: string, data: any, importance?: number): MemoryEntry;
|
|
208
|
-
/**
|
|
209
|
-
* Get proactive memories that should always be present in system prompt
|
|
210
|
-
* These are high-importance memories that provide essential context
|
|
211
|
-
*
|
|
212
|
-
* @param options Configuration for proactive memory retrieval
|
|
213
|
-
* @returns Formatted string ready for system prompt injection
|
|
214
|
-
*
|
|
215
|
-
* @example
|
|
216
|
-
* const memoryContext = memoryStore.getProactiveMemories({
|
|
217
|
-
* userId: 'user123',
|
|
218
|
-
* minImportance: 7,
|
|
219
|
-
* categories: ['preference', 'core-knowledge']
|
|
220
|
-
* });
|
|
221
|
-
*
|
|
222
|
-
* // Use in agent:
|
|
223
|
-
* const systemPrompt = `${basePrompt}\n\n${memoryContext}`;
|
|
224
|
-
*/
|
|
225
|
-
getProactiveMemories(options: {
|
|
226
|
-
userId?: string;
|
|
227
|
-
sessionId?: string;
|
|
228
|
-
minImportance?: number;
|
|
229
|
-
categories?: string[];
|
|
230
|
-
maxMemories?: number;
|
|
231
|
-
types?: Array<'episodic' | 'semantic' | 'procedural'>;
|
|
232
|
-
includeRelationships?: boolean;
|
|
233
|
-
}): string;
|
|
234
|
-
/**
|
|
235
|
-
* Format proactive memories into a structured system prompt section
|
|
236
|
-
*/
|
|
237
|
-
private formatProactiveMemories;
|
|
238
|
-
/**
|
|
239
|
-
* Helper to format time ago for human readability
|
|
240
|
-
*/
|
|
241
|
-
private formatTimeAgo;
|
|
242
|
-
/**
|
|
243
|
-
* Get user-specific proactive memories
|
|
244
|
-
* Convenience method that focuses on user preferences and patterns
|
|
245
|
-
*
|
|
246
|
-
* @example
|
|
247
|
-
* const proactiveUserMemories = memoryStore.getUserProactiveMemories('user123');
|
|
248
|
-
*/
|
|
249
|
-
getUserProactiveMemories(userId: string, options?: {
|
|
250
|
-
includePreferences?: boolean;
|
|
251
|
-
includePatterns?: boolean;
|
|
252
|
-
includeRecentHistory?: boolean;
|
|
253
|
-
maxPerCategory?: number;
|
|
254
|
-
}): string;
|
|
255
|
-
/**
|
|
256
|
-
* Get session-specific proactive memories
|
|
257
|
-
* Focuses on working memory and recent context
|
|
258
|
-
*
|
|
259
|
-
* @example
|
|
260
|
-
* const sessionContext = memoryStore.getSessionProactiveMemories('session456');
|
|
261
|
-
*/
|
|
262
|
-
getSessionProactiveMemories(sessionId: string, options?: {
|
|
263
|
-
includeWorkingMemory?: boolean;
|
|
264
|
-
maxMemories?: number;
|
|
265
|
-
}): string;
|
|
266
|
-
/**
|
|
267
|
-
* Get critical memories that should ALWAYS be present
|
|
268
|
-
* These are importance level 9-10 memories
|
|
269
|
-
*
|
|
270
|
-
* @example
|
|
271
|
-
* const criticalContext = memoryStore.getCriticalMemories();
|
|
272
|
-
*/
|
|
273
|
-
getCriticalMemories(options?: {
|
|
274
|
-
userId?: string;
|
|
275
|
-
maxMemories?: number;
|
|
276
|
-
}): string;
|
|
277
|
-
/**
|
|
278
|
-
* Build complete proactive context for an agent
|
|
279
|
-
* Combines critical, user-specific, and session-specific memories
|
|
280
|
-
*
|
|
281
|
-
* @example
|
|
282
|
-
* const fullContext = memoryStore.buildProactiveContext({
|
|
283
|
-
* userId: 'user123',
|
|
284
|
-
* sessionId: 'session456'
|
|
285
|
-
* });
|
|
286
|
-
*
|
|
287
|
-
* // Use in agent system prompt
|
|
288
|
-
* const systemPrompt = `${basePrompt}\n\n${fullContext}`;
|
|
289
|
-
*/
|
|
290
|
-
buildProactiveContext(options: {
|
|
291
|
-
userId?: string;
|
|
292
|
-
sessionId?: string;
|
|
293
|
-
includeCritical?: boolean;
|
|
294
|
-
includeUser?: boolean;
|
|
295
|
-
includeSession?: boolean;
|
|
296
|
-
}): string;
|
|
297
|
-
}
|
|
298
|
-
export declare const memoryStore: MemoryStore;
|
|
299
|
-
/**
|
|
300
|
-
* Tool: Lookup memories
|
|
301
|
-
*/
|
|
302
|
-
export declare const memoryLookup: import("ai").Tool<{
|
|
303
|
-
query: string;
|
|
304
|
-
limit: number;
|
|
305
|
-
type?: "episodic" | "semantic" | "procedural" | undefined;
|
|
306
|
-
tags?: string[] | undefined;
|
|
307
|
-
minImportance?: number | undefined;
|
|
308
|
-
}, {
|
|
309
|
-
count: number;
|
|
310
|
-
memories: {
|
|
311
|
-
id: string;
|
|
312
|
-
content: string;
|
|
313
|
-
type: "episodic" | "semantic" | "procedural";
|
|
314
|
-
importance: number;
|
|
315
|
-
tags: string[];
|
|
316
|
-
timestamp: string;
|
|
317
|
-
accessCount: number;
|
|
318
|
-
decay: string | undefined;
|
|
319
|
-
context: Record<string, any> | undefined;
|
|
320
|
-
}[];
|
|
321
|
-
}>;
|
|
322
|
-
/**
|
|
323
|
-
* Tool: Explain a specific memory
|
|
324
|
-
*/
|
|
325
|
-
export declare const memoryExplain: import("ai").Tool<{
|
|
326
|
-
id: string;
|
|
327
|
-
includeRelated: boolean;
|
|
328
|
-
}, {
|
|
329
|
-
found: boolean;
|
|
330
|
-
message: string;
|
|
331
|
-
memory?: undefined;
|
|
332
|
-
related?: undefined;
|
|
333
|
-
} | {
|
|
334
|
-
found: boolean;
|
|
335
|
-
memory: {
|
|
336
|
-
id: string;
|
|
337
|
-
content: string;
|
|
338
|
-
type: "episodic" | "semantic" | "procedural";
|
|
339
|
-
importance: number;
|
|
340
|
-
tags: string[];
|
|
341
|
-
timestamp: string;
|
|
342
|
-
lastAccessed: string;
|
|
343
|
-
accessCount: number;
|
|
344
|
-
decay: string | undefined;
|
|
345
|
-
context: Record<string, any> | undefined;
|
|
346
|
-
age: {
|
|
347
|
-
days: number;
|
|
348
|
-
hours: number;
|
|
349
|
-
};
|
|
350
|
-
timeSinceAccess: {
|
|
351
|
-
days: number;
|
|
352
|
-
hours: number;
|
|
353
|
-
};
|
|
354
|
-
};
|
|
355
|
-
related: {
|
|
356
|
-
id: string;
|
|
357
|
-
content: string;
|
|
358
|
-
type: "episodic" | "semantic" | "procedural";
|
|
359
|
-
importance: number;
|
|
360
|
-
}[];
|
|
361
|
-
message?: undefined;
|
|
362
|
-
}>;
|
|
363
|
-
/**
|
|
364
|
-
* Tool: Write a new memory
|
|
365
|
-
*/
|
|
366
|
-
export declare const memoryWrite: import("ai").Tool<{
|
|
367
|
-
type: "episodic" | "semantic" | "procedural";
|
|
368
|
-
content: string;
|
|
369
|
-
tags: string[];
|
|
370
|
-
importance: number;
|
|
371
|
-
relationships?: string[] | undefined;
|
|
372
|
-
context?: Record<any, any> | undefined;
|
|
373
|
-
}, {
|
|
374
|
-
success: boolean;
|
|
375
|
-
id: string;
|
|
376
|
-
message: string;
|
|
377
|
-
memory: {
|
|
378
|
-
id: string;
|
|
379
|
-
type: "episodic" | "semantic" | "procedural";
|
|
380
|
-
importance: number;
|
|
381
|
-
timestamp: string;
|
|
382
|
-
};
|
|
383
|
-
}>;
|
|
384
|
-
/**
|
|
385
|
-
* Tool: Forget a memory
|
|
386
|
-
*/
|
|
387
|
-
export declare const memoryForget: import("ai").Tool<{
|
|
388
|
-
id: string;
|
|
389
|
-
reason?: string | undefined;
|
|
390
|
-
}, {
|
|
391
|
-
success: boolean;
|
|
392
|
-
message: string;
|
|
393
|
-
}>;
|
|
394
|
-
/**
|
|
395
|
-
* Tool: Correct a memory
|
|
396
|
-
*/
|
|
397
|
-
export declare const memoryCorrect: import("ai").Tool<{
|
|
398
|
-
id: string;
|
|
399
|
-
updates: {
|
|
400
|
-
content?: string | undefined;
|
|
401
|
-
relationships?: string[] | undefined;
|
|
402
|
-
tags?: string[] | undefined;
|
|
403
|
-
importance?: number | undefined;
|
|
404
|
-
context?: Record<any, any> | undefined;
|
|
405
|
-
};
|
|
406
|
-
correctionNote?: string | undefined;
|
|
407
|
-
}, {
|
|
408
|
-
success: boolean;
|
|
409
|
-
message: string;
|
|
410
|
-
memory?: undefined;
|
|
411
|
-
} | {
|
|
412
|
-
success: boolean;
|
|
413
|
-
message: string;
|
|
414
|
-
memory: {
|
|
415
|
-
id: string;
|
|
416
|
-
content: string;
|
|
417
|
-
type: "episodic" | "semantic" | "procedural";
|
|
418
|
-
importance: number;
|
|
419
|
-
lastAccessed: string;
|
|
420
|
-
};
|
|
421
|
-
}>;
|
|
422
|
-
/**
|
|
423
|
-
* Tool: Get memory statistics
|
|
424
|
-
*/
|
|
425
|
-
export declare const memoryStats: import("ai").Tool<{}, {
|
|
426
|
-
total: number;
|
|
427
|
-
byType: Record<string, number>;
|
|
428
|
-
averageImportance: string;
|
|
429
|
-
mostAccessed: {
|
|
430
|
-
id: string;
|
|
431
|
-
content: string;
|
|
432
|
-
accessCount: number;
|
|
433
|
-
type: "episodic" | "semantic" | "procedural";
|
|
434
|
-
}[];
|
|
435
|
-
recent: {
|
|
436
|
-
id: string;
|
|
437
|
-
content: string;
|
|
438
|
-
timestamp: string;
|
|
439
|
-
type: "episodic" | "semantic" | "procedural";
|
|
440
|
-
}[];
|
|
441
|
-
}>;
|
|
442
|
-
export declare const memoryTools: {
|
|
443
|
-
memoryLookup: import("ai").Tool<{
|
|
444
|
-
query: string;
|
|
445
|
-
limit: number;
|
|
446
|
-
type?: "episodic" | "semantic" | "procedural" | undefined;
|
|
447
|
-
tags?: string[] | undefined;
|
|
448
|
-
minImportance?: number | undefined;
|
|
449
|
-
}, {
|
|
450
|
-
count: number;
|
|
451
|
-
memories: {
|
|
452
|
-
id: string;
|
|
453
|
-
content: string;
|
|
454
|
-
type: "episodic" | "semantic" | "procedural";
|
|
455
|
-
importance: number;
|
|
456
|
-
tags: string[];
|
|
457
|
-
timestamp: string;
|
|
458
|
-
accessCount: number;
|
|
459
|
-
decay: string | undefined;
|
|
460
|
-
context: Record<string, any> | undefined;
|
|
461
|
-
}[];
|
|
462
|
-
}>;
|
|
463
|
-
memoryExplain: import("ai").Tool<{
|
|
464
|
-
id: string;
|
|
465
|
-
includeRelated: boolean;
|
|
466
|
-
}, {
|
|
467
|
-
found: boolean;
|
|
468
|
-
message: string;
|
|
469
|
-
memory?: undefined;
|
|
470
|
-
related?: undefined;
|
|
471
|
-
} | {
|
|
472
|
-
found: boolean;
|
|
473
|
-
memory: {
|
|
474
|
-
id: string;
|
|
475
|
-
content: string;
|
|
476
|
-
type: "episodic" | "semantic" | "procedural";
|
|
477
|
-
importance: number;
|
|
478
|
-
tags: string[];
|
|
479
|
-
timestamp: string;
|
|
480
|
-
lastAccessed: string;
|
|
481
|
-
accessCount: number;
|
|
482
|
-
decay: string | undefined;
|
|
483
|
-
context: Record<string, any> | undefined;
|
|
484
|
-
age: {
|
|
485
|
-
days: number;
|
|
486
|
-
hours: number;
|
|
487
|
-
};
|
|
488
|
-
timeSinceAccess: {
|
|
489
|
-
days: number;
|
|
490
|
-
hours: number;
|
|
491
|
-
};
|
|
492
|
-
};
|
|
493
|
-
related: {
|
|
494
|
-
id: string;
|
|
495
|
-
content: string;
|
|
496
|
-
type: "episodic" | "semantic" | "procedural";
|
|
497
|
-
importance: number;
|
|
498
|
-
}[];
|
|
499
|
-
message?: undefined;
|
|
500
|
-
}>;
|
|
501
|
-
memoryWrite: import("ai").Tool<{
|
|
502
|
-
type: "episodic" | "semantic" | "procedural";
|
|
503
|
-
content: string;
|
|
504
|
-
tags: string[];
|
|
505
|
-
importance: number;
|
|
506
|
-
relationships?: string[] | undefined;
|
|
507
|
-
context?: Record<any, any> | undefined;
|
|
508
|
-
}, {
|
|
509
|
-
success: boolean;
|
|
510
|
-
id: string;
|
|
511
|
-
message: string;
|
|
512
|
-
memory: {
|
|
513
|
-
id: string;
|
|
514
|
-
type: "episodic" | "semantic" | "procedural";
|
|
515
|
-
importance: number;
|
|
516
|
-
timestamp: string;
|
|
517
|
-
};
|
|
518
|
-
}>;
|
|
519
|
-
memoryForget: import("ai").Tool<{
|
|
520
|
-
id: string;
|
|
521
|
-
reason?: string | undefined;
|
|
522
|
-
}, {
|
|
523
|
-
success: boolean;
|
|
524
|
-
message: string;
|
|
525
|
-
}>;
|
|
526
|
-
memoryCorrect: import("ai").Tool<{
|
|
527
|
-
id: string;
|
|
528
|
-
updates: {
|
|
529
|
-
content?: string | undefined;
|
|
530
|
-
relationships?: string[] | undefined;
|
|
531
|
-
tags?: string[] | undefined;
|
|
532
|
-
importance?: number | undefined;
|
|
533
|
-
context?: Record<any, any> | undefined;
|
|
534
|
-
};
|
|
535
|
-
correctionNote?: string | undefined;
|
|
536
|
-
}, {
|
|
537
|
-
success: boolean;
|
|
538
|
-
message: string;
|
|
539
|
-
memory?: undefined;
|
|
540
|
-
} | {
|
|
541
|
-
success: boolean;
|
|
542
|
-
message: string;
|
|
543
|
-
memory: {
|
|
544
|
-
id: string;
|
|
545
|
-
content: string;
|
|
546
|
-
type: "episodic" | "semantic" | "procedural";
|
|
547
|
-
importance: number;
|
|
548
|
-
lastAccessed: string;
|
|
549
|
-
};
|
|
550
|
-
}>;
|
|
551
|
-
memoryStats: import("ai").Tool<{}, {
|
|
552
|
-
total: number;
|
|
553
|
-
byType: Record<string, number>;
|
|
554
|
-
averageImportance: string;
|
|
555
|
-
mostAccessed: {
|
|
556
|
-
id: string;
|
|
557
|
-
content: string;
|
|
558
|
-
accessCount: number;
|
|
559
|
-
type: "episodic" | "semantic" | "procedural";
|
|
560
|
-
}[];
|
|
561
|
-
recent: {
|
|
562
|
-
id: string;
|
|
563
|
-
content: string;
|
|
564
|
-
timestamp: string;
|
|
565
|
-
type: "episodic" | "semantic" | "procedural";
|
|
566
|
-
}[];
|
|
567
|
-
}>;
|
|
568
|
-
};
|
|
569
|
-
declare const _default: {
|
|
570
|
-
memoryStore: MemoryStore;
|
|
571
|
-
memoryTools: {
|
|
572
|
-
memoryLookup: import("ai").Tool<{
|
|
573
|
-
query: string;
|
|
574
|
-
limit: number;
|
|
575
|
-
type?: "episodic" | "semantic" | "procedural" | undefined;
|
|
576
|
-
tags?: string[] | undefined;
|
|
577
|
-
minImportance?: number | undefined;
|
|
578
|
-
}, {
|
|
579
|
-
count: number;
|
|
580
|
-
memories: {
|
|
581
|
-
id: string;
|
|
582
|
-
content: string;
|
|
583
|
-
type: "episodic" | "semantic" | "procedural";
|
|
584
|
-
importance: number;
|
|
585
|
-
tags: string[];
|
|
586
|
-
timestamp: string;
|
|
587
|
-
accessCount: number;
|
|
588
|
-
decay: string | undefined;
|
|
589
|
-
context: Record<string, any> | undefined;
|
|
590
|
-
}[];
|
|
591
|
-
}>;
|
|
592
|
-
memoryExplain: import("ai").Tool<{
|
|
593
|
-
id: string;
|
|
594
|
-
includeRelated: boolean;
|
|
595
|
-
}, {
|
|
596
|
-
found: boolean;
|
|
597
|
-
message: string;
|
|
598
|
-
memory?: undefined;
|
|
599
|
-
related?: undefined;
|
|
600
|
-
} | {
|
|
601
|
-
found: boolean;
|
|
602
|
-
memory: {
|
|
603
|
-
id: string;
|
|
604
|
-
content: string;
|
|
605
|
-
type: "episodic" | "semantic" | "procedural";
|
|
606
|
-
importance: number;
|
|
607
|
-
tags: string[];
|
|
608
|
-
timestamp: string;
|
|
609
|
-
lastAccessed: string;
|
|
610
|
-
accessCount: number;
|
|
611
|
-
decay: string | undefined;
|
|
612
|
-
context: Record<string, any> | undefined;
|
|
613
|
-
age: {
|
|
614
|
-
days: number;
|
|
615
|
-
hours: number;
|
|
616
|
-
};
|
|
617
|
-
timeSinceAccess: {
|
|
618
|
-
days: number;
|
|
619
|
-
hours: number;
|
|
620
|
-
};
|
|
621
|
-
};
|
|
622
|
-
related: {
|
|
623
|
-
id: string;
|
|
624
|
-
content: string;
|
|
625
|
-
type: "episodic" | "semantic" | "procedural";
|
|
626
|
-
importance: number;
|
|
627
|
-
}[];
|
|
628
|
-
message?: undefined;
|
|
629
|
-
}>;
|
|
630
|
-
memoryWrite: import("ai").Tool<{
|
|
631
|
-
type: "episodic" | "semantic" | "procedural";
|
|
632
|
-
content: string;
|
|
633
|
-
tags: string[];
|
|
634
|
-
importance: number;
|
|
635
|
-
relationships?: string[] | undefined;
|
|
636
|
-
context?: Record<any, any> | undefined;
|
|
637
|
-
}, {
|
|
638
|
-
success: boolean;
|
|
639
|
-
id: string;
|
|
640
|
-
message: string;
|
|
641
|
-
memory: {
|
|
642
|
-
id: string;
|
|
643
|
-
type: "episodic" | "semantic" | "procedural";
|
|
644
|
-
importance: number;
|
|
645
|
-
timestamp: string;
|
|
646
|
-
};
|
|
647
|
-
}>;
|
|
648
|
-
memoryForget: import("ai").Tool<{
|
|
649
|
-
id: string;
|
|
650
|
-
reason?: string | undefined;
|
|
651
|
-
}, {
|
|
652
|
-
success: boolean;
|
|
653
|
-
message: string;
|
|
654
|
-
}>;
|
|
655
|
-
memoryCorrect: import("ai").Tool<{
|
|
656
|
-
id: string;
|
|
657
|
-
updates: {
|
|
658
|
-
content?: string | undefined;
|
|
659
|
-
relationships?: string[] | undefined;
|
|
660
|
-
tags?: string[] | undefined;
|
|
661
|
-
importance?: number | undefined;
|
|
662
|
-
context?: Record<any, any> | undefined;
|
|
663
|
-
};
|
|
664
|
-
correctionNote?: string | undefined;
|
|
665
|
-
}, {
|
|
666
|
-
success: boolean;
|
|
667
|
-
message: string;
|
|
668
|
-
memory?: undefined;
|
|
669
|
-
} | {
|
|
670
|
-
success: boolean;
|
|
671
|
-
message: string;
|
|
672
|
-
memory: {
|
|
673
|
-
id: string;
|
|
674
|
-
content: string;
|
|
675
|
-
type: "episodic" | "semantic" | "procedural";
|
|
676
|
-
importance: number;
|
|
677
|
-
lastAccessed: string;
|
|
678
|
-
};
|
|
679
|
-
}>;
|
|
680
|
-
memoryStats: import("ai").Tool<{}, {
|
|
681
|
-
total: number;
|
|
682
|
-
byType: Record<string, number>;
|
|
683
|
-
averageImportance: string;
|
|
684
|
-
mostAccessed: {
|
|
685
|
-
id: string;
|
|
686
|
-
content: string;
|
|
687
|
-
accessCount: number;
|
|
688
|
-
type: "episodic" | "semantic" | "procedural";
|
|
689
|
-
}[];
|
|
690
|
-
recent: {
|
|
691
|
-
id: string;
|
|
692
|
-
content: string;
|
|
693
|
-
timestamp: string;
|
|
694
|
-
type: "episodic" | "semantic" | "procedural";
|
|
695
|
-
}[];
|
|
696
|
-
}>;
|
|
697
|
-
};
|
|
698
|
-
MemoryStore: typeof MemoryStore;
|
|
699
|
-
};
|
|
700
|
-
export default _default;
|
|
701
|
-
//# sourceMappingURL=memory.d.ts.map
|
package/dist/lib/memory.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/lib/memory.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAMH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,GAAG,UAAU,GAAG,YAAY,CAAC;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,KAAK,CAAC,EAA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