Implementations and notes from the Anthropic cookbook, restructured with bug fixes and deeper analysis.
| Folder | Topic | Reference |
|---|---|---|
multi_doc_agents/ |
Multi-document agents with LlamaIndex — query routing across multiple doc indexes | cookbook |
tool_search_embeddings/ |
Semantic tool search with embeddings — find relevant tools via cosine similarity instead of passing all tools to the model | cookbook |
context_compaction/ |
Context compaction — manage long conversations by summarizing history when context fills up (API-level, manual, and background threading approaches) | cookbook 1, cookbook 2 |
programmatic_tool_calling/ |
Programmatic Tool Calling (PTC) — Claude writes Python scripts that call tools in a sandbox, keeping raw data out of context | cookbook |
uv sync
export ANTHROPIC_API_KEY=sk-...Each folder has its own README with usage instructions.