Glossary

Hybrid Search

Hybrid search combines keyword search (like BM25) with vector search in one query, then merges the results — catching both exact matches and semantic matches.

Hybrid search is a retrieval strategy that runs a keyword search and a vector (semantic) search in parallel, then merges the two ranked lists into one — capturing exact-term matches that embeddings miss and meaning matches that keywords miss.

Neither search paradigm is sufficient alone. Keyword engines like BM25 are ruthless about exact terms: search for error code "ERR_5031" or a part number and they nail it, but ask "why can't users log in" and they miss a document titled "authentication failures." Vector search is the mirror image: brilliant at meaning, embarrassingly bad at rare identifiers, product SKUs, and proper nouns, because an embedding model has no reason to encode "ERR_5031" distinctly. Hybrid search refuses to choose.

How it works

At query time, the system fires the same query down two paths. The lexical path scores documents with BM25 — a battle-tested formula rewarding rare terms that appear often in a document but seldom in the corpus. The semantic path embeds the query and finds the nearest chunk vectors by cosine similarity.

Now you hold two ranked lists with incompatible scores — BM25 values are unbounded, cosine similarities sit between -1 and 1. You cannot just add them. The standard fix is reciprocal rank fusion (RRF), which ignores raw scores entirely and combines results by rank position. Some systems instead normalize scores and take a weighted blend, and many add a final reranking stage: a cross-encoder model rescores the top candidates against the query for a sharper final ordering.

Why it matters

In production retrieval — the R in RAG — hybrid search is close to a default. Real user queries are messy mixtures: half natural language, half jargon, error codes, and names. A support bot that misses the document containing the exact error string the user pasted is useless, and so is one that only matches keywords and misses paraphrases. Retrieval quality is the ceiling on RAG quality; hybrid search raises that ceiling cheaply, with no model training required.

A worked example

Query: "Payment webhook failing with ERR_5031 after the checkout redesign."

  • BM25 top hit: the runbook page containing the literal string ERR_5031 — a document vector search ranked 14th, because embedding models treat rare codes as noise.
  • Vector search top hit: a postmortem titled "Checkout revamp broke payment callbacks" — which BM25 ranked poorly, since it shares almost no keywords with the query.

Fuse the two lists with RRF and both documents land in the top three. The RAG answer now cites the exact error's fix and the incident that caused it. Either search alone would have delivered half an answer.

How Miatz teaches it

Hybrid search appears in the retrieval track of the Miatz curriculum: learners build a BM25 index and a vector index over the same corpus, run failure-case queries against each, and only then fuse them — feeling each method break before learning the repair. The comparison drills use real documentation corpora, and the results feed straight into the RAG lab.

Learn it by doing it.

Miatz turns definitions into judgment — the free founding cohort trains you on exactly these concepts, hands-on.