# abd-ul-hannan/mybot architecture

> Architecture diagram of the GitHub repository abd-ul-hannan/mybot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abd-ul-hannan/mybot
- Repository: https://github.com/abd-ul-hannan/mybot

## Overview

##### Project type and purpose
- MyBot is a backend-focused, modular multi-agent AI system written in Python.
- It orchestrates specialized “sub-agents” (Inspiration, Automation, Content Creation, Customer Service, Data Analysis) to handle different domains.
- It is not a traditional front-end/full-stack web app but does expose a CLI/web entrypoint (`adk web`) and interacts with external services (OpenAI APIs, BigQuery, news/place APIs).

##### File structure
- Top-level:
- `.env` for configuration
- `README.md` for documentation
- `agents/` — core orchestrator (`agent.py`, `prompt.py`) and `sub_agents/` containing domain-specific implementations
- `tools/` — utility modules (memory management, place lookup, web search)
- Each sub-agent folder follows a pattern:
- `agent.py` — agent orchestration logic
- `prompt.py` — prompt templates
- domain-specific scripts (e.g., `automation_agent.py`, `Data_Analysis_Insights_agent.py`)
- No front-end code; likely a CLI/HTTP wrapper around the core agents.

##### README for additional insights
- Confirms the five specialized agents and their responsibilities.
- Mentions external dependencies (BigQuery, news/place APIs, OpenAI).
- Notes use of a virtual environment and environment variables.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% UI Layer
    UI["CLI / Web UI"]:::ui

    %% Orchestration Layer
    subgraph "Orchestration Layer"
        AgentCore["Core Orchestrator"]:::orches
        PromptCore["Prompt Module"]:::orches
    end

    %% Agents Layer
    subgraph "Sub-Agents Layer"
        subgraph "Automation Agent"
            AutoCore["automation/agent.py"]:::agent
            AutoLogic["automation_agent.py"]:::agent
            AutoPrompt["prompt.py"]:::agent
        end
        subgraph "Content Creation Agent"
            ContentCore["Content_Creation_Generation/agent.py"]:::agent
            ContentLogic["Content_Creation_Generation.py"]:::agent
            ContentPrompt["prompt.py"]:::agent
        end
        subgraph "Customer Service Agent"
            CustCore["Customer_Service/agent.py"]:::agent
            CustLogic["Customer_Service_Engagement.py"]:::agent
            CustPrompt["prompt.py"]:::agent
        end
        subgraph "Data Analysis Agent"
            DataCore["Data_Analysis/agent.py"]:::agent
            DataLogic["Data_Analysis_Insights_agent.py"]:::agent
            DataPrompt["prompt.py"]:::agent
        end
        subgraph "Inspiration Agent"
            InspCore["inspiration/agent.py"]:::agent
            InspPrompt["prompt.py"]:::agent
        end
    end

    %% Tools Layer
    subgraph "Tools Layer"
        Memory["memory.py"]:::tools
        Places["places.py"]:::tools
        Search["search.py"]:::tools
    end

    %% External Services
    subgraph "External Services"
        OpenAI["OpenAI API"]:::external
        BigQuery["BigQuery"]:::external
        NewsAPI["News / Places APIs"]:::external
    end

    %% Configuration & Documentation
    Config[".env"]:::config
    Docs["README.md"]:::config

    %% Connections
    UI -->|"invoke"| AgentCore
    AgentCore -->|loads prompts| PromptCore
    AgentCore -->|routes request| AutoCore
    AgentCore -->|routes request| ContentCore
    AgentCore -->|routes request| CustCore
    AgentCore -->|routes request| DataCore
    AgentCore -->|routes request| InspCore

    AutoCore -->|uses prompt| AutoPrompt
    AutoCore -->|calls logic| AutoLogic
    ContentCore -->|uses prompt| ContentPrompt
    ContentCore -->|calls logic| ContentLogic
    CustCore -->|uses prompt| CustPrompt
    CustCore -->|calls logic| CustLogic
    DataCore -->|uses prompt| DataPrompt
    DataCore -->|calls logic| DataLogic
    InspCore -->|uses prompt| InspPrompt

    AutoLogic --> ToolsLayer
    ContentLogic --> ToolsLayer
    CustLogic --> ToolsLayer
    DataLogic --> ToolsLayer
    InspCore --> ToolsLayer

    ToolsLayer -->|API calls| OpenAI
    ToolsLayer -->|DB queries| BigQuery
    ToolsLayer -->|HTTP requests| NewsAPI

    OpenAI -->|responses| ToolsLayer
    BigQuery -->|data| ToolsLayer
    NewsAPI -->|data| ToolsLayer

    ToolsLayer -->|results| AutoCore
    ToolsLayer -->|results| ContentCore
    ToolsLayer -->|results| CustCore
    ToolsLayer -->|results| DataCore
    ToolsLayer -->|results| InspCore

    AgentCore -->|"reply"| UI

    Config --> AgentCore
    Config --> Memory
    Docs --- UI

    %% Click Events
    click Config "https://github.com/abd-ul-hannan/mybot/blob/main/.env"
    click Docs "https://github.com/abd-ul-hannan/mybot/blob/main/README.md"
    click AgentCore "https://github.com/abd-ul-hannan/mybot/blob/main/agents/agent.py"
    click PromptCore "https://github.com/abd-ul-hannan/mybot/blob/main/agents/prompt.py"
    click AutoCore "https://github.com/abd-ul-hannan/mybot/blob/main/agents/sub_agents/Automation/agent.py"
    click AutoLogic "https://github.com/abd-ul-hannan/mybot/blob/main/agents/sub_agents/Automation/automation_agent.py"
    click AutoPrompt "https://github.com/abd-ul-hannan/mybot/blob/main/agents/sub_agents/Automation/prompt.py"
    click ContentCore "https://github.com/abd-ul-hannan/mybot/blob/main/agents/sub_agents/Content_Creation_Generation/agent.py"
    click ContentLogic "https://github.com/abd-ul-hannan/mybot/blob/main/agents/sub_agents/Content_Creation_Generation/Content_Creation_Generation.py"
    click ContentPrompt "https://github.com/abd-ul-hannan/mybot/blob/main/agents/sub_agents/Content_Creation_Generation/prompt.py"
    click CustCore "https://github.com/abd-ul-hannan/mybot/blob/main/agents/sub_agents/Customer_Service/agent.py"
    click CustLogic "https://github.com/abd-ul-hannan/mybot/blob/main/agents/sub_agents/Customer_Service/Customer_Service_Engagement.py"
    click CustPrompt "https://github.com/abd-ul-hannan/mybot/blob/main/agents/sub_agents/Customer_Service/prompt.py"
    click DataCore "https://github.com/abd-ul-hannan/mybot/blob/main/agents/sub_agents/Data_Analysis/agent.py"
    click DataLogic "https://github.com/abd-ul-hannan/mybot/blob/main/agents/sub_agents/Data_Analysis/Data_Analysis_Insights_agent.py"
    click DataPrompt "https://github.com/abd-ul-hannan/mybot/blob/main/agents/sub_agents/Data_Analysis/prompt.py"
    click InspCore "https://github.com/abd-ul-hannan/mybot/blob/main/agents/sub_agents/inspiration/agent.py"
    click InspPrompt "https://github.com/abd-ul-hannan/mybot/blob/main/agents/sub_agents/inspiration/prompt.py"
    click Memory "https://github.com/abd-ul-hannan/mybot/blob/main/agents/tools/memory.py"
    click Places "https://github.com/abd-ul-hannan/mybot/blob/main/agents/tools/places.py"
    click Search "https://github.com/abd-ul-hannan/mybot/blob/main/agents/tools/search.py"

    %% Styles
    classDef ui fill:#e0f7fa,stroke:#006064,color:#004d40
    classDef orches fill:#bbdefb,stroke:#0d47a1,color:#0d47a1
    classDef agent fill:#c5cae9,stroke:#3f51b5,color:#1a237e
    classDef tools fill:#c8e6c9,stroke:#2e7d32,color:#1b5e20
    classDef external fill:#ffe0b2,stroke:#e65100,color:#bf360c
    classDef config fill:#eceff1,stroke:#607d8b,color:#37474f
    class ToolsLayer,OpenAI,BigQuery,NewsAPI internalTools
    classDef internalTools fill:none,stroke:none,color:none
```
