Expand description
RRF (Reciprocal Rank Fusion) utilities shared between hybrid-search and
deep-research.
The formula used is the canonical RRF score:
score(d) = sum_over_lists { weight * 1 / (rrf_k + rank(d)) }where rank is 1-indexed position in each ordered list. The map returned
by rrf_fuse contains un-normalised scores; callers that need a [0,1]
range should divide by the theoretical maximum:
max_possible = sum_over_lists { weight * 1 / (rrf_k + 1) }Functionsยง
- rrf_
fuse - Fuse multiple ranked lists of integer IDs via Reciprocal Rank Fusion.
- rrf_
max_ possible - Compute the theoretical maximum RRF score for a given set of weights and
rrf_k.