Reciprocal Rank Fusion (RRF) combines independently ranked result lists by position rather than raw scores. For each result, it adds 1/(k + rank), typically using k=60. This avoids comparing incompatible vector-similarity and keyword-ranking scales: items appearing near the top of both lists receive the strongest combined ranking. section 5.5.3
Use RRF when a retrieval service must merge heterogeneous search paths:
- Run vector and keyword searches independently, preserving each path's ranked list. section 5.5.4
- Retrieve more candidates than the caller requests; fetching twice top_k lets results ranked outside either short list compete after fusion. section 5.5.4
- Prefer RRF over weighted score averages when score distributions vary across retrieval methods or datasets; weighted normalization can distort rankings and requires fragile tuning. section 5.5.3
- Keep both retrieval methods behind a common result interface so callers receive the same SearchResult shape and can switch between vector and hybrid search. section 5.5.4 section 5.7
Hybrid search flow
A caller submits a text query to hybrid_search. The vector path embeds it and performs cosine-similarity retrieval; the keyword path converts it to a tsquery and applies PostgreSQL full-text ranking. RRF merges both ranked lists, and the service returns one result list ordered by combined relevance. section 5.5.4
Figure 5.8 Hybrid search in the Data Service. A text query enters the search method and follows two parallel paths. The vector path embeds the query through the Model Service and runs a cosine similarity search against stored vectors. The keyword path converts the query into a tsquery and runs a full-text search with ts_rank scoring against the same chunks table. Both paths return ranked result lists, which Reciprocal Rank Fusion merges into a single ranked list by combining positional scores. The fused results are returned to the calling workflow.

Trace the two retrieval paths from one query through candidate ranking, RRF merging, and the final result returned to the calling workflow. section 5.5.4





