/**
 * Graph-based retrieval: turn a free-text query into a ranked list of
 * memories by walking the knowledge graph (entities + triples).
 *
 * The retriever is side-effect-free — it only reads. It does NOT insert
 * new entities, mutate aliases, or write any state. That's the
 * contract that lets it stand alongside FTS and vector retrievers in the
 * RRF orchestrator without polluting the graph during a query.
 *
 * Algorithm:
 *   1. Tokenize the query, drop stop-words and tokens shorter than
 *      `MIN_TOKEN_LEN`.
 *   2. Resolve each token to seed entities (case-insensitive name,
 *      alias, then Levenshtein for tokens at least `MIN_FUZZY_LEN` chars).
 *   3. BFS over the triples table up to `maxHops`. Track shortest hop
 *      and incoming-edge confidence for every entity reached. Seeds have
 *      hop=0 and implicit confidence 1.0.
 *   4. For every memory mentioning a reached entity (via the
 *      `memory_entities` table), accumulate score:
 *           Σ  incomingConf / (hop + 1)
 *   5. Optional `project` filter via the JOIN.
 *   6. Sort by score desc, ties by memoryId asc, cap at `limit`.
 */
import type { Database as SqliteDatabase } from 'better-sqlite3';
export interface GraphRankResult {
    memoryId: number;
    score: number;
}
export interface GraphRankOptions {
    /** Maximum hops from seed entities. Default 2. */
    maxHops?: number;
    /** Maximum result rows. Default 50. */
    limit?: number;
    /** Filter to memories within this project. */
    project?: string;
    /** Override stop-word set. Default is a small built-in English list. */
    stopWords?: Set<string>;
}
export declare function graphRankFromQuery(query: string, db: SqliteDatabase, options?: GraphRankOptions): GraphRankResult[];
