# chittaranjanp51/data_analyzer_gpt architecture

> Architecture diagram of the GitHub repository chittaranjanp51/data_analyzer_gpt, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chittaranjanp51/data_analyzer_gpt
- Repository: https://github.com/chittaranjanp51/data_analyzer_gpt

## Overview

AutoGen Data Analyzer GPT turns an uploaded CSV and plain-English question into a Markdown report and charts. Users enter through the Streamlit app or CLI; both call the analysis runner, which stages the input, configures an executor, and runs either a six-stage agent team or a quick analyst team. In the full workflow, agents clean data, engineer features, analyze results, visualize findings, and report them, passing work through files. The README documents stage handoffs and optional Docker/local execution; unsampled internals are represented only where documented.

Main entry points: [`data_analyzer/pipeline.py`](https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/pipeline.py) (Analysis runner), [`data_analyzer/executor.py`](https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/executor.py) (Code executor), [`data_analyzer/prompts.py`](https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/prompts.py) (DataCleaner), [`data_analyzer/team.py`](https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/team.py) (Team orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_streamlit["Streamlit UI<br/>[app.py]"]
  node_cli["CLI runner<br/>[main.py]"]
end

subgraph group_runtime["Analysis runtime"]
  node_runner["Analysis runner<br/>[pipeline.py]"]
  node_teams["Team orchestration<br/>[team.py]"]
  node_prompts["Agent instructions<br/>[prompts.py]"]
  node_settings["Runtime settings<br/>[config.py]"]
  node_executor["Code executor<br/>[executor.py]"]
  node_helpers["Cleaning toolkit<br/>[helpers.py]"]
end

subgraph group_stages["Agent workflow"]
  node_loader["DataLoader<br/>[prompts.py]"]
  node_cleaner["DataCleaner<br/>[prompts.py]"]
  node_engineer["FeatureEngineer<br/>[prompts.py]"]
  node_analyzer["DataAnalyzer<br/>[prompts.py]"]
  node_visualizer["Visualizer<br/>[prompts.py]"]
  node_reporter["ReportGenerator<br/>[prompts.py]"]
  node_quick["Quick analyst<br/>[prompts.py]"]
end

subgraph group_artifacts["Run artifacts"]
  node_input["Input CSV"]
  node_cleaned["Cleaned data"]
  node_features["Feature data"]
  node_results["Report and plots"]
end

node_user(("Analyst"))
node_openai(("OpenAI model API"))

node_user -->|"uploads and asks"| node_streamlit
node_user -->|"provides CSV and question"| node_cli
node_streamlit -->|"calls analysis"| node_runner
node_cli -->|"calls analysis"| node_runner
node_runner -->|"builds and runs"| node_teams
node_runner -->|"creates and prepares"| node_executor
node_executor -->|"reads settings"| node_settings
node_runner -->|"reads settings"| node_settings
node_teams -->|"uses instructions"| node_prompts
node_teams -->|"dispatches stage"| node_loader
node_loader -->|"passes data"| node_cleaner
node_cleaner -->|"passes data"| node_engineer
node_engineer -->|"passes data"| node_analyzer
node_analyzer -->|"passes findings"| node_visualizer
node_visualizer -->|"passes charts"| node_reporter
node_teams -->|"selects quick mode"| node_quick
node_quick -->|"submits code"| node_executor
node_loader -->|"submits code"| node_executor
node_cleaner -->|"submits code"| node_executor
node_engineer -->|"submits code"| node_executor
node_analyzer -->|"submits code"| node_executor
node_visualizer -->|"submits code"| node_executor
node_runner -->|"copies CSV"| node_input
node_runner -->|"copies toolkit"| node_helpers
node_cleaner -->|"uses cleaning functions"| node_helpers
node_loader -->|"reads CSV"| node_input
node_cleaner -->|"writes cleaned data"| node_cleaned
node_engineer -->|"reads cleaned data"| node_cleaned
node_engineer -->|"writes features"| node_features
node_analyzer -->|"reads features"| node_features
node_visualizer -->|"reads features"| node_features
node_visualizer -->|"writes charts"| node_results
node_reporter -->|"writes report"| node_results
node_runner -->|"collects report and plots"| node_results
node_runner -.->|"uses model client"| node_openai
node_runner -->|"streams messages and result"| node_streamlit
node_runner -->|"yields messages and result"| node_cli

click node_streamlit "https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/app.py"
click node_cli "https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/main.py"
click node_runner "https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/pipeline.py"
click node_teams "https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/team.py"
click node_prompts "https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/prompts.py"
click node_settings "https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/config.py"
click node_executor "https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/executor.py"
click node_helpers "https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/helpers.py"
click node_loader "https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/prompts.py"
click node_cleaner "https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/prompts.py"
click node_engineer "https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/prompts.py"
click node_analyzer "https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/prompts.py"
click node_visualizer "https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/prompts.py"
click node_reporter "https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/prompts.py"
click node_quick "https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/prompts.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_streamlit,node_cli toneBlue
class node_runner,node_teams,node_prompts,node_settings,node_executor,node_helpers toneAmber
class node_loader,node_cleaner,node_engineer,node_analyzer,node_visualizer,node_reporter,node_quick,node_openai toneMint
class node_input,node_cleaned,node_features,node_results toneRose
class node_user toneIndigo
```

## Components

### User interfaces

- [Streamlit UI](https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/app.py): `app.py`
- [CLI runner](https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/main.py): `main.py`

### Analysis runtime

- [Analysis runner](https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/pipeline.py): `data_analyzer/pipeline.py`
- [Team orchestration](https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/team.py): `data_analyzer/team.py`
- [Agent instructions](https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/prompts.py): `data_analyzer/prompts.py`
- [Runtime settings](https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/config.py): `data_analyzer/config.py`
- [Code executor](https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/executor.py): `data_analyzer/executor.py`
- [Cleaning toolkit](https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/helpers.py): `data_analyzer/helpers.py`

### Agent workflow

- [DataLoader](https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/prompts.py): `data_analyzer/prompts.py`
- [DataCleaner](https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/prompts.py): `data_analyzer/prompts.py`
- [FeatureEngineer](https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/prompts.py): `data_analyzer/prompts.py`
- [DataAnalyzer](https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/prompts.py): `data_analyzer/prompts.py`
- [Visualizer](https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/prompts.py): `data_analyzer/prompts.py`
- [ReportGenerator](https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/prompts.py): `data_analyzer/prompts.py`
- [Quick analyst](https://github.com/chittaranjanp51/data_analyzer_gpt/blob/main/data_analyzer/prompts.py): `data_analyzer/prompts.py`

### Run artifacts

- **Input CSV**
- **Cleaned data**
- **Feature data**
- **Report and plots**

### Other components

- **Analyst**
- **OpenAI model API**

## Connections

- Analyst → Streamlit UI: uploads and asks (evidence: `README.md`)
- Analyst → CLI runner: provides CSV and question (evidence: `README.md`)
- Streamlit UI → Analysis runner: calls analysis (evidence: `app.py`)
- CLI runner → Analysis runner: calls analysis (evidence: `main.py`)
- Analysis runner → Team orchestration: builds and runs (evidence: `data_analyzer/pipeline.py`)
- Analysis runner → Code executor: creates and prepares (evidence: `data_analyzer/pipeline.py`)
- Code executor → Runtime settings: reads settings (evidence: `data_analyzer/executor.py`)
- Analysis runner → Runtime settings: reads settings (evidence: `data_analyzer/pipeline.py`)
- Team orchestration → Agent instructions: uses instructions (evidence: `data_analyzer/team.py`)
- Team orchestration → DataLoader: dispatches stage (evidence: `README.md`)
- DataLoader → DataCleaner: passes data (evidence: `README.md`)
- DataCleaner → FeatureEngineer: passes data (evidence: `README.md`)
- FeatureEngineer → DataAnalyzer: passes data (evidence: `README.md`)
- DataAnalyzer → Visualizer: passes findings (evidence: `README.md`)
- Visualizer → ReportGenerator: passes charts (evidence: `README.md`)
- Team orchestration → Quick analyst: selects quick mode (evidence: `README.md`)
- Quick analyst → Code executor: submits code (evidence: `README.md`)
- DataLoader → Code executor: submits code (evidence: `README.md`)
- DataCleaner → Code executor: submits code (evidence: `README.md`)
- FeatureEngineer → Code executor: submits code (evidence: `README.md`)
- DataAnalyzer → Code executor: submits code (evidence: `README.md`)
- Visualizer → Code executor: submits code (evidence: `README.md`)
- Analysis runner → Input CSV: copies CSV (evidence: `data_analyzer/pipeline.py`)
- Analysis runner → Cleaning toolkit: copies toolkit (evidence: `data_analyzer/pipeline.py`)
- DataCleaner → Cleaning toolkit: uses cleaning functions (evidence: `README.md`)
- DataLoader → Input CSV: reads CSV (evidence: `README.md`)
- DataCleaner → Cleaned data: writes cleaned data (evidence: `README.md`)
- FeatureEngineer → Cleaned data: reads cleaned data (evidence: `README.md`)
- FeatureEngineer → Feature data: writes features (evidence: `README.md`)
- DataAnalyzer → Feature data: reads features (evidence: `README.md`)
- Visualizer → Feature data: reads features (evidence: `README.md`)
- Visualizer → Report and plots: writes charts (evidence: `README.md`)
- ReportGenerator → Report and plots: writes report (evidence: `README.md`)
- Analysis runner → Report and plots: collects report and plots (evidence: `data_analyzer/pipeline.py`)
- Analysis runner → OpenAI model API: uses model client
- Analysis runner → Streamlit UI: streams messages and result (evidence: `app.py`)
- Analysis runner → CLI runner: yields messages and result (evidence: `main.py`)
