Retrieval Strategy Matching
Options (verified features, design guidance on choice)
| Strategy | How | Strengths | Weaknesses |
|---|---|---|---|
| Long context | Put the documents in the prompt (windows up to 1M tokens) | Simple, no retrieval misses, cache-friendly | Context rot, cost per request, size limits |
| RAG with embeddings | Embed chunks, retrieve top results, pass them in | Scales to large corpora, cheap per query | Chunking and recall errors; extra infrastructure |
| Agentic search | Give the model tools (Grep, Glob, search APIs) and let it explore | Adapts to the question; good for code and structured stores | More turns, latency, cost; needs good tools |
| Tool-based lookup | Query systems of record (SQL, REST, MCP) | Fresh, authoritative, permission-aware | Requires well-designed tools and error handling |
| Memory | Memory tool or state files | Persists across sessions | You 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 need | Lean toward |
|---|---|
| Small, stable corpus; accuracy over cost | Long context (cached) |
| Large corpus of documents, fuzzy questions | RAG, possibly with reranking and citations |
| Source code or file trees | Agentic search with Grep/Glob, subagents for exploration |
| Live, structured, authoritative data | Tool or MCP lookup |
| Frequently changing data | Retrieval at query time, not baked into prompts |
| Per-user permissions | Retrieval 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
- Embeddings — checked Oct 16, 2026
- Search results — checked Oct 16, 2026
- Citations — checked Oct 16, 2026
- Reduce hallucinations — checked Oct 16, 2026
Check your understanding
A 40-page policy used by thousands of queries. Strategy?Show answerHide answer
Answer
Long context with prompt caching.Who supplies embeddings in the Anthropic ecosystem?Show answerHide answer
Answer
Third parties such as Voyage AI; Anthropic has no embedding model.How do you make RAG answers attributable?Show answerHide answer
Answer
Pass results as search-result blocks with citations enabled.