# ashishpatel26/aiagentworkshop architecture

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

- Interactive diagram: https://gitdiagram.com/ashishpatel26/aiagentworkshop
- Repository: https://github.com/ashishpatel26/aiagentworkshop

## Overview

##### Main Components
- User Interface Layer: Include components for the different frontends used (e.g., Streamlit apps for SmolAgent and CrewAI). Note that many of the demos are interactively run via notebooks and live session setups (Colab/Streamlit).
- Workflow Engine: Represent the different workflow patterns (prompt chaining, routing, parallelization, orchestrator-workers) as distinct modules. They govern how inputs are processed through sequential or parallel steps.
- Specialized Agents / Frameworks: Separate blocks for:
– CrewAI Agents (e.g., Finance Agent) as implemented in parts “1-Introduction_Agents” and “3-crewAIAgent”.
– SmolAgent (e.g., AI News Agent App) from “4-smolagent” and its live coding/Streamlit integration.
– SQL Agent (SmolAgent for SQL) from “5-smolagent-sqlagent” demonstrating database interactions.
- External Tools and Services: Include components for any external tools (e.g., financial data scrapers, search tools like DuckDuckGo, and possibly a certificate/trust module from the .gradio folder).
- Environment & Configuration: Display configuration sources (e.g., .env.example, certificate.pem) and dependency management (requirements.txt in various parts) which illustrate how environment and third-party libraries are integrated.

##### Relationships and Data Flows
- For workflow patterns, show branches where input is:
– Chained through multiple LLM calls (prompt chaining).
– Routed to specialized handlers (routing).
– Processed in parallel (parallelization).
– Coordinated via an orchestrator distributing tasks to different sub-agents.
- Integration between the LLM and each specialized agent. For example, CrewAI will combine multiple agents (like a Financial Analyst and Investment Reviewer Agent) into a “Crew” that processes tasks concurrently.

##### Architectural Patterns & Technologies
- Modular design, where each “Part” of the workshop represents a distinct, but connected, architectural concept.
– Frontend components (Streamlit apps, Notebook frontends)
– Workflow connectors (orchestrator, routers, aggregators)
– Business logic components (CrewAI Finance Agent, SmolAgent News Agent, SQL Agent)
– Back-end services (LLM & external tools)
- Configuration and dependency management aspects (like the .env.example, requirements.txt) as support blocks that underpin the whole system.

##### Essential Architectural Elements
- Both the high-level modular separation (different agent frameworks and their interaction with the LLM) and the detailed processes shown in the README (e.g., multi-step workflows in prompt chaining).
- Extensibility and modularity by showing how each agent or pattern might be swapped or extended independently.

## Diagram (Mermaid)

