Hybrid search
Hybrid search combines complementary retrieval methods, commonly lexical and semantic search, to handle both exact terms and paraphrases.
Before you start: Review Vector search first. Python-like examples use variables, lists and functions.
Follow the mechanism
Lexical branch
Find exact words and identifiers.
Start with an everyday explanation
Use both a book index for exact names and a librarian for related ideas. Combining the results can help when either method misses a clue.
See a concrete example
With RRF constant k=60, a document at ranks 1 and 3 scores 1/61 + 1/63 ≈ 0.03227. The constant is a tunable choice, not a guarantee.
A claim to question
Hybrid does not mean adding two arbitrary raw scores without calibration.
Try before revealing the answer
Run the toy search with POL-448210 and with a paraphrase of a rejected claim. Compare rankings.
Show the worked answer
Identifier queries benefit from lexical matches while paraphrases can benefit from semantic candidates. Use the observed errors to justify fusion, filtering or separate routing.
Now explain the idea to someone else using your own example. If you cannot explain a stage, revisit it before moving on.
Engineering details and trade-offs
Normalize or fuse ranked lists using a defined policy such as reciprocal rank fusion. Raw lexical and vector scores are not automatically comparable.
Deduplicate by document identity and enforce permissions consistently in every branch. Evaluate per-query categories as well as overall averages.
Reason through the example
With RRF constant k=60, a document at ranks 1 and 3 scores 1/61 + 1/63 ≈ 0.03227. The constant is a tunable choice, not a guarantee.
Implement and test
Run the toy search with POL-448210 and with a paraphrase of a rejected claim. Compare rankings.
Inspect the reasoning and expected result
Identifier queries benefit from lexical matches while paraphrases can benefit from semantic candidates. Use the observed errors to justify fusion, filtering or separate routing.
What to measure
State the expected result before changing a control. Record your inputs, compare the observed result and explain one limit of this model. In a real implementation, test the failure case as well as the normal path.
Answer before reading the reference
How would you combine BM25 and dense retrieval?
A defensible answer
Retrieve authorized candidates from both, fuse ranks or calibrate scores, deduplicate and optionally rerank. Evaluate exact-ID and semantic queries separately and track latency overhead.
Prepare the follow-up
What happens if one retrieval branch is unavailable?
Show follow-up reasoning
Define whether degraded operation is safe for the query category. A lexical outage may make exact-ID answers unsafe even if semantic results exist. Surface reduced capability, use an exact authorized lookup when available, or abstain rather than pretending the fused ranking is unchanged.
Use the engineering explanation and worked task above to support your response. Identify which assumptions you would need to verify in production.
Choose a practice depth
- New to GenAI
- Define hybrid search with the everyday example and name its key limitation.
- Applied experience
- Explain the example, implementation choice and a measured failure case. Use the exercise as a small design review.
- Senior or systems depth
- Answer the follow-up, compare alternatives and justify an evaluation or rollout plan with operational constraints.
Self-review your answer
0/4 checks selected. This is self-assessment, not an interview score.
Your explanation and revision notes
Loading local notes…