Open Agent School · Public worked example

Hybrid Search: meaning and example

Welcome! Take one idea with you today.

Hybrid search runs two kinds of retrieval and merges the results. Lexical search such as BM25 (a classic formula that rewards matching words, especially rare ones) is excellent for part codes and names. Dense vector search compares embeddings (lists of numbers that place similar meanings near each other) and finds paraphrases. Reciprocal rank fusion (RRF) merges the two lists using rank positions.

Picture it: An invented bike shop indexes six synthetic manual passages. A rider asks about brake pads with part code 7Q that squeal and feel weak in wet weather. One passage contains the exact code; another describes weak stopping after rain without sharing the rider's words. Plan how to rank both near the top.

What is easy to mix up?

The scores measure different things on different scales. Use rank-based fusion such as RRF, or normalize scores carefully and validate the weights on labeled queries.

Teaching example by Open Agent School. Source: Elastic docs - Reciprocal rank fusion (RRF) formula and retriever.