Hybrid Search
Hybrid search combines vector similarity with traditional keyword search to improve retrieval quality.
Prerequisites
Why Hybrid Search?
Vector search is strong at matching meaning and paraphrases, but can miss exact identifiers, product codes, error messages, or rare technical terms — a query embedding for "error E4021" might not land especially close to a document that literally contains "E4021" if the embedding model treats it as an unfamiliar token. Keyword search excels at exactly this case, but misses paraphrases entirely. Hybrid search runs both and combines the results, covering each approach's blind spot with the other's strength.
Query
One QuestionRun through both search methods at once.
Vector Search
Matches MeaningStrong at paraphrases, weak at exact terms.
Keyword Search
Matches Exact TermsCatches identifiers and codes vector search misses.
Combine + Score
Merges BothEach approach covers the other's blind spot.
Merged Results
Best of BothOne ranked list from both search methods.
How Results Are Combined
Vector search and keyword search produce scores on different scales, so combining them isn't as simple as adding the numbers together. A common approach is Reciprocal Rank Fusion (RRF), which combines results based on each item's rank in each result list rather than its raw score — an item ranked highly by either method contributes strongly to the final combined ranking, without needing the two scoring systems to be directly comparable.
Tip
Reranking is often applied after hybrid search merges results, adding a third, more precise pass on top of the combined candidate set.
A Real-World Example
A developer searching internal documentation for "auth token expired" wants both an exact match on the literal error string and a semantic match on documents discussing "session expiration" or "credentials timing out" — concepts a user might phrase differently. Vector search alone might weight the semantic matches too heavily and miss the document with the exact error string; keyword search alone might miss the differently worded documents. Hybrid search surfaces both.
Common Mistakes
Assuming vector search alone is always sufficient
Exact terms, codes, and rare vocabulary are frequently underserved by pure vector similarity.
Naively averaging raw vector and keyword scores
The two scoring systems are on different scales — rank-based fusion methods like RRF handle this more reliably than direct score averaging.
Skipping hybrid search because it adds complexity
For content with exact identifiers, technical jargon, or names, the quality gain often outweighs the added implementation complexity.
Not tuning the balance between the two signals
Some hybrid systems let you weight vector versus keyword contribution — leaving this at an arbitrary default may not fit your specific content.
Interview Question
What is hybrid search, and why would you combine vector and keyword search instead of using just one?
Hybrid search combines vector similarity search with traditional keyword search, because each one covers the other's weak spot. Vector search matches meaning and paraphrases well but can miss exact identifiers, codes, or rare technical terms; keyword search handles those exact matches well but misses differently worded content entirely. Combining them means running both and merging the results — often with a rank-based method like Reciprocal Rank Fusion, since the two approaches produce scores on different scales that aren't directly comparable. It's especially valuable for content that mixes natural language with exact technical terms, like error codes or product names.
What an interviewer may ask next
- Why can't you just average vector and keyword search scores directly?
- When would keyword search catch something vector search would miss?
- How does reranking relate to hybrid search?
Explain It in 30 Seconds
Hybrid search combines vector search and keyword search, because each covers what the other misses — vector search is strong on meaning and paraphrases, keyword search is strong on exact terms and identifiers. Results are usually merged with a rank-based method like Reciprocal Rank Fusion rather than direct score averaging, since the two approaches score on different scales. It's especially useful for content mixing natural language with exact technical terms.