import { HierarchicalMemoryEntry, MemoryTier, HierarchicalMemoryStats } from '../types.js'; /** * Hierarchical Memory — never forget, always compress. * * Tier 1 (raw): Full insight text, full context, full metadata. Retained for 7 days or until tier limit. * Tier 2 (summary): LLM-generated or algorithmic summary. Key facts, file references, category. * Tier 3 (pattern): Abstracted patterns extracted from multiple summaries. Reusable rules. * Tier 4 (principle): Fundamental truths / heuristics that survived many projects and sessions. * * Drill-down: Given a principle, trace back through patterns → summaries → raw entries. * * Compression: When a tier exceeds its limit, the oldest/least-accessed entries are * batch-compressed into the next tier up. Originals are archived (not deleted). */ export declare class HierarchicalMemory { private entries; private tierIndex; private storeDir; constructor(customDir?: string); /** Store a new memory at the raw tier */ store(content: string, category: string, confidence: number, metadata?: Record): Promise; /** Retrieve a specific entry by ID */ get(id: string): HierarchicalMemoryEntry | undefined; /** Drill down from a higher-tier entry to its source entries */ drillDown(id: string, maxDepth?: number): HierarchicalMemoryEntry[][]; /** Drill up from a raw entry to see what principles it contributed to */ drillUp(id: string, maxDepth?: number): HierarchicalMemoryEntry[][]; /** Get all entries at a specific tier */ getByTier(tier: MemoryTier): HierarchicalMemoryEntry[]; /** Search across all tiers by content or category */ search(query: string, topK?: number): HierarchicalMemoryEntry[]; /** Manually promote an entry to a higher tier */ promote(id: string): Promise; private checkCompression; /** Compress multiple entries into a single higher-tier entry */ private compressContent; private calculateImportance; private recencyFactor; /** Simple text-to-vector using character frequency and word hashing */ private textToVector; private cosineSimilarity; private extractCommonTerms; private extractKeyPhrases; stats(): HierarchicalMemoryStats; private calculatePromotionRate; private persist; private loadFromDisk; } //# sourceMappingURL=hierarchical-memory.d.ts.map