Claude Search-Result Blocks: Give First-Party RAG the Same Citation Contract as Web Search
Return first-party RAG evidence to Claude as search_result blocks with stable source IDs, accurate titles, citable chunks, validation, and stale-source handling.
Direct answer: Anthropic’s search_result content block gives custom retrieval a native citation contract: each result needs a stable source, descriptive title, and an array of text blocks. The application can enable citations so Claude links answer passages back to those supplied results instead of receiving one unattributed context dump.
The application supplies and vouches for the metadata and content. A rendered citation proves that the response referenced a supplied result; it does not prove the result is authoritative, current, permitted for the user, or sufficient to support the claim.
Normalize retrieval before generation
Normalize every hit into a source ID, canonical destination, current title, chunk text, document version, chunk locator, retrieval time, rank, score type, and access decision. Keep retrieval metadata outside the visible title when it would confuse the reader, but preserve it in the run artifact.
Break long documents into coherent blocks rather than arbitrary character slices. The block index becomes part of the citation location, so one heading-plus-paragraph unit is usually easier to verify than a mixture of unrelated sections.
| Field | Application rule | Why it matters |
|---|---|---|
| source | Stable canonical URL or internal ID | Citation can be resolved later |
| title | Accurate and specific | Readers can identify the evidence |
| content | Logical text blocks | Citation ranges stay precise |
| policy | User and timestamp checked before return | Prevents stale or unauthorized evidence |
Validate the block contract
Reject a result with missing source, empty title, non-text content, invalid destination, or content that cannot be shown to the current user. Anthropic documents all-or-nothing citation settings across the supplied results in a request; mixing enabled and disabled states is an error.
Tool-result arrays containing search results cannot mix in unrelated block types. Represent an empty or failed internal search explicitly and let the application distinguish no result, permission denial, retrieval error, and downstream model behavior.
{\n "type": "search_result",\n "source": "kb://article-1234",\n "title": "Canonical product guide",\n "content": [{"type": "text", "text": "..."}],\n "citations": {"enabled": true}\n}Handle duplicates, staleness, and access
Deduplicate by canonical identity and content version, but preserve meaningful independent sources. A mirrored copy should not inflate evidence diversity. If two chunks disagree, return both with clear titles and versions rather than merging the contradiction into one synthetic passage.
Run authorization immediately before the result enters the request, not only at indexing time. Internal identifiers should not leak private paths or tenancy. On deletion or canonical change, keep a tombstone or resolution record so old evaluation artifacts remain understandable.
Audit the answer and citation together
For each important answer sentence, open the cited result, inspect the cited block range, and classify support as verified, qualified, unsupported, or ambiguous. Also record material retrieved evidence the answer ignored and uncited claims that appeared in the prose.
Test citation behavior with known fixtures, duplicate sources, stale canonicals, conflicting passages, empty results, access denial, and long blocks. A high citation count is not the goal; the goal is a resolvable evidence trail that survives skeptical review.
Use the citation audit for claim-by-claim review and the source-bounded brief workflow before generation.
Ask a question or join the discussion