Dense vector retrieval alone fails for exact-term technical queries in RAG systems. This post covers a three-stage production retrieval pipeline: hybrid search combining BM25 keyword scoring with dense vector similarity (tuning the alpha blend parameter using hit rate and MRR on a labeled eval set), cross-encoder re-ranking to improve context precision by scoring query-document pairs jointly, and metadata filtering to exclude stale or irrelevant documents before scoring. Real evaluation numbers using RAGAS metrics show Context Precision improving from 0.61 (dense only) to 0.79 (hybrid + re-ranking), with code examples using LlamaIndex, Weaviate, and sentence-transformers throughout.

16m read timeFrom towardsdatascience.com
Post cover image
Table of contents
In This ArticleThe Problem With Dense VectorsBM25: what is at and how does it helpHybrid Search: Combining BothCross-Encoders: What They Are and Why They WorkImplementing Re-rankingMeasuring the ImpactMetadata FilteringThe Complete PipelineOne Final note on RAGASWhere This Leaves the Series
105 Impressions