# anthropics/anthropic-cookbook architecture

> Architecture diagram of the GitHub repository anthropics/anthropic-cookbook, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anthropics/anthropic-cookbook
- Repository: https://github.com/anthropics/anthropic-cookbook

## Overview

##### Main Components

a) Core Skills Module
- As a central hub containing specialized submodules:
- Citations System
- Classification Engine
- RAG (Retrieval Augmented Generation)
- Summarization Service
- Text-to-SQL Converter
- Contextual Embeddings

b) Integration Layer
- Third-party Services Integration Hub:
- Vector Databases (Pinecone, MongoDB)
- Search Services (Brave, Wikipedia)
- LlamaIndex Integration
- Deepgram Audio Processing
- WolframAlpha
- VoyageAI Embeddings

c) Multimodal Processing System
- Vision Processing Pipeline
- Document Processing
- Chart/Graph Analysis
- Text Extraction

d) Tool Integration Framework
- Calculator Tools
- Customer Service Agents
- JSON Extraction
- Pydantic Integration

e) Evaluation & Testing Infrastructure
- Automated Evaluations
- Prompt Testing
- Performance Metrics
- Custom Evaluation Tools (BLEU, ROUGE)

##### Relationship Flows

- Data flow direction with arrowheads

##### Component Details

For each major component, include:
- Input/Output specifications
- Key dependencies
- Primary functions
- Integration points

##### Implementation Notes

- Rectangles: Core components
- Hexagons: Integration points
- Clouds: External services

