# Retrieval Strategy Matching

> Retrieval strategy matching is the decision of which retrieval method fits the data shape and the query pattern: lexical search for exact identifiers and rare terms, semantic search for paraphrased questions, hybrid when both kinds of query arrive, and reranking only when a measured gain justifies the added latency and cost.

**Domain:** CCARP-D3 · Integration (19% of the CCA-P exam)
**Canonical:** https://claudearchitectcertification.com/concepts/retrieval-strategy-matching
**Last reviewed:** 2026-10-16

## Quick stats

- **Retrieval methods compared:** 3
- **Optional extra stage:** Reranking
- **Exam objective:** CCARP-D3-O6
- **Exam domain:** CCARP-D3

## The decision

Pick the retrieval method by the query pattern and the data shape: lexical for exact identifiers, semantic for paraphrase, hybrid when both arrive. Add reranking only after measurement shows its gain is worth its latency and cost.

**Learner decision:** Which retrieval method does this query mix need, and does reranking earn its cost on your own queries?

## What it is

A retrieval-augmented system finds passages for the model to read. The architect's decision is not whether to retrieve but which method to retrieve with, because each method fails on a different kind of query. Lexical search (BM25 and similar) matches the exact tokens in the query. Semantic search compares embeddings, so it matches meaning even when the words differ. Hybrid retrieval runs both and merges the ranked lists.

The choice is driven by two facts the architect can inspect: the shape of the data (identifier-heavy records, long prose, tables) and the pattern of the queries (a ticket number, a product code, or a loosely worded question). Matching the method to those two facts is the objective this page teaches.

## How it works

An exact identifier query favors lexical search. A query such as an error code or an order number has no paraphrase. An embedding may place a different code close by, while a lexical match returns the passage that contains the exact string. Anthropic's contextual retrieval write-up makes this point with an error-code example.

A paraphrased question favors semantic search. When the user describes a problem in their own words, the passage that answers it may share no keywords with the query. Embeddings bridge that vocabulary gap, and lexical search alone misses the passage.

Mixed traffic favors hybrid retrieval. If both query types arrive, run both retrievers and merge the ranked results, for example with rank fusion, then deduplicate. The cost is a second index to build and keep fresh.

Reranking is an optional second stage, not a default. A reranker re-scores the merged top candidates with a stronger model before the final few passages reach Claude. It can raise precision, and it adds a model call to every query, so adopt it only after measuring that the gain on your own queries outweighs the latency and cost.

## Diagram

*Decision sketch: Query pattern to retrieval method*

1. **Classify the query.** Identifier or exact term, paraphrased question, or a mix of both.
2. **Choose the retriever.** Lexical for identifiers, semantic for paraphrase, hybrid for mixed traffic.
3. **Merge and deduplicate.** For hybrid, fuse the two ranked lists and drop repeated passages.
4. **Measure before reranking.** Add a reranker only if recall at the cut-off improves enough to pay for its latency and cost.

## Exam trap

Treating semantic search as strictly better because it understands meaning. An exact identifier can be missed or outranked by a merely similar passage, and reranking everything adds latency without a measured benefit. The correct answer names the query pattern first and picks the method that fits it.

## Worked example: sorting a query log into a retrieval design

*Authored teaching example, not a bank question.*

An internal help assistant searches support notes. Users type ticket codes such as an error identifier, and they also describe problems in their own words. The first build uses embeddings only.

1. **Sample real queries.** Pull a representative sample of queries and label each as identifier, paraphrased question or mixed. The mix of labels, not intuition, drives the design.
2. **Test the identifier queries.** For a query that is an exact code, check whether the note containing that code is retrieved. Anthropic's write-up shows this failure: an embedding model can return general error-code content and miss the exact identifier, which lexical matching finds.
3. **Test the paraphrased queries.** For a loosely worded problem, check whether a lexical-only index retrieves the right note when it shares few words with the query. Embeddings bridge that vocabulary gap.
4. **Choose.** Both kinds arrive, so run lexical and semantic retrieval and combine the ranked lists with rank fusion, then remove duplicates.
5. **Evaluate reranking last.** Measure recall at your cut-off with and without a reranker on the labelled sample. Anthropic reports that reranking adds a runtime step and so adds latency, so keep it only if the measured gain pays for that.

| Query in the log | Label | Method that retrieves it | Why |
| --- | --- | --- | --- |
| An error code typed verbatim | Identifier | Lexical | The answer note contains the exact string |
| 'Why do my reports stop loading overnight?' | Paraphrased | Semantic | The answer shares few words with the question |
| A code plus a description of the symptom | Mixed | Hybrid | One signal needs the string, one needs meaning |

The design is hybrid retrieval, with reranking adopted or rejected by measurement on this team's own queries. Check afterwards that the labelled sample includes both query types and that the result is re-run when the data or the query mix changes.

## Failure modes

### Semantic-only retrieval for identifier-heavy data

- **Looks right:** Embeddings understand meaning, so they should beat keyword search everywhere.
- **Why it fails:** An exact code or part number has no paraphrase. The embedding may rank a merely similar passage above the one containing the exact string.
- **Instead:** Add lexical retrieval for identifier queries, or use hybrid retrieval with rank fusion when both query types arrive.

### Irrelevant semantic matches on rare terms

