/**
 * Memory Daemon - Background worker that processes interactions into memories.
 *
 * Watches interactions.jsonl for new entries from ALL avis sessions,
 * extracts memory-worthy facts, and updates the memory store + semantic trie.
 *
 * Runs as a non-blocking interval inside each avis process. Uses file-based
 * locking and checkpointing to coordinate across multiple instances.
 *
 * Processing pipeline:
 *   1. Read new interactions since last checkpoint
 *   2. Buffer interactions into conversation windows (user + assistant pairs)
 *   3. Extract memory-worthy facts using heuristics (no LLM required)
 *   4. Deduplicate against existing memories
 *   5. Create/update memories and index in semantic trie
 *   6. Periodically rebuild the knowledge graph
 */
import type { MemoryManager } from "./memory-manager.js";
import { SemanticTrie } from "./semantic-trie.js";
export declare class MemoryDaemon {
    private _memoryManager;
    private _trie;
    private _interactionsPath;
    private _checkpointPath;
    private _timer;
    private _processing;
    private _patterns;
    /** How often to check for new interactions (ms) */
    private _intervalMs;
    /** Ollama LLM extraction config (if enabled) */
    private _ollamaModel;
    private _ollamaHost;
    constructor(memoryManager: MemoryManager, options?: {
        intervalMs?: number;
        interactionsPath?: string;
        checkpointPath?: string;
        trieDir?: string;
        /** Enable Ollama-based LLM extraction (model name, e.g. "gemma4") */
        ollamaModel?: string;
        /** Ollama host (default: http://localhost:11434) */
        ollamaHost?: string;
    });
    get trie(): SemanticTrie;
    /** Start the background processing loop */
    start(): void;
    /** Stop the background processing loop */
    stop(): void;
    /** Process new interactions immediately (non-blocking) */
    processNow(): Promise<{
        newMemories: number;
        updatedMemories: number;
    }>;
    private _tick;
    private _process;
    private _buildWindows;
    private _extractMemories;
    /**
     * Extract session-state updates from raw interactions.
     * Looks for sequential patterns like counting, ongoing tasks, etc.
     */
    private _extractSessionState;
    private _extractWithOllama;
    private _buildPatterns;
    /**
     * Apply an extracted memory: create if new, update if similar exists.
     * Uses the semantic trie for fast duplicate detection.
     */
    private _applyMemory;
    /** Simple word-overlap similarity (Jaccard) */
    private _textSimilarity;
    private _indexMemory;
    private _indexExistingMemories;
    private _extractTerms;
    private _loadCheckpoint;
    private _saveCheckpoint;
}
//# sourceMappingURL=memory-daemon.d.ts.map