AITraining2U

Programs

Resources

Case Studies

Quick Links

Enquire Now
Domain 5 · 15%% of exam

Semantic, keyword and hybrid retrieval

Two retrieval methods with complementary blind spots, and why production uses both.

5 min read · Lesson 8 of 9 in this domain

Semantic search and keyword search fail in opposite directions, which is precisely why combining them works. Semantic retrieval matches on meaning, so it finds a passage about "employee departure procedure" when you searched for "offboarding" — but it is weak on exact tokens, and will happily return something conceptually adjacent when you needed error code E4021 specifically. Keyword retrieval such as BM25 matches on term overlap with term-frequency weighting, so it nails identifiers, product codes and rare exact strings — and misses every paraphrase. Hybrid retrieval runs both and fuses the rankings, which is the production default because real queries contain both kinds of need.

Key points
  • Semantic search matches meaning; strong on paraphrase, weak on exact tokens and rare identifiers.
  • BM25 is keyword ranking with term-frequency weighting; strong on exact strings, blind to synonyms.
  • Hybrid runs both and fuses the result lists — the usual production choice because queries mix both needs.
  • A reranker can reorder the fused candidates for precision, but it cannot surface anything retrieval failed to return.
  • Symptom to recognise: exact identifiers being missed points at pure-semantic retrieval; paraphrases being missed points at pure-keyword.
  • Retrieval is recall-first — get the right chunk into the candidate set, then let reranking sort precision.
Exam trap

Adding a reranker is offered as the fix for a recall problem. Reranking improves precision on what was already retrieved.

Check your understanding

Users search for error code E4021 and get conceptually similar but wrong passages. What is missing?

Correct answer: A — Keyword retrieval such as BM25 alongside the semantic search
Exact rare tokens are precisely where semantic matching is weakest, because the identifier carries little semantic signal. BM25 matches the literal term and is the complement that fixes it.

What can a reranker not do?

Correct answer: A — Surface a document that retrieval never returned
A reranker only reorders the candidate set it is given, so anything retrieval missed stays missed. That is why recall is the priority at the retrieval stage.

Practise this domain with 15%%-weighted questions in the study app.

Open in study app

Source: Claude Docs — Context windows · Independent study aid, not affiliated with or endorsed by Anthropic.