/** * Reciprocal Rank Fusion (RRF) — combine multiple ranked lists into one. * * Reference: Cormack, Clarke, Büttcher (2009), "Reciprocal Rank Fusion * outperforms Condorcet and individual Rank Learning Methods." * * Formula: score(d) = Σ 1 / (k + rank_i(d)) * where k is a constant (default 60) that dampens high-rank dominance. * * Used to combine BM25 keyword ranking and dense-vector cosine ranking * without score normalization (scales are incomparable). */ export interface RankedItem { /** Stable identifier used to dedupe across lists. */ id: string; /** Original item payload, returned in fused result. */ item: T; } export interface FusedResult { id: string; item: T; score: number; /** Rank (1-based) in each input list, or undefined if absent. */ ranks: Record; } /** * Fuse multiple ranked lists. Lists are keyed by name (e.g., "semantic", "keyword") * for debuggability. Items ordered best-first in each list. * * Returns items sorted by fused score descending. */ export declare function reciprocalRankFusion(lists: Record[]>, opts?: { k?: number; topK?: number; }): FusedResult[]; //# sourceMappingURL=rrf.d.ts.map