```mermaid
graph TD
    %% User Interface Layer
    subgraph "User Interface Layer"
        UI1["CrewAI Notebook"]:::frontend
        UI2["SmolAgent Streamlit Notebook"]:::frontend
        UI3["Gemini CrewAI Agents"]:::frontend
        UI4["GeminiVisionPro Agent"]:::frontend
        UI5["SmolAgent SQL Notebook"]:::frontend
        UI_REQ["User Request"]:::frontend
    end

    UI1 --> UI_REQ
    UI2 --> UI_REQ
    UI3 --> UI_REQ
    UI4 --> UI_REQ
    UI5 --> UI_REQ

    %% Workflow Engine
    subgraph "Workflow Engine"
        WF1["Prompt Chaining"]:::workflow
        WF2["Routing"]:::workflow
        WF3["Parallelization"]:::workflow
        WF4["Orchestrator"]:::workflow
    end
    UI_REQ -->|"toWorkflows"| WF1
    UI_REQ -->|"toWorkflows"| WF2
    UI_REQ -->|"toWorkflows"| WF3
    UI_REQ -->|"toWorkflows"| WF4

    %% LLM Engine
    subgraph "LLM Engine"
        LLM["LLM Engine"]:::core
    end
    WF1 -->|"callsLLM"| LLM
    WF2 -->|"callsLLM"| LLM
    WF3 -->|"callsLLM"| LLM
    WF4 -->|"callsLLM"| LLM

    %% Specialized Agents
    subgraph "Specialized Agents"
        subgraph "CrewAI Agents"
            CA1["CrewAI Basic Agent"]:::agents
            CA2["CrewAI Structured Agent"]:::agents
            CA3["CrewAI Finance Agent"]:::agents
        end
        subgraph "SmolAgent"
            SM1["SmolAgent News Agent"]:::agents
            SM2["SmolAgent Data Analyst App"]:::agents
            SM3["SmolAgent Data Analyst Streaming"]:::agents
        end
        subgraph "SQL Agent"
            SQL["SQL Agent"]:::agents
        end
    end
    LLM -->|"processes"| CA1
    LLM -->|"processes"| CA2
    LLM -->|"processes"| CA3
    LLM -->|"processes"| SM1
    LLM -->|"processes"| SM2
    LLM -->|"processes"| SM3
    LLM -->|"processes"| SQL

    %% External Tools and Services
    subgraph "External Tools and Services"
        EXT["External Certificate"]:::external
    end
    LLM -->|"integrates"| EXT

    %% Environment & Configuration
    subgraph "Environment & Configuration"
        ENV[".env Config"]:::config
        GREQ["Global Requirements"]:::config
        SM_DREQ["SmolAgent DataAnalyst Requirements"]:::config
        SM_REQ["SmolAgent Requirements"]:::config
        SQL_REQ["SmolAgent SQLAgent Requirements"]:::config
    end
    ENV ---|"configures" | LLM
    GREQ ---|"configures" | LLM
    SM_DREQ ---|"configures" | LLM
    SM_REQ ---|"configures" | LLM
    SQL_REQ ---|"configures" | LLM

    %% Click Events
    click UI1 "https://github.com/ashishpatel26/aiagentworkshop/blob/main/1-CrewAI_Notebook.ipynb"
    click UI2 "https://github.com/ashishpatel26/aiagentworkshop/blob/main/2-SmoleAgent_Streamlit_Notebook.ipynb"
    click UI3 "https://github.com/ashishpatel26/aiagentworkshop/blob/main/3_Gemini_crewAI_Agents.ipynb"
    click UI4 "https://github.com/ashishpatel26/aiagentworkshop/blob/main/4_GeminiVisionPro_Agent.ipynb"
    click UI5 "https://github.com/ashishpatel26/aiagentworkshop/blob/main/5_SmolAgent_sqlAgent.ipynb"

    click WF1 "https://github.com/ashishpatel26/aiagentworkshop/blob/main/2-workflows/1-prompt-chaining.py"
    click WF2 "https://github.com/ashishpatel26/aiagentworkshop/blob/main/2-workflows/2-routing.py"
    click WF3 "https://github.com/ashishpatel26/aiagentworkshop/blob/main/2-workflows/3-parallization.py"
    click WF4 "https://github.com/ashishpatel26/aiagentworkshop/blob/main/2-workflows/4-orchestrator.py"

    click CA1 "https://github.com/ashishpatel26/aiagentworkshop/blob/main/1-Introduction_Agents/1-basic.py"
    click CA2 "https://github.com/ashishpatel26/aiagentworkshop/blob/main/1-Introduction_Agents/2-structured.py"
    click CA3 "https://github.com/ashishpatel26/aiagentworkshop/blob/main/3-crewAIAgent/Financeapp.py"

    click SM1 "https://github.com/ashishpatel26/aiagentworkshop/blob/main/4-smolagent/NewsAgent.py"
    click SM2 "https://github.com/ashishpatel26/aiagentworkshop/blob/main/4-smolagent/DataanalystAgent/app.py"
    click SM3 "https://github.com/ashishpatel26/aiagentworkshop/blob/main/4-smolagent/DataanalystAgent/streaming.py"

    click SQL "https://github.com/ashishpatel26/aiagentworkshop/blob/main/5-smolagent-sqlagent/sqlagent.py"

    click EXT "https://github.com/ashishpatel26/aiagentworkshop/blob/main/.gradio/certificate.pem"

    click ENV "https://github.com/ashishpatel26/aiagentworkshop/blob/main/.env.example"
    click GREQ "https://github.com/ashishpatel26/aiagentworkshop/blob/main/requirements.txt"
    click SM_DREQ "https://github.com/ashishpatel26/aiagentworkshop/blob/main/4-smolagent/DataanalystAgent/requirements.txt"
    click SM_REQ "https://github.com/ashishpatel26/aiagentworkshop/blob/main/4-smolagent/requirements.txt"
    click SQL_REQ "https://github.com/ashishpatel26/aiagentworkshop/blob/main/5-smolagent-sqlagent/requirements.txt"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#333,stroke-width:2px;
    classDef workflow fill:#d4edda,stroke:#333,stroke-width:2px;
    classDef core fill:#fff3cd,stroke:#333,stroke-width:2px;
    classDef agents fill:#f8d7da,stroke:#333,stroke-width:2px;
    classDef external fill:#e2e3e5,stroke:#333,stroke-width:2px;
    classDef config fill:#d1ecf1,stroke:#333,stroke-width:2px;
```
