# abhishekadbhute-create/agenticdataanalysis architecture

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

- Interactive diagram: https://gitdiagram.com/abhishekadbhute-create/agenticdataanalysis
- Repository: https://github.com/abhishekadbhute-create/agenticdataanalysis

## Overview

This is a Streamlit data-analysis dashboard: users upload or select CSV files, describe datasets, then ask questions about selected data in a chat. The chatbot runs a LangGraph agent that can request Python analysis; results, generated Plotly figures, and intermediate steps appear in the dashboard. The graph shows the documented upload, description, chat, analysis, visualization, and debug capabilities. Source excerpts show the main calls and file I/O; unsampled internals are not inferred.

Main entry points: [`Pages/python_visualisation_agent.py`](https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/python_visualisation_agent.py) (Data Dashboard), [`Pages/backend.py`](https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/backend.py) (Chatbot Backend), [`Pages/graph/nodes.py`](https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/graph/nodes.py) (Agent and Routing), [`Pages/graph/tools.py`](https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/graph/tools.py) (Python Analysis Tool)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_app["Streamlit Entry"]
  node_page["Data Dashboard"]
  node_debug["Intermediate Outputs"]
end

subgraph group_agent["Analysis Agent"]
  node_chatbot["Chatbot Backend<br/>[backend.py]"]
  node_state["Agent State<br/>[state.py]"]
  node_inputdata["Input Data Model<br/>[data_models.py]"]
  node_agentnodes["Agent and Routing<br/>[nodes.py]"]
  node_prompt["Agent Prompt<br/>[main_prompt.md]"]
end

subgraph group_execution["Python Execution"]
  node_tool["Python Analysis Tool<br/>[tools.py]"]
  node_csvdata["Loaded DataFrames<br/>[tools.py]"]
end

subgraph group_artifacts["Data and Results"]
  node_descriptions["Dataset Descriptions"]
  node_uploads["Uploaded CSVs"]
  node_figures["Saved Plotly Figures<br/>[tools.py]"]
end

node_user(("Analyst"))
node_llm{{"OpenAI Model"}}

node_user -->|"uploads and queries"| node_page
node_app -->|"navigates to"| node_page
node_page -->|"saves and lists"| node_uploads
node_page -->|"reads and updates"| node_descriptions
node_page -->|"builds inputs"| node_inputdata
node_page -->|"submits query"| node_chatbot
node_chatbot -->|"builds graph"| node_state
node_chatbot -->|"registers and invokes"| node_agentnodes
node_agentnodes -->|"loads prompt"| node_prompt
node_agentnodes -->|"invokes model"| node_llm
node_agentnodes -->|"dispatches tool calls"| node_tool
node_tool -->|"loads CSVs"| node_csvdata
node_tool -->|"saves figures"| node_figures
node_page -->|"loads and displays"| node_figures
node_page -->|"displays outputs"| node_debug
node_chatbot -->|"returns chat and results"| node_page

click node_app "https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/data_analysis_streamlit_app.py"
click node_page "https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/python_visualisation_agent.py"
click node_descriptions "https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/data_dictionary.json"
click node_uploads "https://github.com/abhishekadbhute-create/agenticdataanalysis/tree/master/uploads"
click node_chatbot "https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/backend.py"
click node_state "https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/graph/state.py"
click node_inputdata "https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/data_models.py"
click node_agentnodes "https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/graph/nodes.py"
click node_prompt "https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/prompts/main_prompt.md"
click node_tool "https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/graph/tools.py"
click node_csvdata "https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/graph/tools.py"
click node_figures "https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/graph/tools.py"
click node_debug "https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/python_visualisation_agent.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_page,node_debug toneBlue
class node_chatbot,node_state,node_inputdata,node_agentnodes,node_prompt toneAmber
class node_tool,node_csvdata toneMint
class node_descriptions,node_uploads,node_figures toneRose
class node_user,node_llm toneIndigo
```

## Components

### Dashboard

- [Streamlit Entry](https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/data_analysis_streamlit_app.py): `data_analysis_streamlit_app.py`
- [Data Dashboard](https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/python_visualisation_agent.py): `Pages/python_visualisation_agent.py`
- [Intermediate Outputs](https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/python_visualisation_agent.py): `Pages/python_visualisation_agent.py`

### Analysis Agent

- [Chatbot Backend](https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/backend.py): `Pages/backend.py`
- [Agent State](https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/graph/state.py): `Pages/graph/state.py`
- [Input Data Model](https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/data_models.py): `Pages/data_models.py`
- [Agent and Routing](https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/graph/nodes.py): `Pages/graph/nodes.py`
- [Agent Prompt](https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/prompts/main_prompt.md): `Pages/prompts/main_prompt.md`

### Python Execution

- [Python Analysis Tool](https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/graph/tools.py): `Pages/graph/tools.py`
- [Loaded DataFrames](https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/graph/tools.py): `Pages/graph/tools.py`

### Data and Results

- [Dataset Descriptions](https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/data_dictionary.json): `data_dictionary.json`
- [Uploaded CSVs](https://github.com/abhishekadbhute-create/agenticdataanalysis/tree/master/uploads): `uploads`
- [Saved Plotly Figures](https://github.com/abhishekadbhute-create/agenticdataanalysis/blob/master/Pages/graph/tools.py): `Pages/graph/tools.py`

### Other components

- **Analyst**
- **OpenAI Model**

## Connections

- Analyst → Data Dashboard: uploads and queries (evidence: `Pages/python_visualisation_agent.py`)
- Streamlit Entry → Data Dashboard: navigates to (evidence: `data_analysis_streamlit_app.py`)
- Data Dashboard → Uploaded CSVs: saves and lists (evidence: `Pages/python_visualisation_agent.py`)
- Data Dashboard → Dataset Descriptions: reads and updates (evidence: `Pages/python_visualisation_agent.py`)
- Data Dashboard → Input Data Model: builds inputs (evidence: `Pages/python_visualisation_agent.py`)
- Data Dashboard → Chatbot Backend: submits query (evidence: `Pages/python_visualisation_agent.py`)
- Chatbot Backend → Agent State: builds graph (evidence: `Pages/backend.py`)
- Chatbot Backend → Agent and Routing: registers and invokes (evidence: `Pages/backend.py`)
- Agent and Routing → Agent Prompt: loads prompt (evidence: `Pages/graph/nodes.py`)
- Agent and Routing → OpenAI Model: invokes model (evidence: `Pages/graph/nodes.py`)
- Agent and Routing → Python Analysis Tool: dispatches tool calls (evidence: `Pages/graph/nodes.py`)
- Python Analysis Tool → Loaded DataFrames: loads CSVs (evidence: `Pages/graph/tools.py`)
- Python Analysis Tool → Saved Plotly Figures: saves figures (evidence: `Pages/graph/tools.py`)
- Data Dashboard → Saved Plotly Figures: loads and displays (evidence: `Pages/python_visualisation_agent.py`)
- Data Dashboard → Intermediate Outputs: displays outputs (evidence: `Pages/python_visualisation_agent.py`)
- Chatbot Backend → Data Dashboard: returns chat and results (evidence: `Pages/python_visualisation_agent.py`)
