import type { KnowledgeRetrievalResult, RetrievalCacheAdapter } from '../types/knowledge.js'; /** * Zero-config, in-process session retrieval cache (G6). Keyed by the query * embedding: a lookup returns the cached results of the most-similar recent * query (cosine ≥ threshold, within TTL). LRU-bounded. Needs only the embedder * the KnowledgeProvider already requires — no external dependency. Apps that * want a shared/vector-backed cache can inject their own `RetrievalCacheAdapter` * via the KnowledgeProvider's `cacheFactory` instead. */ export interface InMemoryRetrievalCacheOptions { maxEntries?: number; ttlMs?: number; similarityThreshold?: number; } export declare class InMemoryRetrievalCache implements RetrievalCacheAdapter { /** Ordered oldest → newest (LRU front, MRU back). */ private entries; private readonly maxEntries; private readonly ttlMs; private readonly threshold; constructor(options?: InMemoryRetrievalCacheOptions); get size(): number; lookup(queryEmbedding: readonly number[], topK?: number): KnowledgeRetrievalResult[]; populate(results: KnowledgeRetrievalResult[], queryEmbedding?: readonly number[]): void; }