/**
 * A pattern identified across multiple memories.
 */
export interface ConsolidatedPattern {
    /** Description of the pattern */
    pattern: string;
    /** How many memories support this pattern */
    occurrences: number;
    /** Source categories (e.g., 'learning', 'failure', 'success') */
    sources: string[];
    /** When this pattern was identified (ISO date string) */
    identifiedAt: string;
}
/**
 * An insight derived from cross-memory analysis.
 */
export interface ConsolidatedInsight {
    /** The insight text */
    insight: string;
    /** Confidence level */
    confidence: 'low' | 'medium' | 'high';
    /** Related memory snippets that support this insight */
    relatedMemories: string[];
}
/**
 * Persisted consolidation report structure.
 */
export interface ConsolidationReport {
    /** Patterns identified across memories */
    patterns: ConsolidatedPattern[];
    /** Insights derived from analysis */
    insights: ConsolidatedInsight[];
    /** When this consolidation was run (ISO string) */
    consolidatedAt: string;
    /** Number of memories analyzed */
    memoriesAnalyzed: number;
}
/**
 * Provider function type for retrieving agent memories.
 * Allows dependency injection for testing.
 */
export type MemoryProvider = (sessionName: string) => Promise<string[]>;
/**
 * Service for cross-layer memory consolidation.
 *
 * Reads all agent memories (learnings, failures, successes), identifies
 * recurring patterns, and generates a consolidation report. Can be run
 * periodically (e.g., weekly) to keep insights fresh.
 *
 * Storage: ~/.crewly/agents/{sessionName}/consolidation.json
 */
export declare class MemoryConsolidationService {
    private memoryProvider;
    /**
     * Create a new MemoryConsolidationService.
     *
     * @param memoryProvider - Function that retrieves agent memories
     */
    constructor(memoryProvider: MemoryProvider);
    /**
     * Get the file path for an agent's consolidation report.
     *
     * @param sessionName - Agent session name
     * @returns Absolute path to consolidation.json
     */
    private getFilePath;
    /**
     * Read the most recent consolidation report from disk.
     *
     * @param sessionName - Agent session name
     * @returns Consolidation report, or empty default if none exists
     */
    getReport(sessionName: string): Promise<ConsolidationReport>;
    /**
     * Run consolidation analysis on all agent memories.
     *
     * Identifies recurring patterns by counting word/phrase frequency
     * across memories and extracting common themes.
     *
     * @param sessionName - Agent session name
     * @returns The generated consolidation report
     */
    consolidate(sessionName: string): Promise<ConsolidationReport>;
    /**
     * Extract recurring patterns from memories by analyzing keyword frequency.
     *
     * @param memories - Array of memory text strings
     * @returns Identified patterns sorted by occurrence count
     */
    private extractPatterns;
    /**
     * Derive insights from memories and patterns.
     *
     * @param memories - Array of memory text strings
     * @param patterns - Previously extracted patterns
     * @returns Array of derived insights
     */
    private deriveInsights;
    /**
     * Persist consolidation report to disk.
     *
     * @param sessionName - Agent session name
     * @param report - Consolidation report to save
     */
    private save;
}
//# sourceMappingURL=memory-consolidation.service.d.ts.map