# prudvireddy-git/ai-data-analyst architecture

> Architecture diagram of the GitHub repository prudvireddy-git/ai-data-analyst, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/prudvireddy-git/ai-data-analyst
- Repository: https://github.com/prudvireddy-git/ai-data-analyst

## Overview

AI Data Analyst is a Streamlit application for uploading CSV data (or loading it through SQLite), cleaning and exploring it, and producing charts, dataset insights, or natural-language analysis assistance. The main workflow runs through the app, which routes the dataset and user requests to specialized agents. Analyst responses are generated Pandas code and explanations; the sampled code does not execute that code. The README documents these capabilities, while implementation evidence is limited to app.py and agents.py.

Main entry points: [`app.py`](https://github.com/prudvireddy-git/ai-data-analyst/blob/main/app.py) (Streamlit app), [`agents.py`](https://github.com/prudvireddy-git/ai-data-analyst/blob/main/agents.py) (Visualization agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_app["Streamlit app<br/>[app.py]"]
  node_viz_request["Visualization request<br/>[app.py]"]
  node_insights["Dataset insights<br/>[app.py]"]
  node_analysis["Pandas code and explanation<br/>[app.py]"]
end

subgraph group_data["Dataset handling"]
  node_csv["CSV upload<br/>[app.py]"]
  node_sqlite[("SQLite data table")]
  node_dataframe["Pandas DataFrame<br/>[app.py]"]
  node_cleaned["Cleaned dataset<br/>[app.py]"]
end

subgraph group_agents["Analysis agents"]
  node_cleaner["Data cleaner<br/>[agents.py]"]
  node_viz_agent["Visualization agent<br/>[agents.py]"]
  node_chart_config["Chart recommendation<br/>[agents.py]"]
  node_insight_agent["Insight agent<br/>[agents.py]"]
  node_analyst_agent["Analyst agent<br/>[agents.py]"]
end

subgraph group_integrations["Models and outputs"]
  node_clean_csv["Cleaned CSV download<br/>[app.py]"]
  node_plotly["Plotly chart<br/>[agents.py]"]
  node_chart_png["PNG chart download<br/>[app.py]"]
  node_llm{{"Groq LLM"}}
end

node_user(("User"))

node_user -->|"submits requests"| node_app
node_app -->|"accepts upload"| node_csv
node_csv -->|"reads CSV"| node_dataframe
node_app -.->|"writes and reads"| node_sqlite
node_sqlite -.->|"returns rows"| node_dataframe
node_app -->|"runs cleaning"| node_cleaner
node_cleaner -->|"returns cleaned data"| node_cleaned
node_app -->|"exports cleaned data"| node_clean_csv
node_user -->|"describes chart"| node_viz_request
node_app -->|"requests chart"| node_viz_agent
node_viz_agent -->|"requests recommendation"| node_llm
node_viz_agent -->|"parses recommendation"| node_chart_config
node_viz_agent -->|"builds chart"| node_plotly
node_app -->|"renders chart"| node_plotly
node_app -->|"exports chart"| node_chart_png
node_app -->|"requests insights"| node_insight_agent
node_insight_agent -->|"requests summary"| node_llm
node_app -->|"displays response"| node_insights
node_app -->|"submits question"| node_analyst_agent
node_analyst_agent -->|"requests analysis"| node_llm
node_app -->|"displays response"| node_analysis

click node_app "https://github.com/prudvireddy-git/ai-data-analyst/blob/main/app.py"
click node_csv "https://github.com/prudvireddy-git/ai-data-analyst/blob/main/app.py"
click node_dataframe "https://github.com/prudvireddy-git/ai-data-analyst/blob/main/app.py"
click node_cleaner "https://github.com/prudvireddy-git/ai-data-analyst/blob/main/agents.py"
click node_cleaned "https://github.com/prudvireddy-git/ai-data-analyst/blob/main/app.py"
click node_clean_csv "https://github.com/prudvireddy-git/ai-data-analyst/blob/main/app.py"
click node_viz_request "https://github.com/prudvireddy-git/ai-data-analyst/blob/main/app.py"
click node_viz_agent "https://github.com/prudvireddy-git/ai-data-analyst/blob/main/agents.py"
click node_chart_config "https://github.com/prudvireddy-git/ai-data-analyst/blob/main/agents.py"
click node_plotly "https://github.com/prudvireddy-git/ai-data-analyst/blob/main/agents.py"
click node_chart_png "https://github.com/prudvireddy-git/ai-data-analyst/blob/main/app.py"
click node_insight_agent "https://github.com/prudvireddy-git/ai-data-analyst/blob/main/agents.py"
click node_insights "https://github.com/prudvireddy-git/ai-data-analyst/blob/main/app.py"
click node_analyst_agent "https://github.com/prudvireddy-git/ai-data-analyst/blob/main/agents.py"
click node_analysis "https://github.com/prudvireddy-git/ai-data-analyst/blob/main/app.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_viz_request,node_insights,node_analysis,node_user toneBlue
class node_csv,node_sqlite,node_dataframe,node_cleaned toneAmber
class node_cleaner,node_viz_agent,node_chart_config,node_insight_agent,node_analyst_agent toneMint
class node_clean_csv,node_plotly,node_chart_png,node_llm toneRose
```

## Components

### User interface

- [Streamlit app](https://github.com/prudvireddy-git/ai-data-analyst/blob/main/app.py): `app.py`
- [Visualization request](https://github.com/prudvireddy-git/ai-data-analyst/blob/main/app.py): `app.py`
- [Dataset insights](https://github.com/prudvireddy-git/ai-data-analyst/blob/main/app.py): `app.py`
- [Pandas code and explanation](https://github.com/prudvireddy-git/ai-data-analyst/blob/main/app.py): `app.py`

### Dataset handling

- [CSV upload](https://github.com/prudvireddy-git/ai-data-analyst/blob/main/app.py): `app.py`
- **SQLite data table**
- [Pandas DataFrame](https://github.com/prudvireddy-git/ai-data-analyst/blob/main/app.py): `app.py`
- [Cleaned dataset](https://github.com/prudvireddy-git/ai-data-analyst/blob/main/app.py): `app.py`

### Analysis agents

- [Data cleaner](https://github.com/prudvireddy-git/ai-data-analyst/blob/main/agents.py): `agents.py`
- [Visualization agent](https://github.com/prudvireddy-git/ai-data-analyst/blob/main/agents.py): `agents.py`
- [Chart recommendation](https://github.com/prudvireddy-git/ai-data-analyst/blob/main/agents.py): `agents.py`
- [Insight agent](https://github.com/prudvireddy-git/ai-data-analyst/blob/main/agents.py): `agents.py`
- [Analyst agent](https://github.com/prudvireddy-git/ai-data-analyst/blob/main/agents.py): `agents.py`

### Models and outputs

- [Cleaned CSV download](https://github.com/prudvireddy-git/ai-data-analyst/blob/main/app.py): `app.py`
- [Plotly chart](https://github.com/prudvireddy-git/ai-data-analyst/blob/main/agents.py): `agents.py`
- [PNG chart download](https://github.com/prudvireddy-git/ai-data-analyst/blob/main/app.py): `app.py`
- **Groq LLM**

### Other components

- **User**

## Connections

- User → Streamlit app: submits requests
- Streamlit app → CSV upload: accepts upload
- CSV upload → Pandas DataFrame: reads CSV
- Streamlit app → SQLite data table: writes and reads
- SQLite data table → Pandas DataFrame: returns rows
- Streamlit app → Data cleaner: runs cleaning
- Data cleaner → Cleaned dataset: returns cleaned data
- Streamlit app → Cleaned CSV download: exports cleaned data
- User → Visualization request: describes chart
- Streamlit app → Visualization agent: requests chart
- Visualization agent → Groq LLM: requests recommendation
- Visualization agent → Chart recommendation: parses recommendation
- Visualization agent → Plotly chart: builds chart
- Streamlit app → Plotly chart: renders chart
- Streamlit app → PNG chart download: exports chart
- Streamlit app → Insight agent: requests insights
- Insight agent → Groq LLM: requests summary
- Streamlit app → Dataset insights: displays response
- Streamlit app → Analyst agent: submits question
- Analyst agent → Groq LLM: requests analysis
- Streamlit app → Pandas code and explanation: displays response
