/**
 * Reciprocal Rank Fusion (RRF).
 *
 * Combines ordered rank lists from multiple retrievers (e.g. BM25, vector,
 * graph) into a single fused ranking. Robust to heterogeneous score scales:
 * the only thing that matters is each retriever's rank order.
 *
 *   score(d) = Σ_i  w_i / (k + rank_i(d))
 *
 * - rank_i(d) is the 1-indexed position of d in retriever i's list.
 * - w_i is the optional weight for retriever i (default 1).
 * - k is a smoothing constant. Cormack et al. (2009) recommend 60.
 *
 * The function returns the union of ids across all rank lists, sorted by
 * fused score descending. Ties break by id ascending for stable output.
 */
export interface RankList {
    /** Identifier for this retriever (e.g. 'fts', 'vector', 'graph'). */
    name: string;
    /** Ordered ids, best-first. May be empty. Duplicates within a list are deduplicated, keeping the first occurrence. */
    ids: number[];
    /** Multiplicative weight on this retriever's contribution. Defaults to 1. */
    weight?: number;
}
export interface RrfOptions {
    /** RRF smoothing constant. Default 60. */
    k?: number;
}
export interface RrfContribution {
    name: string;
    /** 1-indexed rank within that retriever's list. */
    rank: number;
    /** weight / (k + rank) — this contribution's addition to the final score. */
    weighted: number;
}
export interface RrfResult {
    id: number;
    score: number;
    contributions: RrfContribution[];
}
export declare function reciprocalRankFusion(rankLists: readonly RankList[], options?: RrfOptions): RrfResult[];
