# business-science/ai-data-science-team architecture

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

- Interactive diagram: https://gitdiagram.com/business-science/ai-data-science-team
- Repository: https://github.com/business-science/ai-data-science-team

## Overview

The project is a Python library and set of applications built around a multi-agent architecture that streamlines common data science tasks. Its purpose is to provide an “AI Data Science Team” where each agent specializes in activities such as data cleaning, wrangling, feature engineering, SQL queries, exploratory data analysis, machine learning (via H2O and MLflow), and even multi-agent coordination (for combined tasks like data analysis with visualization).

##### Main Components
- Core Library (“ai_data_science_team”): This is the heart of the project. It houses:
- The Agents submodule (found under ai_data_science_team/agents) that contains individual agents for data cleaning, loading, visualization, wrangling, feature engineering, and SQL operations.
- The Data Science Agents (ds_agents) responsible for exploratory data analysis (EDA) and related functions.
- Machine Learning Agents (ml_agents) which include agents interfacing with H2O and MLflow for ML model building and deployment.
- Multi-Agents (multiagents) that combine functionalities (for example, a Pandas data analyst that integrates data wrangling with visualization or SQL analysis).
- Supporting Modules:
- Tools (data loaders, EDA utilities, SQL connectors, etc. in ai_data_science_team/tools).
- Templates and Parsers that assist in code generation and configuration.
- Utilities (like logging, plotting, HTML helpers, regex, etc.) under ai_data_science_team/utils.
- Orchestration (ai_data_science_team/orchestration.py) which likely coordinates and manages flows between agents.
- Applications Folder (apps): Contains concrete AI-powered data science apps based on the core library – for instance:
- Exploratory Data Copilot
- Pandas Data Analyst App
- SQL Database Agent App

##### Relationships and Interactions
- The central orchestration module manages the calling of various agents. This module acts as the “director” that invokes proper agents based on user instructions.
- Each agent in the Agents, ds_agents, ml_agents, and multiagents directories is specialized for a distinct task. They often communicate with supporting tools (found in the tools and utils directories), which in turn abstract lower-level functionality (for example, data formatting, plotting, and SQL connections).
- The apps layer interacts with the core library via a well-defined API, using the agents to perform end-to-end workflows (e.g., load data → clean data → engineer features → run models).
- External files (such as CSV, Excel files, databases, etc.) are inputs passed into the processing chain managed by the agents.

##### Architectural Patterns and Technologies
- Modular design: The code is organized into clear modules based on functionality, promoting separation of concerns.
- Agent-based architecture: Different agents accomplish focused data science tasks. This design is extensible (with additional agents such as the future “Supervisor” or “Interpretability Agent”).
- Integration and orchestration: The orchestration script ties individual components together in a pipeline style.
- Technology stack includes Python with support for machine learning libraries (H2O, MLflow), data visualization (Plotly, Matplotlib), and data manipulation (pandas).

## Diagram (Mermaid)

```mermaid
flowchart TD
    DataSources("External Data Sources"):::external
    Apps("Applications Layer"):::app
    DataSources -->|"inputs"| Apps

    subgraph "Core Library"
        CL("Core Library"):::core
        OCH("Orchestration Module"):::core
        CL -->|"coordinates"| OCH

        subgraph "Agents"
            DCA("Data Cleaning Agent"):::agent
            DLT("Data Loader Tools Agent"):::agent
            DVA("Data Visualization Agent"):::agent
            DWA("Data Wrangling Agent"):::agent
            FEA("Feature Engineering Agent"):::agent
            SDA("SQL Database Agent"):::agent
            DSA("Data Science Agents"):::agent
            MLA("ML Agents"):::agent
            MA("Multi-Agents"):::agent
        end

        subgraph "Supporting Modules"
            Tools("Tools (Data loaders, EDA utilities, SQL connectors)"):::support
            TemPlar("Templates & Parsers"):::support
            Utils("Utilities (logging, plotting, regex, etc.)"):::support
        end
    end

    Apps -->|"invoke"| CL
    CL --> OCH

    %% Orchestration dispatches to Agents
    OCH -->|"dispatches"| DCA
    OCH -->|"dispatches"| DLT
    OCH -->|"dispatches"| DVA
    OCH -->|"dispatches"| DWA
    OCH -->|"dispatches"| FEA
    OCH -->|"dispatches"| SDA
    OCH -->|"dispatches"| DSA
    OCH -->|"dispatches"| MLA
    OCH -->|"dispatches"| MA

    %% Agents use Supporting Modules
    DCA -->|"uses"| Tools
    DLT -->|"uses"| Tools
    DVA -->|"uses"| Tools
    DWA -->|"uses"| Tools
    FEA -->|"uses"| Tools
    SDA -->|"uses"| Tools
    DSA -->|"uses"| Tools
    MLA -->|"uses"| Tools
    MA -->|"uses"| Tools

    DCA -->|"uses"| Utils
    DLT -->|"uses"| Utils
    DVA -->|"uses"| Utils
    DWA -->|"uses"| Utils
    FEA -->|"uses"| Utils
    SDA -->|"uses"| Utils
    DSA -->|"uses"| Utils
    MLA -->|"uses"| Utils
    MA -->|"uses"| Utils

    %% Supporting Modules interactions
    Tools -->|"generates"| TemPlar
    TemPlar -->|"configures"| Utils

    %% Output from Supporting Modules back to Applications
    Tools -->|"output"| Apps
    TemPlar -->|"output"| Apps
    Utils -->|"output"| Apps

    %% Click Events
    click CL "https://github.com/business-science/ai-data-science-team/tree/master/ai_data_science_team"
    click DCA "https://github.com/business-science/ai-data-science-team/blob/master/ai_data_science_team/agents/data_cleaning_agent.py"
    click DLT "https://github.com/business-science/ai-data-science-team/blob/master/ai_data_science_team/agents/data_loader_tools_agent.py"
    click DVA "https://github.com/business-science/ai-data-science-team/blob/master/ai_data_science_team/agents/data_visualization_agent.py"
    click DWA "https://github.com/business-science/ai-data-science-team/blob/master/ai_data_science_team/agents/data_wrangling_agent.py"
    click FEA "https://github.com/business-science/ai-data-science-team/blob/master/ai_data_science_team/agents/feature_engineering_agent.py"
    click SDA "https://github.com/business-science/ai-data-science-team/blob/master/ai_data_science_team/agents/sql_database_agent.py"
    click DSA "https://github.com/business-science/ai-data-science-team/tree/master/ai_data_science_team/ds_agents"
    click MLA "https://github.com/business-science/ai-data-science-team/tree/master/ai_data_science_team/ml_agents"
    click MA "https://github.com/business-science/ai-data-science-team/tree/master/ai_data_science_team/multiagents"
    click Tools "https://github.com/business-science/ai-data-science-team/tree/master/ai_data_science_team/tools"
    click TemPlar "https://github.com/business-science/ai-data-science-team/blob/master/ai_data_science_team/templates/agent_templates.py"
    click Utils "https://github.com/business-science/ai-data-science-team/tree/master/ai_data_science_team/utils"
    click OCH "https://github.com/business-science/ai-data-science-team/blob/master/ai_data_science_team/orchestration.py"
    click Apps "https://github.com/business-science/ai-data-science-team/tree/master/apps"

    %% Styles
    classDef external fill:#FFD700,stroke:#333,stroke-width:2px;
    classDef app fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef core fill:#87CEEB,stroke:#333,stroke-width:2px;
    classDef agent fill:#FFB6C1,stroke:#333,stroke-width:2px;
    classDef support fill:#FFFACD,stroke:#333,stroke-width:2px;
```
