import { AiTool } from '../tools.ts'; import { LLMMessage, LLMRequest } from '../llm.ts'; import { MemoryCache } from './memory-state.ts'; export type Memory = { name: string; description: string; content: string; embedding: number[]; titleEmbedding?: number[]; bodyEmbeddings?: number[][]; links: string[]; backlinks: string[]; }; export type MemoryRef = { name: string; description: string; distance?: number; }; export type MemoryOptions = { memory: Memory[] | MemoryCache; inject?: boolean; tool?: boolean; update?: boolean; maxTokens?: number; }; export type MemoryStore = Memory[] | MemoryCache; /** Build memory tools and memory index text. */ export declare function memoryTools(llm: any, memories: MemoryStore): { tools: AiTool[]; list: string; }; export declare class MemoryManager { private llm; private memorized; constructor(llm: any); static normalize(memory?: Memory[] | MemoryCache | MemoryOptions): MemoryOptions | null; private memorySystem; private touchedNames; private backfillEmbeddings; private closestDuplicate; private rehomeDeleted; private reconcileSimilar; recollect(query: string, memory: MemoryStore, limit?: number): Promise; get tools(): { read: (memory: MemoryStore) => AiTool[]; }; memorize(history: LLMMessage[], memories: Memory[] | MemoryCache, options?: LLMRequest): Promise; }