Home/
Part XIII — Expert Mode: Systems, Agents, and Automation/41. Advanced RAG (Beyond the Basics)/41.1 Hybrid search (keyword + vector)
41.1 Hybrid search (keyword + vector)
Overview and links for this section of the guide.
The Problem with Vectors
Vectors are fuzzy. "Database" and "Store" are close. But if you search for "Store 123", vectors might find "Database 456" (similar concept) but miss "Store 123" (exact match).
Hybrid Search (Reciprocal Rank Fusion)
Combine the best of both worlds:
- Run a BM25 (Keyword) search. Get top 10.
- Run a Cosine Similarity (Vector) search. Get top 10.
- Combine the lists using Reciprocal Rank Fusion (RRF).
This ensures you catch exact keywords ("Error 500") AND conceptual matches ("Server Failure").