glossary

Context and retrieval

Hybrid search

Hybrid search runs a keyword ranking and a vector ranking on the same corpus, then merges the two lists, often by reciprocal rank fusion, so exact codes and paraphrased meanings can both reach the top.

Abracadabra Team Glossary

How it works

Two rankings run over the same documents. The keyword ranking scores token overlap, which is reliable for catalogue numbers, error codes and rare names. The vector ranking scores embedding closeness, which finds a passage that shares the meaning and not the words. Each list is incomplete in a different way. Hybrid search is the decision to keep both and merge them, rather than hoping one ranker covers the questions the other drops.

Reciprocal rank fusion is one such merge, and it can be described without a formula. A document near the top of a list contributes more than a document far down that list. The keyword list and the vector list each contribute on their own. Those contributions are added, and the documents are sorted by the sum. A hit that is only strong on one list can still rise. A document that is merely decent on both is not thrown out because its raw score on one side looked weak. Weights and cutoffs still exist, but the merge itself is about rank position, not about mixing the incompatible raw scores.

A worked example

A stain name and a catalogue number in one list

A hospital laboratory stocks stains and reagents. A scientist types "stain for gram negative rods" and also pastes the catalogue number from a nearly empty bottle. The keyword list puts that exact catalogue number first and knows nothing about the paraphrase. The vector list puts a description of a Gram stain kit first and has buried the catalogue number because the query's extra words pulled it towards similar kits. Fusion adds a strong contribution from the top of each list. The exact bottle and the Gram stain description both sit above a pile of loosely related dyes. The scientist sees the SKU they already held and the kit that matches the words they did not have a code for.

Illustrative example, not a production trace and not a measured result.

What goes wrong

  • The merge is tuned so loosely that many semantic neighbours outrank a perfect keyword hit on an exact error code, and the code the person typed is below the cutoff.
  • Both lists miss because the chunk split the catalogue number from the sentence that says what the reagent is for, so fusion has no good candidate to promote.
  • The keyword index covers only the SKU field, while people search the trade name printed on the bottle, and the vector list is left to guess at a string it was not shown.

How to measure it

Split test questions into exact-code queries and paraphrase queries. For each, record the keyword rank, the vector rank, and the rank after the merge, plus whether the accepted item survived the cutoff.

When a person repeats a code that the first screen did not show, treat that as a fusion or cutoff miss if the keyword list had it. After you change the merge, compare task success for that task and cohort.

How Abracadabra helps

Repeating an exact code after a screen full of similar descriptions means the keyword hit lost the merge. After the fusion or the cutoff changes, compare task success for that task and cohort.

When context is lost, people restate a fact or repeat the request. Abracadabra pins those corrections and repeated intents to the turn. After a change to what the agent keeps, compare task success for that task and cohort with the previous period.

Request access to read this on your own agent.

See it in your own agent's conversations.

Each task, the step where it stops, and the conversations behind every count. Free during early access.