Prompts2026年3月31日·1 分钟阅读

Anthropic Cookbook — Official Claude Recipes

Official collection of notebooks and recipes for building with Claude. Prompt engineering, tool use, RAG, agents, multimodal, and enterprise patterns. By Anthropic. 37K+ stars.

TO
TokRepo精选 · Community
快速使用

先拿来用,再决定要不要深挖

这里应该同时让用户和 Agent 知道第一步该复制什么、安装什么、落到哪里。

git clone https://github.com/anthropics/anthropic-cookbook.git
cd anthropic-cookbook
pip install anthropic

Browse recipes in Jupyter notebooks. Each is self-contained with explanations and runnable code.


介绍

The Anthropic Cookbook is the official collection of recipes and notebooks for building applications with Claude. Covers prompt engineering patterns, tool use, RAG pipelines, multi-agent workflows, multimodal inputs, structured outputs, and enterprise integration patterns. Written by the Anthropic team with production-grade examples. 37,000+ GitHub stars, MIT licensed.

Best for: Developers building with Claude API who want proven patterns and best practices Works with: Claude (Sonnet, Opus, Haiku), Anthropic API, Claude Code


Recipe Categories

Prompt Engineering

  • System prompt design patterns
  • Chain-of-thought reasoning
  • Few-shot learning with examples
  • XML tag structuring for complex tasks

Tool Use & Function Calling

  • Defining and using tools
  • Multi-tool orchestration
  • Error handling and retries
  • Calculator, search, and custom tools

RAG (Retrieval-Augmented Generation)

  • Document ingestion and chunking
  • Contextual retrieval with embeddings
  • Citation generation
  • Multi-document Q&A

Agents

  • ReAct pattern implementation
  • Multi-step reasoning agents
  • Agent handoffs and delegation
  • Tool-augmented agents

Multimodal

  • Image analysis and description
  • PDF document processing
  • Chart and graph understanding
  • Multi-image comparison

Enterprise Patterns

  • Content moderation and guardrails
  • Structured data extraction
  • Classification and routing
  • Batch processing pipelines

FAQ

Q: What is the Anthropic Cookbook? A: The official collection of 50+ notebooks and recipes by Anthropic for building with Claude. Covers prompt engineering, tool use, RAG, agents, and multimodal patterns. 37K+ stars.

Q: Do I need a paid API key? A: Yes, you need an Anthropic API key. Most recipes work with Claude Sonnet for cost-effective experimentation.


🙏

来源与感谢

Created by Anthropic. Licensed under MIT. anthropics/anthropic-cookbook — 37,000+ GitHub stars

相关资产