//#region ../ai/src/rag/hybrid/rrf.d.ts /** One item's id paired with a fused relevance score. */ type RankedItem = { id: string; score: number; }; /** * Reciprocal Rank Fusion (A4) — combine several independently-ranked * lists of ids into one consensus ranking. Each list contributes * `1 / (k + rank)` to an id's score (rank is 0-based within that list), so * an id near the top of multiple lists rises even if no single list ranks * it first. The classic fusion for hybrid (dense + lexical) retrieval * because it needs no score calibration between the lists. * * `k` (default 60, the standard) dampens the contribution of lower ranks. * Returns ids sorted by fused score, highest first. * * @example * reciprocalRankFusion([["a", "b", "c"], ["b", "a"]]); * // → [{ id: "b", ... }, { id: "a", ... }, { id: "c", ... }] */ declare function reciprocalRankFusion(rankedLists: ReadonlyArray>, k?: number): RankedItem[]; //#endregion export { RankedItem, reciprocalRankFusion }; //# sourceMappingURL=rrf.d.mts.map