esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
  • Download ResumeContact
Let’s talk

I’ll build the agent for it.

What Is Hybrid Search?

What hybrid search is, why keyword and vector search need each other, and how the two lists are merged, explained simply for your AI interview.

In short

Hybrid search runs a keyword search (BM25) and a vector search on the same question, then merges both ranked lists into one result set. Microsoft's Azure AI Search merges them with Reciprocal Rank Fusion (RRF). Keyword search catches exact codes that vectors can miss, and vectors catch meaning that keywords miss.

11 min readIntermediateVery common · estimateFacts checked 26 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

Hybrid search runs two searches on the same question. One is keyword search, which finds exact words like a product code. The other is vector search, which finds text with a similar meaning. Each returns a ranked list, and I merge them with Reciprocal Rank Fusion, which ranks by position rather than raw score. In a returns bot, that means an exact model number and a policy about damaged goods both reach the top.

What is hybrid search, in plain words?

Hybrid search means running two kinds of search on the same question and combining what they find. Hybrid means mixed. Here it means keyword search plus vector search.

Keyword search checks which words a document shares with the question. Its scoring method is BM25, which helps stop common words from dominating the results. Vector search compares meaning. It turns each chunk of text into an embedding and looks for the chunks whose embeddings sit closest to the question's.

Think of a new claims handler at an insurance firm. Some cases she finds by typing the exact claim number. Others she finds by searching for a burst pipe in the kitchen. She uses both, because each finds cases the other misses. Hybrid search does the same in software. Our real case is a support bot that needs both a model number and a plain question.

Key words

Keyword search
Finds documents that contain the words, or codes, in the question.
BM25
The scoring formula Azure uses for text search, and a common choice for keyword search.
Vector search
Finds text whose embedding sits close to the embedding of the question.
Embedding
A list of numbers a model produces to stand for the meaning of a piece of text.
Reciprocal Rank Fusion
A simple way to merge ranked lists by position. Written RRF.

How does hybrid search work?

The two searches start together. The question goes to both, each returns a ranked list, and one merge step turns the two lists into one.

One question, two searches, one merged list

The question

A customer or agent types it

Run at the same time

Keyword search

Finds exact words and codes

Vector search

Finds similar meaning, not words

Merge with RRF

Ranks by position, not raw score

One ranked list

Exact codes and similar meanings

  1. 1The question goes to the keyword search.
  2. 2The same question goes to the vector search.
  3. 3Keyword hits reach the merge in rank order.
  4. 4Vector hits reach the merge in rank order.
  5. 5The merged list is what the bot reads.
One question goes to two searches at the same time. Each returns its own ranked list, and RRF merges the two into one list that keeps both exact codes and similar-meaning matches.
  1. 1

    Run both searches together

    Microsoft's Azure AI Search sends the keyword and vector parts as one request.

  2. 2

    Keep each list in order

    Each search returns its own best matches, ranked by its own method.

  3. 3

    Merge with RRF

    RRF gives each result points for its position in each list, then adds them up.

  4. 4

    Send the top results on

    The bot reads the top few passages, so the merge decides what the model sees.

Tip

Asked how it differs from vector search alone? Say vector search finds meaning, and hybrid adds exact-word search so codes and names are not lost.

Why not use vector search alone?

Vector search is strong on meaning but weak on rare exact words. An embedding model can miss a rare code, so a general page about the same product can outrank the exact page. Each search fails in a different place, so pairing them covers both gaps.

A customer types "My KX-4410-B kettle lid cracked, can I return it?" into the returns bot. Here is what each search does with that one message.

  • Keyword only

    Misses the meaning

    The policy page is titled damaged goods, not lid cracked, so a keyword search ranks it low or misses it.

  • Vector only

    Misses the exact code

    It returns kettles in general and can skip the one manual that names KX-4410-B.

  • Hybrid

    Gets both

    The model's manual and the damaged-goods policy both reach the top list.

  • “Some scenarios, such as querying over product codes, highly specialized jargon, dates, and people's names, perform better with keyword search because it can identify exact matches.”

    Microsoft, Azure AI Search docs

  • “While embedding models excel at capturing semantic relationships, they can miss crucial exact matches.”

    Anthropic

How are the two lists merged?

