diff --git a/docs/hybrid-search-reranking-pipeline.md b/docs/hybrid-search-reranking-pipeline.md new file mode 100644 index 0000000..6a36de1 --- /dev/null +++ b/docs/hybrid-search-reranking-pipeline.md @@ -0,0 +1,9 @@ +# Hybrid Search & Reranking Architecture + +## Scoring Formula +Combines sparse BM25 lexical search with dense vector similarity via Reciprocal Rank Fusion: +$$RRF(d) = \sum_{m \in M} \frac{1}{k + r_m(d)}$$ +where $k = 60$ and $r_m(d)$ is the rank position of document $d$ in retrieval method $m$. + +## Cross-Encoder Reranker +Top 25 candidates from RRF are scored by a cross-encoder (e.g. `bge-reranker-large`) before selecting the final top 5 context windows for generation.