Skip to content
Claude Certified Architect – Professional (CCAR-P) Exam Prep

Lesson 17 of 31 · 7 min

x
17/31

Retrieval Strategy Matching

Video lesson: CCAR-P 17/31: Retrieval Strategy Matching

Options (verified features, design guidance on choice)

StrategyHowStrengthsWeaknesses
Long contextPut the documents in the prompt (windows up to 1M tokens)Simple, no retrieval misses, cache-friendlyContext rot, cost per request, size limits
RAG with embeddingsEmbed chunks, retrieve top results, pass them inScales to large corpora, cheap per queryChunking and recall errors; extra infrastructure
Agentic searchGive the model tools (Grep, Glob, search APIs) and let it exploreAdapts to the question; good for code and structured storesMore turns, latency, cost; needs good tools
Tool-based lookupQuery systems of record (SQL, REST, MCP)Fresh, authoritative, permission-awareRequires well-designed tools and error handling
MemoryMemory tool or state filesPersists across sessionsYou build and secure the store

Facts to anchor on (verified): Anthropic does not offer its own embedding model; its docs point to Voyage AI as one provider and advise evaluating several. Search result blocks (type: "search_result" with source, title, content) let your RAG results carry attribution so Claude can cite them; all active models support this (except Haiku 3). Citations return exact supporting passages; they cannot be combined with structured outputs (5.6).

Matching strategy to the problem (design guidance)

Data and needLean toward
Small, stable corpus; accuracy over costLong context (cached)
Large corpus of documents, fuzzy questionsRAG, possibly with reranking and citations
Source code or file treesAgentic search with Grep/Glob, subagents for exploration
Live, structured, authoritative dataTool or MCP lookup
Frequently changing dataRetrieval at query time, not baked into prompts
Per-user permissionsRetrieval that enforces the caller's access

Hybrids are common: embeddings to shortlist, an agent to read and verify.

Evaluate retrieval separately

Measure recall (is the needed passage in the retrieved set?) and precision before blaming the model; many "hallucinations" are retrieval misses. Evaluate end to end with an answer-quality set (D4.1).

Grounding

Allow "I don't know"; for long documents extract word-for-word quotes first; verify claims with citations; if no supporting quote is found, retract the claim.

Exam traps

  • RAG by default when the corpus fits in context.
  • Stuffing everything into a huge prompt regardless of rot and cost.
  • Ignoring user permissions at retrieval time.
  • Assuming Anthropic provides embeddings.
  • No retrieval evaluation.

References

  1. Embeddings — checked Oct 16, 2026
  2. Search results — checked Oct 16, 2026
  3. Citations — checked Oct 16, 2026
  4. Reduce hallucinations — checked Oct 16, 2026

Check your understanding

  • A 40-page policy used by thousands of queries. Strategy?Show answer

    Answer

    Long context with prompt caching.
  • Who supplies embeddings in the Anthropic ecosystem?Show answer

    Answer

    Third parties such as Voyage AI; Anthropic has no embedding model.
  • How do you make RAG answers attributable?Show answer

    Answer

    Pass results as search-result blocks with citations enabled.
Previous

Progress is saved in this browser.

Next Lesson