# business-science/free-ai-tips architecture

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

- Interactive diagram: https://gitdiagram.com/business-science/free-ai-tips
- Repository: https://github.com/business-science/free-ai-tips

## Overview

##### Main Components
- Individual Agent Modules: Notice the numbering (001 through 014) indicating distinct projects, each self-contained with its own “main” Python script (or notebook) and supporting submodules. For example:
- 001_pandas_dataframe_agent: Deals with pandas dataframes.
- 002_customer_churn_ai_ml: Focuses on customer churn analysis using AI/ML.
- 003_automate_data_cleaning_ai_copilot: Automates data cleaning functions.
- 004_automate_feature_engineering_copilot: Provides feature engineering capabilities.
- … and so on.
- Shared Resources:
- Data directories: Each module has its own data folder (or uses common data files under the top-level “data” directory).
- Utility functions and ai_functions subdirectories: These abstract the reusable logic (e.g., parsers, data_cleaner.py, feature_engineer.py).
- External Artifacts:
- Notebooks (for demo and interactive analysis).
- Configuration folders (e.g., .streamlit, VSCode) that help in local configurations.
- Static files like the README and images used for branding the “Free GenAI/ML Tips.”

##### Relationships and Interactions
- Each module is architecturally self-contained. However, they follow a similar pattern:
- An entry point file (either a .py script or an .ipynb notebook) calls functions from the associated ai_functions or utils directory.
- They ingest data from CSV files or databases provided in their respective data folders.
- Many modules may rely on common interaction patterns such as reading data, processing it via an AI-powered function, and then visualizing results.
- From external data sources (CSV, database, etc.) into the agent module.
- From the agent module into output components (visualizations, summaries, or app responses).

##### Architectural Patterns and Design Principles
- Layered Structure:
- Data Ingestion Layer: Represented by the various CSVs, .db files, and data folders.
- Processing Layer: Where the AI/ML logic resides (ai_functions subdirectories).
- Presentation/Output Layer: Either in interactive app files (like 010_sql_database_agent_app/app.py or 014_ai_exploratory_copilot_app/app.py) or visualization modules.
- Reusability & Extensibility: Note shared utilities and patterns (for instance, many modules include a “/ai_functions” folder).

##### Final Elements
- Data Preparation: (001, 002, 005, 012)
- Data Processing & AI/ML Modeling: (003, 004, 009, 011)
- SQL/Database Interactions: (006, 008, 010)
- Exploratory Analysis & Visualization: (007, 013, 014)
- Data Sources: Represent the CSV files, databases (e.g., northwind.db), and other input data.
- Interactive Applications: Highlight modules that serve as full apps.
- Annotations that briefly explain the role of each agent, aligning with the “Free GenAI/ML Tips” idea (i.e., each agent demonstrates a GenAI/ML tip in action).

## Diagram (Mermaid)

```mermaid
graph TD
    %% External Data
    extData("External Data (CSV, DB)"):::external

    %% Shared Resources & Configs
    subgraph "Shared Resources & Configs"
        res1("Shared Data Folder"):::shared
        res2("Config Folders (.streamlit, .vscode)"):::shared
        res3("Branding/Docs (README, img, instructions)"):::shared
    end

    %% Data Preparation Layer
    subgraph "Data Preparation"
        dprep1("001 Pandas DataFrame Agent"):::agent
        dprep2("002 Customer Churn AI/ML Module"):::agent
        dprep3("005 Automate Data Wrangling"):::agent
        dprep4("012 Data Loader Agent"):::agent
    end

    %% Data Processing & AI/ML Modeling Layer
    subgraph "Data Processing & AI/ML Modeling"
        dproc1("003 Automate Data Cleaning Copilot"):::agent
        dproc2("004 Automate Feature Engineering Copilot"):::agent
        dproc3("009 H2O Machine Learning Agent"):::agent
        dproc4("011 MLOps MLflow H2O Agent"):::agent
    end

    %% SQL/Database Interactions Layer
    subgraph "SQL/Database Interactions"
        sql1("006 Automate SQL Copilot"):::agent
        sql2("008 Multiagent SQL Data Analyst"):::agent
        sql3("010 SQL Database Agent App"):::app
    end

    %% Exploratory Analysis & Visualization Layer
    subgraph "Exploratory Analysis & Visualization"
        vis1("007 Automate Data Visualization"):::agent
        vis2("013 Exploratory Data Analysis Agent"):::agent
        vis3("014 AI Exploratory Copilot App"):::app
    end

    %% Output Layer
    subgraph "Output"
        out("Visualization/Results"):::output
    end

    %% Data Flow Connections
    res1 --> extData

    extData --> dprep1
    extData --> dprep2
    extData --> dprep3
    extData --> dprep4

    %% All modules output to Visualization/Results
    dprep1 --> out
    dprep2 --> out
    dprep3 --> out
    dprep4 --> out

    dproc1 --> out
    dproc2 --> out
    dproc3 --> out
    dproc4 --> out

    sql1 --> out
    sql2 --> out
    sql3 --> out

    vis1 --> out
    vis2 --> out
    vis3 --> out

    %% Shared Config influences interactive apps
    res2 --> sql3
    res2 --> vis3

    %% Click Events for Components
    click dprep1 "https://github.com/business-science/free-ai-tips/tree/master/001_pandas_dataframe_agent"
    click dprep2 "https://github.com/business-science/free-ai-tips/tree/master/002_customer_churn_ai_ml"
    click dproc1 "https://github.com/business-science/free-ai-tips/tree/master/003_automate_data_cleaning_ai_copilot"
    click dproc2 "https://github.com/business-science/free-ai-tips/tree/master/004_automate_feature_engineering_copilot"
    click dprep3 "https://github.com/business-science/free-ai-tips/tree/master/005_automate_data_wrangling"
    click sql1 "https://github.com/business-science/free-ai-tips/tree/master/006_automate_sql_copilot"
    click vis1 "https://github.com/business-science/free-ai-tips/tree/master/007_automate_data_visualization"
    click sql2 "https://github.com/business-science/free-ai-tips/tree/master/008_multiagent_sql_data_analyst"
    click dproc3 "https://github.com/business-science/free-ai-tips/tree/master/009_h2o_machine_learning_agent"
    click sql3 "https://github.com/business-science/free-ai-tips/tree/master/010_sql_database_agent_app"
    click dproc4 "https://github.com/business-science/free-ai-tips/tree/master/011_mlops_mlflow_h2o_agent"
    click dprep4 "https://github.com/business-science/free-ai-tips/tree/master/012_data_loader_agent"
    click vis2 "https://github.com/business-science/free-ai-tips/tree/master/013_exploratory_data_analysis_agent"
    click vis3 "https://github.com/business-science/free-ai-tips/tree/master/014_ai_exploratory_copilot_app"
    click res1 "https://github.com/business-science/free-ai-tips/tree/master/data"
    click res2 "https://github.com/business-science/free-ai-tips/blob/master/.streamlit"
    click res3 "https://github.com/business-science/free-ai-tips/blob/master/README.md"

    %% Styles
    classDef external fill:#f9f,stroke:#333,stroke-width:2px;
    classDef agent fill:#bbf,stroke:#333,stroke-width:2px;
    classDef app fill:#afa,stroke:#333,stroke-width:2px;
    classDef shared fill:#fea,stroke:#333,stroke-width:2px;
    classDef output fill:#cfc,stroke:#333,stroke-width:2px;
```
