/**
 * Semantic Trie - Fast prefix-based + inverted index for memory retrieval.
 *
 * Provides O(prefix_len) lookup for concepts/tags and O(1) inverted index
 * from terms to memory IDs. Persisted to disk as JSON for cross-session reuse.
 */
export interface TermIndex {
    /** term -> set of memory IDs */
    terms: Map<string, Set<string>>;
    /** tag -> set of memory IDs */
    tags: Map<string, Set<string>>;
    /** memory ID -> set of terms (for deletion) */
    memoryTerms: Map<string, Set<string>>;
}
export declare class SemanticTrie {
    private _root;
    private _invertedIndex;
    private _persistPath;
    private _dirty;
    constructor(persistDir?: string);
    private _newNode;
    /** Index a memory by its extracted terms and tags */
    index(memoryId: string, terms: string[], tags: string[]): void;
    /** Remove a memory from all indices */
    remove(memoryId: string): void;
    /** Find memory IDs matching a query using prefix + exact match */
    search(query: string, maxResults?: number): Array<{
        memoryId: string;
        score: number;
    }>;
    /** Get all memory IDs indexed under a specific tag */
    getByTag(tag: string): Set<string>;
    /** Get stats */
    get stats(): {
        termCount: number;
        tagCount: number;
        indexedMemories: number;
    };
    private _insertTrie;
    private _removeFromTrie;
    private _prefixSearch;
    private _collectMemoryIds;
    private _addToInverted;
    private _tokenize;
    /** Save to disk if dirty */
    flush(): void;
    private _loadFromDisk;
    private _serializeTrieNode;
    private _deserializeTrieNode;
    private _serializeMap;
    private _deserializeMap;
}
//# sourceMappingURL=semantic-trie.d.ts.map