AI Engineering · LLM applications that ship
Why combine keyword and vector search?
Short answer
Keyword search is precise for names and codes; vector search handles paraphrases. Hybrid retrieval runs both and fuses the rankings, which is more robust than either alone.
Users ask in two different ways. Sometimes they use the exact term that appears in the document, such as an error code or product name, where BM25 excels. Sometimes they describe the idea in different words, where embeddings win. Hybrid search retrieves from both and combines the results.
- Run lexical and vector retrieval in parallel, then merge with reciprocal rank fusion or a weighted score.
- Apply metadata filters consistently to both branches.
- Tune the fusion weight on an eval set; the right balance depends on the corpus and query mix.
- Rerank the fused candidates to get a single, higher-precision ordering.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1How would you choose the fusion weight?
- 2What does reciprocal rank fusion actually do?
- 3When would hybrid search not be worth the extra complexity?
Say it in the interview
Keyword and vector search fail in different ways. BM25 nails exact codes and names but misses paraphrases, while embeddings do the opposite. Hybrid retrieval runs both and fuses the ranked lists, usually with reciprocal rank fusion, then reranks the combined candidates. I tune the weighting on real queries, because the right mix depends on whether users search by identifier or by description.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live AI Engineering mock interview and get scored feedback on depth, clarity and confidence.