Claude Official Cookbooks: Engineering Recipes from RAG to Multimodal Agents
Anthropic's official collection of practical coding recipes for building with Claude. It provides runnable Jupyter notebooks covering capabilities like classification, summarization, and RAG, alongside advanced techniques such as tool use, multimodal vision, and sub-agent orchestration. The latest additions introduce the Claude Agent SDK and Managed Agents, demonstrating how to build observable, hostable agents—from research assistants to SRE bots—with just a few lines of code.
The Claude Cookbooks is Anthropic's official collection of runnable Jupyter notebooks and code recipes. It shows developers how to build with Claude through real, copy-paste-able examples—covering everything from basic text capabilities and RAG to multimodal agents, tool use, and the new Claude Agent SDK. If you're looking for “how do I actually do X with Claude,” this is the first place to check.
Claude Cookbooks 是 Anthropic 官方维护的一组可运行的 Jupyter Notebook 与代码「食谱」,专门给开发者展示“怎么用 Claude 实际做事”。它以可直接复制的代码片段为核心,覆盖文本分类、RAG、摘要、多模态理解、工具调用,以及最新的 Claude Agent SDK 等方向。如果你想找“这件事用 Claude 到底怎么写”,这里就是最权威的起手式。
Most developers quickly realize that a capable LLM alone doesn't solve real-world needs: you need structured outputs, tool integrations, RAG pipelines, vision processing, and reliable agents. These recipes fill that gap. Instead of just explaining concepts, they provide end-to-end workflows—connecting to databases, calling external APIs, parsing PDFs, orchestrating sub-agents—so you can move past proof-of-concept and into production.
多数开发者很快会发现,光有一个强大的 LLM 还不够:你需要结构化的输出、工具集成、RAG 流水线、多模态理解、可靠的 agent 行为。这个仓库的意义就在于“补齐拼图”:不是只讲概念,而是给出端到端的工程流程——连数据库、调外部 API、解析 PDF、编排子 agent——让你能从 PoC 直接走向生产。
The cookbooks are organized by use-case rather than by API endpoint. Key areas include: 1) Capabilities — classification, summarization, text-to-SQL, knowledge graphs. 2) Multimodal — image understanding, chart reading, form transcription. 3) Tool Use & Integration — function calling, calculator tools, SQL query generation. 4) Third-Party — Pinecone vector search, Voyage AI embeddings, Wikipedia/URL fetching. 5) Advanced Techniques — JSON mode, prompt caching, moderation filters, sub-agent patterns. 6) Claude Agent SDK — an entirely new section with seven dedicated notebooks for building hosted, observable agents.
所有示例按实际用途而非 API 端点组织,核心板块包括:1) 基础能力——分类、摘要、Text-to-SQL、知识图谱;2) 多模态——图像理解、图表解读、表单转录;3) 工具调用与集成——函数调用、计算器工具、SQL 生成;4) 第三方集成——Pinecone 向量检索、Voyage AI 文本嵌入、Wikipedia/网页抓取;5) 进阶技巧——JSON 模式、Prompt 缓存、内容审核、子 agent 模式;6) Claude Agent SDK——全新板块,用 7 个专门的 Notebook 展示如何构建可托管、可观测的 agent。
The claude_agent_sdk directory is a major recent addition. It goes beyond simple function calling, showing production-ready agent patterns: a one-liner research agent, a chief-of-staff agent that coordinates multiple tools, an observability agent, a site-reliability agent, a vulnerability detection agent, and a session browser for reviewing past agent runs. There's even a migration guide from the OpenAI Agents SDK. Each notebook comes with its own utility modules and configuration, making the examples self-contained and deployable.
claude_agent_sdk 目录是仓库近期的重大更新,它不局限于简单的函数调用,而是展示了一套面向生产的 agent 模式。其中包括:一行代码启动的研究 agent、可协调多工具的“参谋长”agent、可观测性 agent、站点可靠性 agent、漏洞检测 agent,以及用于回顾 agent 运行记录的会话浏览器。此外还有一份从 OpenAI Agents SDK 迁移的指南。每个 Notebook 都自带独立的工具模块与配置,保证示例即开即用、可直接部署。
You'll need a Claude API key (free sign-up at anthropic.com) and Python. Most notebooks are self-contained Jupyter notebooks—clone the repo, install dependencies inside the specific example folder, and run. A good starting path for beginners is: Anthropic API Fundamentals course → Capabilities/Classification → Tool Use/Customer Service Agent. For advanced users, jump directly into claude_agent_sdk/00_The_one_liner_research_agent.ipynb to see a fully functional agent in a single cell.
你需要一个 Claude API 密钥(在 anthropic.com 免费注册)和 Python 环境。大多数示例都是自包含的 Jupyter Notebook——克隆仓库后,在具体示例目录里安装依赖即可运行。对新手来说,推荐路径是:先看 Anthropic API 基础课程,然后跑 Capabilities/Classification,再接上 Tool Use/Customer Service Agent。对有经验的开发者,可以直接跳进 claude_agent_sdk/00_The_one_liner_research_agent.ipynb,一个 Cell 就能看到完整跑起来的 agent。
This repository is best for engineering teams who have read the Claude API docs and want to quickly implement specific features. It answers “How,” not “What.” Keep in mind: 1) Examples prioritize clarity—they aren't necessarily production-hardened for performance or security. 2) Most code is Python, but patterns translate to other languages. 3) For API parameter details or model limits, you still need the official docs. Treat this not as a product or SaaS, but as an engineering guide with working code attached.
这个仓库最适合已经读过 Claude API 文档、想快速落地具体功能的工程团队。它解决的是 How 而非 What 的问题。需要注意:1) 示例代码以演示清晰优先,不一定直接符合生产环境性能或安全要求;2) 多数示例基于 Python,但核心逻辑可迁移到其他语言;3) 对于 API 参数细节或模型能力上限,仍需查阅 Anthropic 官方文档。不要把它当成完整的产品或 SaaS 方案,它是一本有代码的“工程指南”。