# imsharad/multi-agents architecture

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

- Interactive diagram: https://gitdiagram.com/imsharad/multi-agents
- Repository: https://github.com/imsharad/multi-agents

## Overview

##### Main Components
- Agents – Four primary agents are implemented:
- Triaging Agent (found in agents/triaging_agent.py): Acts as the entry point to assess and route user queries.
- Data Processing Agent (agents/data_processing_agent.py): Handles data cleaning, transformation, and aggregation.
- Analysis Agent (agents/analysis_agent.py): Does statistical, correlation, and regression analyses.
- Visualization Agent (agents/visualization_agent.py): Generates various types of charts.
- Tools – There are corresponding tools grouped by purpose:
- Data Processing Tools (e.g., tools/data_processing_tools.py): Execute cleaning, transforming, and aggregating operations.
- Data Analysis Tools (e.g., tools/data_analysis_tools.py): Carry out statistical and regression analysis.
- Data Visualization Tools (e.g., tools/data_visualization_tools.py): Create bar charts, line charts, and pie charts.
- Execution & Workflow Manager – Represented by the execution script located in utils/execution.py, which manages tool execution and the conversation flow between agents.
- External Elements: User is an initiating external entity and results/feedback are returned to the user.

##### Relationships and Interactions
- The User sends a query to the Triaging Agent.
- The Triaging Agent routes the request to appropriate agents (Data Processing, Analysis, or Visualization).
- Each agent communicates with its corresponding tools modules.
- Processed outputs from the tools merge (or feed into subsequent stages) and eventually return results back to the User.

##### Architectural Patterns and Design Principles
- Modular Architecture: Separate agents and tools into distinct modules so that each component is responsible for a specific task.
- Separation of Concerns: Clearly differentiate between querying/routing (handled by the Triaging Agent) and specialized data operations (processing, analysis, visualization).
- Extensibility: Take note of the design’s modularity which makes it easy to add or modify agents and tools.

##### Incorporating Technologies and Frameworks
- Reference Python as the primary programming language, with dependencies on libraries such as pandas, numpy, matplotlib, seaborn, and scikit-learn.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External entity
    U("User"):::external

    %% Agents subgraph
    subgraph "Agents"
        TA("Triaging Agent"):::agent
        DPA("Data Processing Agent"):::agent
        AA("Analysis Agent"):::agent
        VA("Visualization Agent"):::agent
    end

    %% Tools subgraph
    subgraph "Tools"
        DT("Data Processing Tools"):::tool
        DAT("Data Analysis Tools"):::tool
        DVT("Data Visualization Tools"):::tool
    end

    %% Execution & Workflow Manager
    EW("Execution & Workflow Manager"):::manager

    %% Connections
    U -->|"UserQuery"| TA
    TA -->|"routeToProcessing"| DPA
    TA -->|"routeToAnalysis"| AA
    TA -->|"routeToVisualization"| VA

    DPA -->|"callTools"| DT
    AA -->|"callTools"| DAT
    VA -->|"callTools"| DVT

    DT -->|"sendOutput"| EW
    DAT -->|"sendOutput"| EW
    DVT -->|"sendOutput"| EW

    EW -->|"returnResults"| U
    EW -->|"errorHandling"| U

    %% Click Events
    click TA "https://github.com/imsharad/multi-agents/blob/main/agents/triaging_agent.py"
    click DPA "https://github.com/imsharad/multi-agents/blob/main/agents/processing_agent.py"
    click AA "https://github.com/imsharad/multi-agents/blob/main/agents/analysis_agent.py"
    click VA "https://github.com/imsharad/multi-agents/blob/main/agents/visualization_agent.py"
    click DT "https://github.com/imsharad/multi-agents/blob/main/tools/data_processing_tools.py"
    click DAT "https://github.com/imsharad/multi-agents/blob/main/tools/data_analysis_tools.py"
    click DVT "https://github.com/imsharad/multi-agents/blob/main/tools/data_visualization_tools.py"
    click EW "https://github.com/imsharad/multi-agents/blob/main/utils/execution.py"

    %% Styles
    classDef external fill:#ffcc00,stroke:#333,stroke-width:2px;
    classDef agent fill:#bbdefb,stroke:#333,stroke-width:2px,stroke-dasharray: 5 5;
    classDef tool fill:#c8e6c9,stroke:#333,stroke-width:2px;
    classDef manager fill:#ffe082,stroke:#333,stroke-width:2px;
```
