Why combine keyword search with vector search?
Answer
They fail in opposite directions.
Vector search matches meaning. It finds a document about "cancelling a subscription" when the user asked how to "stop being billed". It is weak on exact tokens: product codes, error numbers, function names, and rare proper nouns often embed into a neighbourhood that does not distinguish them.
Keyword search, typically BM25, matches terms. It is excellent for identifiers and exact phrases. It fails entirely when the user's words differ from the document's words.
Hybrid search runs both and merges the results. The usual merge is reciprocal rank fusion, which combines by rank position rather than by score, avoiding the problem that similarity scores and BM25 scores are not on a comparable scale.
For technical corpora the hybrid gain is large, because queries are full of exact tokens. Someone searching for ECONNREFUSED or useEffect wants lexical matching, and pure vector search returns thematically related but wrong results.
Metadata filtering is worth adding alongside. Restricting by date, source, or permission before ranking usually improves results more than tuning the ranker.
Common wrong answer
Assuming vector search supersedes keyword search because it is newer and semantic. In production retrieval, BM25 is a strong baseline that embedding-only systems frequently fail to beat, particularly on technical content. Many teams have shipped a vector store and quietly regressed on exact match queries that the old search handled fine.
Likely follow-ups
- How do you merge two ranked lists?
- When is keyword search alone enough?