Skip to content
47% off: the complete course for $79 (reg. $149)Order now →
AI Builder

AI builder glossary

Hybrid search

Running keyword search and vector search together and merging their results, so queries match on both exact terms and overall meaning.

Hybrid search combines two retrievers with opposite strengths. Vector search finds paraphrases and conceptual matches; keyword search nails exact identifiers, names, and rare terms. Running both and merging the ranked lists covers far more real queries than either alone, which is why it is a common default for production retrieval.

The merge step is the interesting part. The two retrievers produce scores on completely different scales, so simply adding them doesn't work well. Reciprocal rank fusion sidesteps the problem by combining positions instead of scores. Score normalization with weights can do slightly better when tuned on labeled data but is more fragile.

In Postgres, hybrid search can be a single query: a full-text CTE and a vector CTE, each returning its top candidates with a rank, merged with a fusion formula, all filtered to the user's workspace. Many vector databases and search services also offer hybrid queries natively.

Measure before and after. Hybrid usually helps most on identifier-heavy and short queries and should not hurt paraphrased ones; if it does, adjust candidate counts or weights. A reranker on top of the merged list is the common next step.

Example

A support knowledge base adds keyword search alongside vectors. On a labeled set of real queries, those containing order numbers and error codes jump from rarely to reliably finding the right article, while natural-language questions hold steady.

Learn more in the course

Related terms

Go from definitions to doing

Learn to build AI-powered apps in 132 practical lessons.