# ai-hero-dev/ai-hero architecture

> Architecture diagram of the GitHub repository ai-hero-dev/ai-hero, 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/ai-hero-dev/ai-hero
- Repository: https://github.com/ai-hero-dev/ai-hero

## Overview

##### Main Components

a) Educational Content Structure
- Courses Module
- Examples Module
- Articles Module
- Datasets Module

b) Technical Infrastructure
- AI Integration Layer
- Code Execution Environment
- Evaluation Framework
- Development Tools

**[Articles] ←→ [Courses] ←→ [Examples]**
- ↓           ↓            ↓

**[AI Integration Services]**
- Vercel AI SDK Integration
- LLM Providers (OpenAI, Anthropic)
- Embeddings Service

**[Development & Testing]    [Data Management]    [Execution Environment]**

##### Component Details

🔷 Blue Rectangles: Core Educational Modules
- Courses (06 main sections)
- Examples (categorized by topic)
- Articles
- Datasets

🔶 Orange Hexagons: AI Services
- LLM Integration
- Embeddings
- Tool Calling
- Evaluation Framework

🟢 Green Circles: Infrastructure Components
- Environment Configuration
- Development Tools
- Testing Framework

##### Key Relationships to Highlight

- Data flow between educational content and AI services
- Integration points between examples and AI providers
- Evaluation feedback loops
- Content dependencies

##### Technical Stack Indicators

- TypeScript/Node.js
- Vercel AI SDK
- OpenAI/Anthropic APIs
- Local LLM capabilities

##### Implementation Notes

- Maintain consistent spacing and alignment
- Version/status indicators for TODO items
- Clear boundaries between educational and technical components

##### Additional Elements

- Environment setup requirements
- API key configuration
- Example execution flow
- Course progression path

Remember to maintain a balance between showing the educational content structure and the technical implementation details, as this is both a learning platform and a technical framework.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Content
        Courses["Courses"]
        Examples["Examples"]
        Articles["Articles"]
        Datasets["Datasets"]
    end

    subgraph "AI Integration"
        AICore["Core AI Models"]
        VercelSDK["Vercel AI SDK"]
        Utils["Utilities"]
    end

    subgraph "Agent Architecture"
        AgentFrame["Agent Framework"]
        Tools["Tools & Orchestrators"]
        EventDriven["Event-Driven Agents"]
        CodeExec["Code Execution"]
    end

    subgraph "RAG System"
        RAGFrame["RAG Framework"]
        Embeddings["Embeddings Implementation"]
    end

    subgraph "Development"
        DevTools["Development Tools"]
        Config["Project Configuration"]
        Shared["Shared Components"]
    end

    subgraph "Examples & Tools"
        ToolEx["Tool Examples"]
        BasicTool["Basic Tool Implementation"]
        AdvancedTool["Advanced Tool Calling"]
        Projects["Practical Applications"]
        UseCases["Use Cases"]
    end

    subgraph "Evaluation"
        EvalSystem["Evaluation System"]
        EvalTemplates["Evaluation Templates"]
    end

    %% Relationships
    Courses --> AgentFrame
    Examples --> RAGFrame
    Examples --> ToolEx
    AICore --> VercelSDK
    VercelSDK --> Utils
    AgentFrame --> Tools
    Tools --> EventDriven
    EventDriven --> CodeExec
    RAGFrame --> Embeddings
    ToolEx --> BasicTool
    BasicTool --> AdvancedTool
    EvalSystem --> EvalTemplates
    DevTools --> Shared
    Projects --> UseCases

    %% Click Events
    click Courses "https://github.com/ai-hero-dev/ai-hero/tree/main//courses"
    click Examples "https://github.com/ai-hero-dev/ai-hero/tree/main//examples"
    click Articles "https://github.com/ai-hero-dev/ai-hero/tree/main//articles"
    click Datasets "https://github.com/ai-hero-dev/ai-hero/tree/main//datasets"
    click AICore "https://github.com/ai-hero-dev/ai-hero/blob/main//examples/_shared/models.ts"
    click VercelSDK "https://github.com/ai-hero-dev/ai-hero/tree/main//examples/vercel-ai-sdk"
    click Utils "https://github.com/ai-hero-dev/ai-hero/blob/main//examples/_shared/utils.ts"
    click AgentFrame "https://github.com/ai-hero-dev/ai-hero/tree/main//courses/06-agents"
    click Tools "https://github.com/ai-hero-dev/ai-hero/tree/main//courses/06-agents/01-tools-and-orchestrators"
    click EventDriven "https://github.com/ai-hero-dev/ai-hero/tree/main//courses/06-agents/02-event-driven-agents"
    click CodeExec "https://github.com/ai-hero-dev/ai-hero/tree/main//courses/06-agents/03-code-execution"
    click RAGFrame "https://github.com/ai-hero-dev/ai-hero/tree/main//examples/rag"
    click Embeddings "https://github.com/ai-hero-dev/ai-hero/tree/main//examples/vercel-ai-sdk/13-embeddings"
    click EvalSystem "https://github.com/ai-hero-dev/ai-hero/tree/main//examples/evals"
    click EvalTemplates "https://github.com/ai-hero-dev/ai-hero/blob/main//examples/_templates/basic/basic.eval.ts"
    click ToolEx "https://github.com/ai-hero-dev/ai-hero/tree/main//examples/agents"
    click BasicTool "https://github.com/ai-hero-dev/ai-hero/tree/main//examples/vercel-ai-sdk/14-simple-tool-calling"
    click AdvancedTool "https://github.com/ai-hero-dev/ai-hero/tree/main//examples/vercel-ai-sdk/16-more-advanced-tool-calling-TODO"
    click Config "https://github.com/ai-hero-dev/ai-hero/blob/main//tsconfig.json"
    click DevTools "https://github.com/ai-hero-dev/ai-hero/tree/main//internal"
    click Shared "https://github.com/ai-hero-dev/ai-hero/tree/main//examples/_shared"
    click Projects "https://github.com/ai-hero-dev/ai-hero/tree/main//examples/projects"
    click UseCases "https://github.com/ai-hero-dev/ai-hero/tree/main//examples/use-cases"

    %% Styling
    classDef content fill:#e1f5fe,stroke:#01579b
    classDef ai fill:#fff3e0,stroke:#ff6f00
    classDef agent fill:#f3e5f5,stroke:#7b1fa2
    classDef rag fill:#e8f5e9,stroke:#2e7d32
    classDef dev fill:#fbe9e7,stroke:#d84315
    classDef tools fill:#fff8e1,stroke:#ffa000
    classDef eval fill:#f3e5f5,stroke:#7b1fa2

    class Courses,Examples,Articles,Datasets content
    class AICore,VercelSDK,Utils ai
    class AgentFrame,Tools,EventDriven,CodeExec agent
    class RAGFrame,Embeddings rag
    class DevTools,Config,Shared dev
    class ToolEx,BasicTool,AdvancedTool,Projects,UseCases tools
    class EvalSystem,EvalTemplates eval
```