- **Looks right:** The top result is topically close to the query, so it looks right.
- **Why it fails:** Topical closeness is not the same as containing the needed fact. Claude then reads a plausible but wrong passage and answers from it.
- **Instead:** Check retrieved passages against labelled queries, and let a lexical signal vote on exact terms.

### Reranking everything without a measured benefit

- **Looks right:** A reranker usually improves ordering, so add it to every query.
- **Why it fails:** It adds a model step to every request. If recall at your cut-off barely moves, you pay more latency and cost for nothing.
- **Instead:** Measure the gain on your own labelled queries first, and keep the reranker only if it clears a threshold you set in advance.

## How each certification frames it

### CCA-P: How CCA-P tests retrieval strategy

Objectives: `CCARP-D3-O6`

The Professional guide lists applying retrieval strategies matched to data shape and query pattern (PDF page 5, Domain 3). It sits beside, and is separate from, designing a RAG pipeline with chunking and indexing strategies.

Keep the end-to-end document-processing walkthrough on the long-document-processing scenario. This page owns only the choice of retrieval method by query type.

## Where you'll see it in production

### Support knowledge base

Agents paste ticket numbers and also describe symptoms in plain words. Hybrid retrieval serves both without forcing users to choose a search mode.

### Compliance document search

Clause numbers need exact matching while policy questions need semantic matching, so the retriever combines both signals.

## Comparison

| Method | Strong when | Weak when | Cost to add |
| --- | --- | --- | --- |
| Lexical (BM25) | Exact identifiers, rare terms, codes | The query is paraphrased | Low, a keyword index |
| Semantic (embeddings) | Paraphrased or conceptual questions | The query hinges on an exact string | Embedding model plus a vector index |
| Hybrid | Both query types arrive | Only one type ever arrives | Both indexes plus a merge step |
| Reranking | Top candidates are noisy | Latency budget is tight, gain unmeasured | An extra model call per query |

## Decision tree

1. **Do queries contain exact identifiers such as error codes or order numbers?**
   - **Yes:** Include lexical retrieval so the exact string can match.
   - **No:** Lexical search is optional for this workload.

2. **Do users also ask loosely worded questions that share few keywords with the answer?**
   - **Yes:** Include semantic retrieval to bridge the vocabulary gap.
   - **No:** A lexical index may be enough.

3. **Do both kinds of query arrive in the same system?**
   - **Yes:** Run hybrid retrieval and merge the ranked lists.
   - **No:** Use the single method that matches your queries.

4. **Is the merged top list still noisy and is there latency and cost budget to spend?**
   - **Yes:** Evaluate a reranker on real queries and keep it only if the measured gain justifies it.
   - **No:** Skip reranking.

## Exam-pattern questions

### Q1. Support agents search internal notes by ticket number and by loosely described symptoms. Which retrieval design fits?

Hybrid retrieval. The ticket number needs an exact lexical match and the symptom description needs semantic matching, so the system runs both and merges the results.

### Q2. A team adds a reranker to every query and sees higher latency but no change in answer quality. What was skipped?

Measuring the gain on real queries before adopting the reranker. Reranking is justified only when the measured improvement outweighs its latency and cost.

## FAQ

### Q1. What is retrieval strategy matching?

It is choosing lexical, semantic or hybrid retrieval, and deciding whether to rerank, according to the data shape and the query pattern of the system.

### Q2. When is lexical search better than semantic search?

When the query contains an exact identifier or rare term, such as an error code, that the answer passage must contain verbatim.

### Q3. Is reranking always worth adding?

No. A reranker adds a model call to every query, so keep it only when measurement on your own queries shows a gain that justifies the latency and cost.

### Q4. How do I decide between lexical, semantic and hybrid retrieval?

Label a sample of real queries as identifier, paraphrased or mixed. Identifier queries need lexical matching, paraphrased queries need semantic matching, and a mix of both calls for hybrid retrieval with rank fusion.

### Q5. When can a system skip retrieval entirely?

Anthropic's contextual retrieval article notes that a knowledge base smaller than about 200,000 tokens can be placed in the prompt instead of using retrieval, and that prompt caching makes that approach faster and cheaper. Check your own size and cost before choosing.

## Sources and next steps

- [Claude Certified Architect - Professional Exam Guide v1.0 (July 2026), PDF page 5](https://claudearchitectcertification.com/exam-guide/ccar-p), section: Domain 3: Integration and Domain 4: Evaluation, Testing & Optimization, detailed objectives. Checked 2026-10-16.
- [Contextual Retrieval (Anthropic engineering)](https://www.anthropic.com/engineering/contextual-retrieval), section: Embeddings and BM25; Reranking. Checked 2026-10-16.

- [CCA-P exam guide: Domain 3, Integration](https://claudearchitectcertification.com/exam-guide/ccar-p)
- [Scenario: long document processing](https://claudearchitectcertification.com/scenarios/long-document-processing)
- [Progressive discovery vs monolithic context](https://claudearchitectcertification.com/concepts/progressive-disclosure-vs-monolithic-context)
- [Accuracy, latency and cost trade-offs](https://claudearchitectcertification.com/concepts/accuracy-latency-cost-tradeoffs)

---

**Source:** https://claudearchitectcertification.com/concepts/retrieval-strategy-matching
**Last reviewed:** 2026-10-16

**Evidence tiers**, 🟢 official Anthropic doc / API contract · 🟡 partial doc / inferred · 🟠 community-derived · 🔴 disputed.
