/** * Reciprocal Rank Fusion (Cormack, Clarke, and Buettcher 2009). * * Fuses N ranked candidate lists into a single ordering by summing * weighted 1/(k + rank) contributions per candidate. The constant K is * the canonical 60 from the original paper and the value already in use * across hippo's `hybridSearch` since v1.0. Do NOT tune K without an * explicit cross-corpus eval — it is calibrated against IR benchmarks * and works robustly across BM25/dense/cross-encoder rank-list shapes. * * Generic over the candidate id type so this helper can be shared by * `src/search.ts::hybridSearch` (T = number, idx into MemoryEntry[]) and * the LongMemEval F9 hybrid retrieve benchmark (T = string, session_id). * * Behaviour MUST stay byte-identical to the inline implementation that * lived in `src/search.ts:354-374` before extraction (commit ab6c5eb). * The `tests/rrf.test.ts` suite is the contract. */ export declare const RRF_K = 60; export interface RrfFuseOptions { /** Smoothing constant. Default RRF_K = 60. */ k?: number; /** * Rank assigned to candidates absent from a list. Default is * `max(rankedLists.map(l => l.length)) + 1` — the convention used in * the pre-extraction `hybridSearch` code (`entries.length + 1`). */ absentRank?: number; } /** * Fuse N ranked lists into a single Map of candidate id -> RRF score. * * @param rankedLists Each inner array is candidates in descending-score order. * Element at index 0 is rank 1; index 1 is rank 2; etc. * @param weights Per-list weights. weights.length === rankedLists.length. * Weights are summed without normalisation — pass {0.5, 0.5} * for symmetric fusion or {0.2, 0.8} for asymmetric. * @param options Optional k override + absentRank override. * @returns Map from candidate id to fused RRF score. Sort descending * by value to get the fused ordering. */ export declare function rrfFuse(rankedLists: ReadonlyArray>, weights: ReadonlyArray, options?: RrfFuseOptions): Map; //# sourceMappingURL=rrf.d.ts.map