4. Retrieval — Hybrid Search, Reranking & Query Understanding
Why Hybrid Search (Vector + Keyword)
Vector search captures semantic similarity ("car" matches "automobile"). Keyword search (BM25) captures exact terms ("error code E-4502" won't match semantically but BM25 finds it instantly). Production systems need both.
| Search Type | Wins When | Fails When |
|---|---|---|
| Dense (vector) | Semantic queries, paraphrases, conceptual search | Exact term matching (product codes, error codes, names) |
| Sparse (BM25) | Exact keywords, rare terms, technical identifiers | Paraphrased queries, conceptual similarity |
| Hybrid (fusion) | Most real-world queries (mix of concept + specific terms) | Simple queries where one method suffices (adds latency) |
Reciprocal Rank Fusion (RRF)
The standard way to merge results from multiple retrievers:
Continue Reading
This topic continues with more in-depth content, code examples, and diagrams. Sign up free to unlock the full guide with all 87 sections.
Sign Up Free to UnlockFree access · No credit card required