Agent Wealth HubFree public resources
中文 EN العربية

Back to catalog / Retrieval

Answer internal knowledge questions from retrieved chunks

Chunk internal documents by heading, retrieve multiple relevant passages, then synthesize with source locations.

Goal

Build traceable retrieval-augmented Q&A over an authorized document set.

Steps

  1. Chunk documents by heading as in the notebook, retaining heading, text, and source-link metadata. [rag]
  2. Embed with Voyage Client.embed(...), retrieve top-k by cosine similarity, and pass only those chunks to Claude. [rag]
  3. Require answers to rely only on <document> evidence and list sources; report insufficient evidence rather than guess. [rag]

How to verify

Check source coverage and answer correctness on a multi-chunk evaluation set, saving retrieval and end-to-end scores separately.

Troubleshooting

If a key chunk is missed, inspect boundaries, top-k, and embedding version; do not let the answer layer fabricate links.

Permissions

Prerequisites

Permissions

Limitations

The example vector store is an in-memory/local pickle demo, not production storage; enforce document ACLs before retrieval.

Pinned upstream source

https://github.com/anthropics/anthropic-cookbook/blob/9c1e493ddd2b82df399d2a61b9c806c539e18be6/capabilities/retrieval_augmented_generation/guide.ipynb

Repository
anthropics/anthropic-cookbook
File path
capabilities/retrieval_augmented_generation/guide.ipynb
Pinned commit
9c1e493ddd2b82df399d2a61b9c806c539e18be6
Source checked
2026-10-14 · Reviewed against the pinned upstream source

Repository metrics

These values describe the upstream repository, not popularity or likes for an individual skill or playbook.

Stars
Not collected
Forks
Not collected
Observed at
Not collected

No metrics snapshot is available yet.

License: MIT

Main topic

Turn ecommerce campaign materials into a reviewable weekly brief

Related resources