/**
 * Memory Consolidation Service for UAP
 *
 * Implements the consolidation rules from CLAUDE.md:
 * - Trigger: Every 10 working memory entries
 * - Action: Summarize → session_memories, Extract lessons → semantic memory
 * - Dedup: Skip if content_hash exists OR similarity > 0.92
 *
 * Enhanced with SimpleMem-style recursive consolidation:
 * - Background async consolidation process
 * - Hierarchical abstraction (memories → summaries → meta-summaries)
 * - Quality scoring and automatic pruning
 */
export interface ConsolidationConfig {
    triggerThreshold: number;
    minImportanceForLongTerm: number;
    similarityThreshold: number;
    maxSummaryLength: number;
    backgroundIntervalMs: number;
    recursiveDepth: number;
    qualityDecayRate: number;
}
export interface ConsolidationResult {
    memoriesProcessed: number;
    summariesCreated: number;
    lessonsExtracted: number;
    duplicatesSkipped: number;
    tokensReduced: number;
}
/**
 * Memory Consolidation Service
 */
export declare class MemoryConsolidator {
    private config;
    private db;
    private contentHashes;
    private lastConsolidationId;
    private backgroundInterval;
    private isRunning;
    private memoryQualityScores;
    constructor(config?: Partial<ConsolidationConfig>);
    /**
     * Initialize with database connection
     */
    initialize(dbPath: string): void;
    /**
     * Load existing content hashes for deduplication
     */
    private loadContentHashes;
    /**
     * Hash content for deduplication
     */
    private hashContent;
    /**
     * Check if consolidation should run
     */
    shouldConsolidate(): boolean;
    /**
     * Run consolidation process
     */
    consolidate(): Promise<ConsolidationResult>;
    /**
     * Detect if content contains a lesson/insight
     */
    private detectLesson;
    /**
     * Check for semantic duplicates using embeddings
     */
    private checkSemanticDuplicate;
    /**
     * Store session memory
     */
    private storeSessionMemory;
    /**
     * Store lesson in long-term memory
     */
    private storeLesson;
    /**
     * Run decay on old memories
     * Formula: effective_importance = importance × (0.95 ^ days_since_access)
     */
    runDecay(): Promise<number>;
    /**
     * Get consolidation stats
     */
    getStats(): {
        totalMemories: number;
        totalSessionMemories: number;
        totalLessons: number;
        lastConsolidationId: number;
        uniqueHashes: number;
    };
    /**
     * Start background consolidation process (SimpleMem-style async)
     */
    startBackgroundConsolidation(): void;
    /**
     * Stop background consolidation
     */
    stopBackgroundConsolidation(): void;
    /**
     * Recursive consolidation - merge summaries into meta-summaries
     * Based on SimpleMem's hierarchical abstraction
     */
    recursiveConsolidate(depth?: number): Promise<number>;
    /**
     * Apply quality decay to unused memories (Memory-R1 style)
     */
    applyQualityDecay(): Promise<number>;
    private static readonly MAX_QUALITY_SCORES;
    /**
     * Record memory access (for quality scoring)
     */
    recordAccess(memoryId: string): void;
    /**
     * Get memory quality score
     */
    getQualityScore(memoryId: string): number;
    /**
     * Close database connection
     */
    close(): void;
}
export declare function getMemoryConsolidator(config?: Partial<ConsolidationConfig>): MemoryConsolidator;
/**
 * Initialize and auto-start background consolidation if a memory DB exists.
 * Safe to call multiple times -- will not start duplicate intervals.
 * Call this from session-start hooks or CLI setup.
 */
export declare function autoStartConsolidation(dbPath?: string, config?: Partial<ConsolidationConfig>): boolean;
//# sourceMappingURL=memory-consolidator.d.ts.map