Introducing Duet Autopilot.
Learn more
Glossary

Hybrid search

Hybrid search is a retrieval strategy that combines two different search methods — typically dense vector search and sparse keyword search — and merges their results. Rather than relying on either method alone, hybrid search takes advantage of the complementary strengths of both: vector search captures semantic similarity, and keyword search captures exact matches on specific terms.

The technique has become standard in production RAG and enterprise search systems because pure vector search alone systematically underperforms on certain query types, and combining it with keyword search recovers that lost recall at low additional cost.

Why pure vector search isn't enough

Dense vector search represents documents and queries as high-dimensional embeddings and returns the documents whose embeddings are most similar to the query's. It works remarkably well when the query is a natural-language question and the relevant document contains a semantically equivalent passage using different words. "How do I cancel my subscription?" matches a document about "ending your membership" even though no keywords overlap.

Where vector search struggles is queries that hinge on specific terms. Product SKUs, error codes, jargon, acronyms, and proper nouns often don't have meaningful embeddings — they're strings that need to be matched literally, not interpreted semantically. A query for "error code E-401" might return generic troubleshooting documents that don't mention E-401 at all, while missing the specific error page that lists E-401 by name.

Keyword search has the opposite failure mode. It handles specific terms exceptionally well — the BM25 algorithm has decades of engineering behind it — but misses queries that use different words for the same concept. "How do I return this?" returns nothing if the relevant document only talks about "refunds" and "exchanges."

How hybrid search works

A hybrid search pipeline has three components. First, dual retrieval: the system runs the same query through a vector index and a keyword index independently, each returning its top-k candidates. Second, fusion: the two result sets are combined into a single ranked list. Third, reranking (optional): the combined list may be re-scored by a more expensive model to produce the final ordering.

The fusion step is where hybrid search designs differ. Two approaches dominate.

Reciprocal Rank Fusion (RRF) is the most common. Each document gets a score of 1 / (k + rank) from each retrieval method, where k is a constant (typically 60) and rank is the document's position in that method's results. Documents that rank high in either method get high total scores. RRF is parameter-light, doesn't require score calibration between the two methods, and works well in practice.

Weighted score combination normalizes each method's scores to a common scale and then computes a weighted sum. This gives more control — you can weight vector 0.7 and keyword 0.3 if vector is more reliable in your data — but requires per-dataset calibration to work well.

Hybrid search in practice

Most modern vector databases support hybrid search natively. Elasticsearch, Weaviate, Qdrant, Pinecone, and pgvector all offer some form of hybrid retrieval, either through built-in fusion or through simple two-query composition.

Adopting hybrid search typically improves retrieval quality by 10-30% on realistic query distributions. The gain is largest on queries with a mix of natural language and specific terms — which describes most real user queries in customer support, e-commerce, and enterprise search. The gain is smaller when the corpus is highly technical (heavy on jargon, where keyword search alone is already very effective) or purely conversational (where vector search alone is sufficient).

When to add hybrid search

Hybrid search is worth adding when three signals are present in your application.

Your users search with specific terms. If your users routinely search for SKUs, model numbers, error codes, or proper nouns, pure vector search is probably missing important matches. Log analysis of failed searches typically reveals this pattern quickly.

Your corpus has meaningful lexical structure. If your documents contain specific identifiers, technical terms, or vocabulary that carries semantic weight, keyword search will find things vector search misses. A knowledge base of product documentation, legal contracts, or medical literature has this property.

Your retrieval quality matters. Every hop of quality improvement in retrieval flows through to the final AI response quality. In production systems where wrong retrieval means wrong answers, the modest complexity cost of hybrid search is easily worth its benefit.

Hybrid search and the broader RAG stack

Hybrid search is one of several complementary techniques for improving RAG quality. Others include reranking (re-scoring retrieval results with a stronger model), graph RAG (using knowledge graphs alongside document retrieval), query rewriting (rephrasing user queries to be more retrieval-friendly), and agentic RAG (using an agent to iteratively refine retrieval).

These techniques stack. A production RAG system might use query rewriting to normalize the user's query, hybrid search to retrieve candidates from both vector and keyword indexes, reranking to score the merged results, and finally the LLM to synthesize the top results into a response. Each stage adds a small amount of latency and cost but improves final answer quality. For teams tuning a RAG system, hybrid search is usually one of the higher-leverage first improvements to add after standard vector search — cheap to implement, easy to evaluate, and reliably better than either method alone.

Deliver the concierge experiences your customers deserve

Get a demo