AppsGuidesAI DictionarySmall FixesOn RecordAboutFollow the lab

Hybrid search

Also called keyword plus vector search

Hybrid search runs an exact keyword search and a meaning-based AI search at the same time, then merges their results into one list.

Using AITechnical

In plain words

There are two ways to search. Keyword search looks for your exact words: great for a model number like "RTX 4070", a name or an error code, but blind to synonyms. Semantic search looks for the same meaning: it knows "car won't start" and "engine fails to turn over" are the same problem, but can fumble exact codes and rare names.

Hybrid search runs both and blends the results. A document that shows up near the top of both lists rises to the top of the final one. A document found by only one still gets a fair chance.

That makes it a common choice for AI systems that look things up in your files before answering (RAG), where questions mix plain language with exact terms like invoice numbers, product names or legal clauses.

Everyday example

Finding a photo on your phone

You search your gallery for "Goa trip beach sunset". One helper checks captions and file names for those exact words. Another looks at the pictures and finds anything that looks like a beach at sunset, even if it is captioned "IMG_4471". You see the photos both agreed on first, then the ones only one of them spotted.

Where the example breaks: Your gallery's two helpers see the same photos. In real systems the two searches score in completely different units, so their results are merged by rank, not by adding raw scores.

Go deeper

How it actually works

The two halves use different machinery: a classic text index scored with BM25, and a vector database of embeddings.

  1. Keyword half: BM25

    BM25 is a ranking formula from decades of search research, named after the Okapi system at City University London. It rewards documents that contain your words often, gives rare words more weight than common ones, and adjusts for document length.

  2. Meaning half: vectors

    Each chunk of text is turned into an embedding, a list of numbers that places it by meaning. Your question gets one too, and the closest chunks are returned, whatever words they use.

  3. Merge by rank

    A popular method, reciprocal rank fusion, gives each document 1 ÷ (60 + its rank) from each list and adds them up. A document ranked 1st and 3rd scores 1/61 + 1/63, beating one ranked 1st in only one list. Some systems instead normalise the scores and mix them with a weight.

  4. Tune the balance

    Tools like Weaviate let you set a weight called alpha: 0 means keyword only, 1 means vector only. The right balance depends on your data, so it is worth testing. A reranker is often added after the merge.

Rank fusion paper
Cormack, Clarke and Büttcher, SIGIR 2009: "Reciprocal Rank Fusion outperforms Condorcet and individual Rank Learning Methods"
The constant 60
Chosen in that paper's pilot tests, and still the default rank constant in Elasticsearch
BM25 roots
Probabilistic search theory by Stephen Robertson, Karen Spärck Jones and others in the 1970s and 1980s
Measured gain
In Anthropic's 2024 tests with its contextual method, embeddings plus BM25 cut failed retrievals by 49%, against 35% for embeddings alone

Questions people ask

What is the difference between hybrid search and semantic search?

Semantic search uses only meaning, through embeddings. Hybrid search adds exact keyword matching on top and merges the two, so it handles both "how do I get a refund" and "order #A1932".

What is BM25?

A long-standing formula for ranking documents by keyword match. It counts how often your words appear, gives rarer words more weight and adjusts for length. Many search engines use it as their keyword layer.

What is reciprocal rank fusion?

A simple way to merge ranked lists: each document scores 1 ÷ (60 + rank) in each list, and the scores are added. It uses positions, not raw scores, so lists from very different systems can be combined fairly.

Is hybrid search better for RAG?

Often, especially when questions include names, codes or jargon. It is not always better: for purely conversational questions, vector search alone may match it. Test both on your own questions.

Was this clear?

1 is confusing, 5 is crystal clear. One tap, no account needed.

Spotted something wrong, or know a better example? Suggest a change

Further reading