StoryboardAI Engineering

Hybrid search

Searching by meaning and by exact words at the same time, then merging the results.

What is hybrid search?

Meaning search finds text on the same subject even when the wording differs. Its weakness is exact strings: error codes, product numbers, names. To it, E-417 and E-418 look almost identical.

Keyword search is the opposite. It finds exact strings perfectly and misses anything phrased differently.

Since they fail in different places, products run both and merge the two result lists. The combined list is more likely to contain the right text than either one alone.

Two kinds of search with opposite strengths.Search by meaning: Finds the right topic; Copes with different wording; Misses codes and names. Search by exact word: Finds codes, names, numbers; Misses different wording; Run both and merge the lists.Search by meaningFinds the right topicCopes with different wordingMisses codes and namesSearch by exact wordFinds codes, names, numbersMisses different wordingRun both and merge the lists
Two kinds of search with opposite strengths.

Why does hybrid search matter?

Search by meaning is good at topics and bad at exact strings. A product code, a form number or a person's name carries no meaning to an embedding model, so the one chunk that mentions it is missed. Search by exact word has the opposite strengths. Running both covers the weaknesses of each.

How does hybrid search work?

  1. Two indexes are built from the same chunks: one stores them by meaning, the other lists every word and the chunks containing it.
  2. A question is sent to both at the same moment.
  3. Each returns its own ranked list of chunks.
  4. The two lists are merged: a chunk near the top of either list goes near the top of the result.

When should you use hybrid search?

Use it when

  • Questions mention codes, names, numbers or rare terms
  • Your documents use specialised vocabulary
  • Meaning search alone keeps missing obvious matches

Think twice when

  • Questions are always general and conversational
  • The collection is tiny and one search already finds everything

Where does hybrid search sit in a real system?

It replaces the single search step in retrieval. The two indexes are kept side by side and updated together whenever a document changes.

What goes wrong with hybrid search?

  • Assuming both searches run on the same index. They need two different kinds.
  • Updating one index and forgetting the other.
  • Merging by raw scores, which are not on the same scale. Merge by rank.

What does hybrid search look like in practice?

A member asks "What does form T-14 ask for?". Meaning search returns general chunks about forms. Word search returns the one chunk containing "T-14". Merged, that chunk comes first, and the answer is right.

Watch it happen

These stories show hybrid search at work, one step at a time.