- Annotations for:
- API endpoints
- Configuration requirements
- Version dependencies
- Performance considerations

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core["Core Skills Module"]
        direction TB
        Citations["Citations System"]
        Classification["Classification Engine"]
        RAG["RAG System"]
        Summarization["Summarization Service"]
        SQL["Text-to-SQL Converter"]
        Embeddings["Contextual Embeddings"]
    end

    subgraph Integration["Integration Layer"]
        direction TB
        Pinecone["Pinecone DB"]
        MongoDB["MongoDB"]
        Brave["Brave Search"]
        Wikipedia["Wikipedia Search"]
        LlamaIndex["LlamaIndex"]
        Deepgram["Deepgram Audio"]
        Wolfram["WolframAlpha"]
        VoyageAI["VoyageAI Embeddings"]
    end

    subgraph Multimodal["Multimodal Processing"]
        direction TB
        Vision["Vision Processing"]
        Documents["Document Processing"]
        Charts["Chart/Graph Analysis"]
        TextExtract["Text Transcription"]
    end

    subgraph Tools["Tool Integration Framework"]
        direction TB
        Calculator["Calculator Tools"]
        CustomerService["Customer Service Agents"]
        JSONExtract["JSON Extraction"]
        Pydantic["Pydantic Integration"]
    end

    subgraph Eval["Evaluation Infrastructure"]
        direction TB
        RAGEval["RAG Evaluation"]
        SumEval["Summarization Evaluation"]
        ClassEval["Classification Evaluation"]
        CitEval["Citations Evaluation"]
        SQLEval["Text-to-SQL Evaluation"]
    end

    %% Core Skills Relationships
    Citations --> RAG
    Classification --> RAG
    Embeddings --> RAG
    Embeddings --> Classification
    
    %% Integration Layer Connections
    RAG --> Pinecone
    RAG --> MongoDB
    RAG --> LlamaIndex
    Embeddings --> VoyageAI
    
    %% Multimodal Connections
    Vision --> RAG
    Documents --> RAG
    Charts --> RAG
    TextExtract --> Deepgram
    
    %% Tool Integration Connections
    Calculator --> Wolfram
    CustomerService --> RAG
    JSONExtract --> Classification
    Pydantic --> JSONExtract
    
    %% Evaluation Connections
    RAG --> RAGEval
    Summarization --> SumEval
    Classification --> ClassEval
    Citations --> CitEval
    SQL --> SQLEval

    %% Click Events for Component Mapping
    click Citations "https://github.com/anthropics/anthropic-cookbook/tree/main/skills/citations/"
    click Classification "https://github.com/anthropics/anthropic-cookbook/tree/main/skills/classification/"
    click RAG "https://github.com/anthropics/anthropic-cookbook/tree/main/skills/retrieval_augmented_generation/"
    click Summarization "https://github.com/anthropics/anthropic-cookbook/tree/main/skills/summarization/"
    click SQL "https://github.com/anthropics/anthropic-cookbook/tree/main/skills/text_to_sql/"
    click Embeddings "https://github.com/anthropics/anthropic-cookbook/tree/main/skills/contextual-embeddings/"
    
    click Pinecone "https://github.com/anthropics/anthropic-cookbook/tree/main/third_party/Pinecone/"
    click MongoDB "https://github.com/anthropics/anthropic-cookbook/tree/main/third_party/MongoDB/"
    click Brave "https://github.com/anthropics/anthropic-cookbook/tree/main/third_party/Brave/"
    click Wikipedia "https://github.com/anthropics/anthropic-cookbook/tree/main/third_party/Wikipedia/"
    click LlamaIndex "https://github.com/anthropics/anthropic-cookbook/tree/main/third_party/LlamaIndex/"
    click Deepgram "https://github.com/anthropics/anthropic-cookbook/tree/main/third_party/Deepgram/"
    click Wolfram "https://github.com/anthropics/anthropic-cookbook/tree/main/third_party/WolframAlpha/"
    click VoyageAI "https://github.com/anthropics/anthropic-cookbook/tree/main/third_party/VoyageAI/"
    
    click Vision "https://github.com/anthropics/anthropic-cookbook/blob/main/multimodal/best_practices_for_vision.ipynb"
    click Documents "https://github.com/anthropics/anthropic-cookbook/tree/main/multimodal/documents/"
    click Charts "https://github.com/anthropics/anthropic-cookbook/blob/main/multimodal/reading_charts_graphs_powerpoints.ipynb"
    click TextExtract "https://github.com/anthropics/anthropic-cookbook/blob/main/multimodal/how_to_transcribe_text.ipynb"
    
    click Calculator "https://github.com/anthropics/anthropic-cookbook/blob/main/tool_use/calculator_tool.ipynb"
    click CustomerService "https://github.com/anthropics/anthropic-cookbook/blob/main/tool_use/customer_service_agent.ipynb"
    click JSONExtract "https://github.com/anthropics/anthropic-cookbook/blob/main/tool_use/extracting_structured_json.ipynb"
    click Pydantic "https://github.com/anthropics/anthropic-cookbook/blob/main/tool_use/tool_use_with_pydantic.ipynb"
    
    click RAGEval "https://github.com/anthropics/anthropic-cookbook/tree/main/skills/retrieval_augmented_generation/evaluation/"
    click SumEval "https://github.com/anthropics/anthropic-cookbook/tree/main/skills/summarization/evaluation/"
    click ClassEval "https://github.com/anthropics/anthropic-cookbook/tree/main/skills/classification/evaluation/"
    click CitEval "https://github.com/anthropics/anthropic-cookbook/tree/main/skills/citations/evaluation/"
    click SQLEval "https://github.com/anthropics/anthropic-cookbook/tree/main/skills/text_to_sql/evaluation/"

    classDef core fill:#2374ab
    classDef integration fill:#45b7d1
    classDef multimodal fill:#734b98
    classDef tools fill:#f39237
    classDef eval fill:#808080
    
    class Citations,Classification,RAG,Summarization,SQL,Embeddings core
    class Pinecone,MongoDB,Brave,Wikipedia,LlamaIndex,Deepgram,Wolfram,VoyageAI integration
    class Vision,Documents,Charts,TextExtract multimodal
    class Calculator,CustomerService,JSONExtract,Pydantic tools
    class RAGEval,SumEval,ClassEval,CitEval,SQLEval eval
```