The obvious idea is to add the two scores. It fails because each search scores on its own scale. A BM25 score has no fixed upper limit, while Azure's vector scores sit between 0 and 1 for Euclidean and dot-product, and between 0.333 and 1.00 for cosine. Adding them mixes two different units.

  • “Experiments show the algorithm performs best when you set k to a small value, such as 60.”

    Microsoft, Azure AI Search docs

RRF avoids the scales by using position only. A result earns 1 divided by (its rank plus k) for each list it appears in, and the points are added. With k at 60, rank 1 earns about 0.0164 and rank 2 about 0.0161.

Python
# A returns bot's search: a keyword list and a vector list, merged with Reciprocal Rank Fusion (RRF).
K = 60  # RRF's constant; Microsoft's docs say small values such as 60 work best.

keyword = ["KX-4410-B manual", "Returns policy: damaged goods", "Kettle spare parts", "KX-4410 warranty"]
vector = ["Returns policy: damaged goods", "Kettle lid damage guide", "KX-4410-B manual", "Appliance warranty terms"]

def rrf(*ranked_lists):
    scores = {}
    for ranked in ranked_lists:
        for rank, doc in enumerate(ranked, start=1):
            scores[doc] = scores.get(doc, 0) + 1 / (K + rank)
    return sorted(scores.items(), key=lambda item: item[1], reverse=True)

for doc, score in rrf(keyword, vector):
    print(f"{score:.4f}  {doc}")

Output

0.0325  Returns policy: damaged goods
0.0323  KX-4410-B manual
0.0161  Kettle lid damage guide
0.0159  Kettle spare parts
0.0156  KX-4410 warranty
0.0156  Appliance warranty terms

In the output, the returns policy comes first by a small margin. It ranks second on keywords and first on vectors. The exact manual ranks first on keywords but third on vectors. So a page that both searches rank well moves to the top.

How much does it help, and what does it cost?

The evidence supports trying it, but the result depends on your data. BEIR, a 2021 benchmark of 18 public datasets, found plain BM25 a solid starting point. It also noted that dense and sparse models are more efficient but often underperform other approaches.

Anthropic's September 2024 test combined contextual embeddings with contextual BM25 and cut the top-20 retrieval failure rate from 5.7% to 2.9%, a 49% drop. Their method also added a short context note to every chunk before indexing, so the 49% does not show what hybrid search alone would do, and your system may differ.

The costs are real. You store text and vectors for each chunk, run two searches for every question, and tune how the lists are weighted. Microsoft lets you weight the vector side up or down, which is a setting to test on your own questions.

How would you tune hybrid search for a returns bot?

I would start with about 200 real customer messages, each with the right page labelled. For each one I would check whether the right page lands in the top five. I would measure three setups: keyword only, vector only and hybrid.

If keyword only wins on the model-number messages, I would raise the keyword side's weight for those. If vector only wins on plain-language messages, I would raise the vector side there. The test set decides which way to lean.

What does the interviewer want to hear?

A strong answer covers

  • Two searches, keyword and vector, run on the same question.
  • Keyword search wins on exact codes; vector search wins on meaning.
  • The two lists merge with RRF, which uses positions, not raw scores.
  • Raw scores sit on different scales, so adding them is the wrong merge.
  • Hybrid is a design to test on real questions, and it has a cost.

Common traps

  • Trap"Hybrid search just averages the two scores."

    BetterThe scores use different scales. RRF merges by rank position instead.

  • Trap"Hybrid search always beats vector search alone."

    BetterIt can help on mixed questions, but it has a cost. Measure it on your own questions before you claim a win.

  • Trap"Vector search has replaced keyword search."

    BetterKeyword search still does better on exact codes, names and dates.

Can you spot the right fix?

Spot the fix

A returns bot's vector-only search skips the manual for model KX-4410-B. Which change is most likely to fix that?

Quick check

Why does Reciprocal Rank Fusion use positions instead of raw scores?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q124What is BM25?12 min
  2. Q125What is reciprocal rank fusion?Coming soon
  3. Q126Rerankers: cross-encoder vs bi-encoder?12 min
  4. Q117What is a vector database?12 min
  5. Q112Walk through a RAG pipeline end to end.12 min
  6. Q113What is chunking, and why does size matter?13 min

Learn it in depth

Last updated on 26 November 2026

Building search over your company's documents?

I design and build AI products and agents, including the interface and the system behind them. Book a short call and tell me what your search needs to find.