Rank Fusion
The step that turns Hybrid Retrieval's two independently ranked result lists (keyword and semantic) into one ranking. Two common methods, with a real tradeoff:
- Weighted score fusion — normalize each channel's
score to a 0–1 range and combine with weights (OpenClaw:
0.7·vector + 0.3·keyword). It preserves how strong each individual match was and gives you a control knob, at the cost of having to normalize dissimilar score scales. - Reciprocal rank fusion (RRF) — ignore raw scores, use only each result's position in each list (a result ranked #2 semantically and #3 by keyword gets a combined score from those ranks). Simpler and immune to score-scale mismatch, but it treats a near-perfect match the same as a merely-decent one — it cares about position, not strength.
Results that appear near the top of both lists bubble up; a
result found by only one channel takes a zero for the other and still
competes. Two implementation details worth stealing: OpenClaw
over-fetches a 4× candidate multiplier (ask for 6, each
channel returns up to 24) so fusion has more to work with, then filters
the fused list by a minimum score threshold (0.35) and
caps to the requested count. BM25 ranks are folded into a 0–1 score via
1/(1+rank); cosine distance is flipped to
similarity via 1 − distance.
Claims
- Weighted fusion preserves match strength; RRF uses only rank position. observation — the load-bearing contrast: weighted keeps the magnitude of each match, RRF discards it.
- Choose weighted fusion when match strength matters and you'll tune weights; choose RRF when you want a simple combine that's immune to score-scale mismatch. best practice — context: merging heterogeneous score scales (BM25 vs cosine); weighted needs normalization + tuning, RRF sidesteps both by throwing away magnitude.
- Over-fetch candidates per channel (e.g. 4× the requested count) before fusing. best practice — context: hybrid pipelines; more candidates give fusion a richer pool, at more compute per query.
- Filter the fused list by a minimum score and cap to the requested count. observation — a factual guardrail so low-relevance results don't pad the output.
Related
- Hybrid Retrieval — fusion is the join step that makes hybrid a single ranking.
- Reranking — the model-scored pass that can follow fusion for nuance the math can't judge.
- Semantic Retrieval — supplies the vector-distance channel fusion consumes.
- Distillate: How AI Agents Search Their Memory — Hybrid Retrieval, in Practice (OpenClaw)