import { MemoryInterface, MemoryEntry } from './memory-interface'; /** * Configuration for persistent memory */ export interface PersistentMemoryConfig { storageDir: string; filename?: string; autoSave?: boolean; saveInterval?: number; } /** * A memory implementation that persists memories to disk */ export declare class PersistentMemory implements MemoryInterface { private memories; private config; private filePath; private logger; private saveTimer?; private dirty; /** * Creates a new persistent memory system * * @param config - Configuration for the persistent memory */ constructor(config: PersistentMemoryConfig); /** * Stores a memory and persists it to disk * * @param memory - The memory to store * @returns Promise that resolves when storage is complete */ store(memory: MemoryEntry): Promise; /** * Retrieves memories relevant to a query * * @param query - The query to find relevant memories for * @param limit - Optional limit on number of memories to retrieve (default: 5) * @returns Promise resolving to an array of memory content strings */ retrieve(query: string, limit?: number): Promise; /** * Get all stored memories * * @returns Promise resolving to all memory entries */ getAll(): Promise; /** * Delete a specific memory by ID * * @param id - ID of the memory to delete * @returns Promise resolving to true if deleted, false if not found */ delete(id: string): Promise; /** * Clear all memories * * @returns Promise resolving when all memories are cleared */ clear(): Promise; /** * Loads memories from disk * * @returns Boolean indicating if loading was successful */ private load; /** * Saves memories to disk * * @returns Promise resolving when save is complete */ save(): Promise; /** * Sets up auto-save */ private setupAutoSave; /** * Cleanup function to ensure memories are saved before shutdown */ cleanup(): Promise; }