/** * MAMA (Memory-Augmented MCP Architecture) - Embedding Cache * * LRU cache for embedding vectors to avoid re-computation * * Task 2: Implement Embedding Cache * AC #3: Cache embeddings to avoid re-computation * Target: > 80% cache hit ratio * * @module embedding-cache */ export declare const MAX_CACHE_SIZE = 1000; interface CacheStats { hits: number; misses: number; evictions: number; totalSize: number; } export interface CacheStatsReport extends CacheStats { hitRatio: number; size: number; maxSize: number; } /** * LRU Cache for embeddings * * Key: SHA-256 hash of decision text * Value: {embedding: Float32Array, timestamp: number, hits: number} * * Eviction: Least Recently Used when size > MAX_CACHE_SIZE */ export declare class EmbeddingCache { private cache; private stats; constructor(); /** * Generate cache key from text * * Task 2.3: Key = decision text hash (SHA-256) */ generateKey(text: string): string; /** * Get embedding from cache * * Task 2.2: Cache hit updates LRU position */ get(text: string): Float32Array | null; /** * Store embedding in cache * * Task 2.2: Add to cache with LRU tracking * Task 2.5: Implement cache eviction (LRU) */ set(text: string, embedding: Float32Array): void; /** * Evict least recently used entries * * Task 2.5: Implement cache eviction (LRU) * Strategy: Remove entries until size <= MAX_CACHE_SIZE * * Eviction order: * 1. Oldest lastAccessed (LRU) * 2. If tied, lowest hits */ evictLRU(): void; /** * Get cache hit ratio * * Task 2.4: Cache hit ratio target: > 80% */ getHitRatio(): number; /** * Get cache statistics */ getStats(): CacheStatsReport; /** * Clear cache */ clear(): void; } export declare const embeddingCache: EmbeddingCache; export {}; //# sourceMappingURL=embedding-cache.d.ts.map