export interface CachedResult { result: unknown; storedAt: number; ttlMs: number; contextHash: string; /** Memory ids referenced by this cached result (for smart invalidation). */ memoryIds: string[]; /** Optional project tag for project-scoped invalidation. */ project?: string; } export interface RecallCacheStats { hits: number; misses: number; hitRate: number; bloomFP: number; evictions: number; size: number; } export interface InvalidateOpts { key?: string; contextHash?: string; project?: string; /** Invalidate entries stored before this timestamp (ms). */ before?: number; } export interface PutOpts { memoryIds?: string[]; project?: string; } export declare class BrainRecallCache { private capacity; private map; private head; private tail; private bloom; /** memoryId → set of cache keys that referenced it. */ private memToKeys; /** project → set of cache keys (for project-scoped invalidation). */ private projectToKeys; private hits; private misses; private bloomNegatives; /** Count where bloom said "maybe" but LRU said "no" → false positive. */ private bloomFalsePositives; private evictions; private writesSincePersist; private initialized; private init; /** Look up a cached entry. contextHash filters by brain state version. */ lookup(key: string, contextHash?: string): CachedResult | null; put(key: string, contextHash: string, result: unknown, ttlMs?: number, opts?: PutOpts): void; invalidate(opts: InvalidateOpts): { invalidated: number; }; /** Call when a brain memory is added/updated → prune any cached top-N that referenced it. */ observeWrite(memoryId: string): void; stats(): RecallCacheStats; /** Wipe contents and metrics. Stats file is removed. */ reset(): void; private trackKey; private untrackKey; private evictLru; private touch; private addToFront; private removeNode; private rebuildBloom; private loadConfig; private loadStats; private persistStats; } export declare function getBrainRecallCache(): BrainRecallCache; export declare function resetBrainRecallCacheForTests(): void; //# sourceMappingURL=brain-recall-cache.d.ts.map