1:1 Mentoring with Big Tech AI Engineers
RAG & MCP

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 TypeWins WhenFails When
Dense (vector)Semantic queries, paraphrases, conceptual searchExact term matching (product codes, error codes, names)
Sparse (BM25)Exact keywords, rare terms, technical identifiersParaphrased 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 Unlock

Free access · No credit card required

More in RAG & MCP

Get full access to all 87 sections with code examples, diagrams, and interactive animations.

Sign Up Free