# anthropics/anthropic-cookbook

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/anthropics-anthropic-cookbook).**

45,984 stars · 5,405 forks · Jupyter Notebook · MIT

## Links

- GitHub: https://github.com/anthropics/anthropic-cookbook
- awesome-repositories: https://awesome-repositories.com/repository/anthropics-anthropic-cookbook.md

## Description

This repository is a collection of guides, notebooks, and recipes for implementing advanced prompting techniques and workflow patterns with large language models. It serves as a prompt engineering guide, an evaluation suite for scoring prompt quality, and a framework for orchestrating agents and integrating external tools.

The project provides implementation patterns for building applications with Claude, specifically focusing on coordinating multiple models to split complex tasks between high-reasoning and high-efficiency agents. It includes technical demonstrations for multimodal data processing, such as parsing PDF documents and analyzing visual information.

The codebase covers retrieval augmented generation through vector-based semantic retrieval and embeddings, as well as prompt optimization using prefix-based caching. It further addresses structured output enforcement via schema-constrained JSON and the integration of external functions through tool-call execution loops.

The content is delivered via interactive notebooks that combine executable code with documentation to demonstrate technical patterns and live outputs.

## Tags

### Artificial Intelligence & ML

- [Prompt Engineering](https://awesome-repositories.com/f/artificial-intelligence-ml/prompt-engineering.md) — Serves as a comprehensive guide for designing and refining prompts to optimize LLM performance.
- [Agent Orchestration Frameworks](https://awesome-repositories.com/f/artificial-intelligence-ml/agent-orchestration-frameworks.md) — Provides a framework for orchestrating multi-step agentic workflows and coordinating multiple models.
- [Agent Task Orchestrators](https://awesome-repositories.com/f/artificial-intelligence-ml/agent-task-orchestrators.md) — Implements patterns for coordinating multiple models to split complex tasks between high-reasoning and high-efficiency agents.
- [Claude Integration Frameworks](https://awesome-repositories.com/f/artificial-intelligence-ml/agentic-llm-frameworks/claude-integration-frameworks.md) — Provides a framework for building applications using Claude's tool calling and agent coordination capabilities.
- [Hierarchical Coordination](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-agent-state-coordination/hierarchical-coordination.md) — Provides a framework for coordinating multiple models in a hierarchy to split tasks between reasoning and efficiency agents. ([source](https://github.com/anthropics/anthropic-cookbook#readme))
- [Retrieval-Augmented Generation](https://awesome-repositories.com/f/artificial-intelligence-ml/conversational-interfaces/retrieval-augmented-generation.md) — Implements patterns for grounding model responses by retrieving relevant data from vector databases.
- [External Tool Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/external-service-integrations/external-knowledge-integrators/external-tool-integrations.md) — Connects AI assistants to external functions, calculators, and databases to execute actions and retrieve real-time data. ([source](https://github.com/anthropics/anthropic-cookbook#readme))
- [LLM Application Development](https://awesome-repositories.com/f/artificial-intelligence-ml/generative-ai-resources/generative-ai/llm-application-development.md) — Demonstrates the creation of functional software using structured outputs, tool use, and agent patterns.
- [Prompt Engineering Guides](https://awesome-repositories.com/f/artificial-intelligence-ml/prompt-engineering-guides.md) — Offers a collection of notebooks and recipes for implementing advanced prompting techniques and workflow patterns.
- [Prompt Quality Scoring](https://awesome-repositories.com/f/artificial-intelligence-ml/prompt-variation-generators/prompt-optimizers/prompt-quality-scoring.md) — Provides a system for using model-based feedback to quantify and score the clarity and robustness of prompts.
- [RAG Context Retrieval](https://awesome-repositories.com/f/artificial-intelligence-ml/rag-context-retrieval.md) — Implements the retrieval of relevant document segments from knowledge bases to ground LLM responses.
- [Structured Output Enforcements](https://awesome-repositories.com/f/artificial-intelligence-ml/structured-output-enforcements.md) — Enforces strict data models or schemas on LLM outputs to ensure reliable programmatic processing. ([source](https://github.com/anthropics/anthropic-cookbook#readme))
- [Agentic Goal Decomposition](https://awesome-repositories.com/f/artificial-intelligence-ml/task-decompositions/agentic-goal-decomposition.md) — Implements patterns for using LLMs to recursively break high-level objectives into actionable sub-tasks for multi-agent coordination.
- [Tool-Execution Loops](https://awesome-repositories.com/f/artificial-intelligence-ml/tool-execution-loops.md) — Orchestrates the request-response cycle between an AI model's tool request and the client's execution result.
- [LLM Tooling Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/artificial-intelligence-tooling/language-model-integrations/llm-tooling-integrations.md) — Provides examples and guides for connecting LLMs to external functions, calculators, and databases.
- [Prompt Optimizers](https://awesome-repositories.com/f/artificial-intelligence-ml/model-optimization/profiling-and-benchmarking/model-performance-optimization/prompt-optimizers.md) — Offers methods for systematically refining and evaluating prompts to improve accuracy and reduce costs.
- [Multimodal Data Processing](https://awesome-repositories.com/f/artificial-intelligence-ml/multimodal-data-processing.md) — Provides technical patterns for extracting and interpreting information from images and PDF documents.
- [Implementation Patterns](https://awesome-repositories.com/f/artificial-intelligence-ml/multimodal-large-language-models/implementation-patterns.md) — Ships technical demonstrations for processing visual information and parsing PDF documents using multimodal LLMs.
- [PDF Document Analyzers](https://awesome-repositories.com/f/artificial-intelligence-ml/pdf-document-analyzers.md) — Combines text extraction and semantic search to analyze and process information within PDF documents. ([source](https://github.com/anthropics/anthropic-cookbook#readme))
- [Prompt Caching](https://awesome-repositories.com/f/artificial-intelligence-ml/prompt-caching.md) — Implements prompt caching optimization techniques to improve performance and reduce operational costs. ([source](https://github.com/anthropics/anthropic-cookbook#readme))
- [Prefix Caching](https://awesome-repositories.com/f/artificial-intelligence-ml/prompt-caching/prefix-caching.md) — Demonstrates techniques for storing and sharing common prompt prefixes to reduce redundant computation and costs.
- [Semantic Search](https://awesome-repositories.com/f/artificial-intelligence-ml/semantic-search.md) — Demonstrates building search systems that understand query intent using embeddings and vector similarity.
- [Semantic Vector Search](https://awesome-repositories.com/f/artificial-intelligence-ml/vector-embeddings/semantic-vector-search.md) — Uses mathematical distance between query and document embeddings to retrieve the most relevant text segments.
- [Visual Content Analysis](https://awesome-repositories.com/f/artificial-intelligence-ml/visual-content-analysis.md) — Uses vision models to analyze images, charts, and forms to extract data and interpret visual content. ([source](https://github.com/anthropics/anthropic-cookbook#readme))

### Part of an Awesome List

- [Retrieval Augmented Generation](https://awesome-repositories.com/f/awesome-lists/ai/retrieval-augmented-generation.md) — Implements frameworks for enhancing model knowledge by integrating external data from vector databases and documents. ([source](https://github.com/anthropics/anthropic-cookbook#readme))
- [Agentic Engineering](https://awesome-repositories.com/f/awesome-lists/ai/agentic-engineering.md) — Collection of code examples for building effective agentic workflows.

### Data & Databases

- [Schema-Constrained Outputs](https://awesome-repositories.com/f/data-databases/json-schema-modeling/schema-validators/llm-json-constraints/schema-constrained-outputs.md) — Forces model responses to conform to a provided JSON schema using prompt engineering for programmatic compatibility.

### Education & Learning Resources

- [RAG Implementation Guides](https://awesome-repositories.com/f/education-learning-resources/rag-implementation-guides.md) — Provides step-by-step instructions and examples for building retrieval-augmented generation systems.

### Development Tools & Productivity

- [Notebook-Based Experimentation](https://awesome-repositories.com/f/development-tools-productivity/interactive-execution-interfaces/interactive-execution-environments/notebook-based-experimentation.md) — Uses interactive notebooks to combine executable code cells with documentation for demonstrating AI implementation patterns.

### Testing & Quality Assurance

- [LLM Evaluation](https://awesome-repositories.com/f/testing-quality-assurance/model-testing/llm-evaluation.md) — Provides a suite for systematically testing and scoring prompt quality using model-based evaluation.
