Hybrid Search
A combination of semantic (vector) and traditional keyword search that improves accuracy in RAG systems.
What is hybrid search?
Hybrid search combines two types of search: semantic (vector) search and classic keyword (full-text, e.g., BM25) search. The goal is to combine the strengths of both approaches - semantics understands meaning, while keyword search precisely matches specific words, numbers, or names.
Why hybrid search
- Semantics: Finds relevant documents even when the query uses different words than the text in the vector database
- Keywords: Precisely hit unique identifiers - product numbers, names, abbreviations, codes
- Score fusion: Both approaches are merged (e.g., using Reciprocal Rank Fusion) and results are ranked by combined relevance
When to use hybrid search
- Searching technical documentation with part numbers and SKUs
- Legal and medical texts full of specific terminology
- E-commerce - combining search by description and by product code
Hybrid search is often further refined with re-ranking, which selects the most suitable documents for the LLM from the final set.