# sanjeevans408/statbot-pro architecture

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

- Interactive diagram: https://gitdiagram.com/sanjeevans408/statbot-pro
- Repository: https://github.com/sanjeevans408/statbot-pro

## Overview

StatBot Pro is a command-line CSV analyst: users load a dataset, ask questions answered by a pandas agent or local statistical fallback, and generate charts or run a sandbox security audit. The repository contains overlapping implementations in Graph.py, Sandbox.py, and UI-design.py; README names a lowercase sandbox.py that is absent from the tree, so the graph uses only observed paths. The UI-design.py excerpts show sandboxing, agent callbacks, and CLI behavior, but not a separate graphical UI. Edges reflect excerpted calls or README-documented behavior; unsampled implementation details are omitted.

Main entry points: [`Sandbox.py`](https://github.com/sanjeevans408/statbot-pro/blob/main/Sandbox.py) (Sandbox CLI), [`Graph.py`](https://github.com/sanjeevans408/statbot-pro/blob/main/Graph.py) (Graph CLI), [`UI-design.py`](https://github.com/sanjeevans408/statbot-pro/blob/main/UI-design.py) (UI-design CLI), [`sample.csv`](https://github.com/sanjeevans408/statbot-pro/blob/main/sample.csv) (CSV dataset)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Data input"]
  node_csv["CSV dataset<br/>[sample.csv]"]
  node_loader["Data loader<br/>[Sandbox.py]"]
  node_graph_loader["Data loader<br/>[Graph.py]"]
  node_dataframe["DataFrame"]
end

subgraph group_analysis["Analysis"]
  node_sandbox_cli["Sandbox CLI<br/>[Sandbox.py]"]
  node_graph_cli["Graph CLI<br/>[Graph.py]"]
  node_ui_cli["UI-design CLI<br/>[UI-design.py]"]
  node_agent["Pandas agent<br/>[Sandbox.py]"]
  node_graph_agent["Pandas agent<br/>[Graph.py]"]
  node_nvidia["NVIDIA endpoint"]
  node_retry["Retry handling<br/>[Sandbox.py]"]
  node_local_stats["Local statistics<br/>[Sandbox.py]"]
end

subgraph group_safety["Safety"]
  node_sandbox["Code sandbox<br/>[Sandbox.py]"]
  node_audit["Security audit<br/>[Sandbox.py]"]
  node_ui_sandbox["Code sandbox<br/>[UI-design.py]"]
end

subgraph group_outputs["Results"]
  node_plotter["Local plotting<br/>[Sandbox.py]"]
  node_graph_plotter["Local plotting<br/>[Graph.py]"]
  node_charts["Chart files"]
  node_thoughts["Thought stream<br/>[UI-design.py]"]
end

node_user(("Analyst"))

node_user -->|"enters commands"| node_sandbox_cli
node_sandbox_cli -->|"loads data"| node_loader
node_loader -->|"reads"| node_csv
node_loader -->|"returns"| node_dataframe
node_sandbox_cli -->|"initializes"| node_sandbox
node_sandbox_cli -->|"creates"| node_agent
node_agent -->|"queries"| node_nvidia
node_sandbox_cli -->|"invokes with retries"| node_retry
node_retry -->|"invokes"| node_agent
node_sandbox_cli -->|"falls back to"| node_local_stats
node_sandbox_cli -->|"generates charts"| node_plotter
node_plotter -->|"writes"| node_charts
node_sandbox_cli -->|"runs audit"| node_audit
node_audit -->|"tests isolation"| node_sandbox
node_user -->|"enters commands"| node_graph_cli
node_graph_cli -->|"loads data"| node_graph_loader
node_graph_loader -->|"reads"| node_csv
node_graph_loader -->|"returns"| node_dataframe
node_graph_cli -->|"creates"| node_graph_agent
node_graph_agent -->|"queries"| node_nvidia
node_graph_cli -->|"generates charts"| node_graph_plotter
node_graph_plotter -->|"writes"| node_charts
node_user -.->|"enters commands"| node_ui_cli
node_ui_cli -->|"initializes"| node_ui_sandbox
node_ui_cli -->|"records steps"| node_thoughts
node_ui_cli -.->|"creates"| node_agent

click node_sandbox_cli "https://github.com/sanjeevans408/statbot-pro/blob/main/Sandbox.py"
click node_graph_cli "https://github.com/sanjeevans408/statbot-pro/blob/main/Graph.py"
click node_ui_cli "https://github.com/sanjeevans408/statbot-pro/blob/main/UI-design.py"
click node_csv "https://github.com/sanjeevans408/statbot-pro/blob/main/sample.csv"
click node_loader "https://github.com/sanjeevans408/statbot-pro/blob/main/Sandbox.py"
click node_graph_loader "https://github.com/sanjeevans408/statbot-pro/blob/main/Graph.py"
click node_agent "https://github.com/sanjeevans408/statbot-pro/blob/main/Sandbox.py"
click node_graph_agent "https://github.com/sanjeevans408/statbot-pro/blob/main/Graph.py"
click node_retry "https://github.com/sanjeevans408/statbot-pro/blob/main/Sandbox.py"
click node_local_stats "https://github.com/sanjeevans408/statbot-pro/blob/main/Sandbox.py"
click node_sandbox "https://github.com/sanjeevans408/statbot-pro/blob/main/Sandbox.py"
click node_audit "https://github.com/sanjeevans408/statbot-pro/blob/main/Sandbox.py"
click node_ui_sandbox "https://github.com/sanjeevans408/statbot-pro/blob/main/UI-design.py"
click node_plotter "https://github.com/sanjeevans408/statbot-pro/blob/main/Sandbox.py"
click node_graph_plotter "https://github.com/sanjeevans408/statbot-pro/blob/main/Graph.py"
click node_charts "https://github.com/sanjeevans408/statbot-pro/blob/main/charts"
click node_thoughts "https://github.com/sanjeevans408/statbot-pro/blob/main/UI-design.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_csv,node_loader,node_graph_loader,node_dataframe toneBlue
class node_sandbox_cli,node_graph_cli,node_ui_cli,node_agent,node_graph_agent,node_nvidia,node_retry,node_local_stats toneAmber
class node_sandbox,node_audit,node_ui_sandbox toneMint
class node_plotter,node_graph_plotter,node_charts,node_thoughts toneRose
class node_user toneIndigo
```

## Components

### Data input

- [CSV dataset](https://github.com/sanjeevans408/statbot-pro/blob/main/sample.csv): `sample.csv`
- [Data loader](https://github.com/sanjeevans408/statbot-pro/blob/main/Sandbox.py): `Sandbox.py`
- [Data loader](https://github.com/sanjeevans408/statbot-pro/blob/main/Graph.py): `Graph.py`
- **DataFrame**

### Analysis

- [Sandbox CLI](https://github.com/sanjeevans408/statbot-pro/blob/main/Sandbox.py): `Sandbox.py`
- [Graph CLI](https://github.com/sanjeevans408/statbot-pro/blob/main/Graph.py): `Graph.py`
- [UI-design CLI](https://github.com/sanjeevans408/statbot-pro/blob/main/UI-design.py): `UI-design.py`
- [Pandas agent](https://github.com/sanjeevans408/statbot-pro/blob/main/Sandbox.py): `Sandbox.py`
- [Pandas agent](https://github.com/sanjeevans408/statbot-pro/blob/main/Graph.py): `Graph.py`
- **NVIDIA endpoint**
- [Retry handling](https://github.com/sanjeevans408/statbot-pro/blob/main/Sandbox.py): `Sandbox.py`
- [Local statistics](https://github.com/sanjeevans408/statbot-pro/blob/main/Sandbox.py): `Sandbox.py`

### Safety

- [Code sandbox](https://github.com/sanjeevans408/statbot-pro/blob/main/Sandbox.py): `Sandbox.py`
- [Security audit](https://github.com/sanjeevans408/statbot-pro/blob/main/Sandbox.py): `Sandbox.py`
- [Code sandbox](https://github.com/sanjeevans408/statbot-pro/blob/main/UI-design.py): `UI-design.py`

### Results

- [Local plotting](https://github.com/sanjeevans408/statbot-pro/blob/main/Sandbox.py): `Sandbox.py`
- [Local plotting](https://github.com/sanjeevans408/statbot-pro/blob/main/Graph.py): `Graph.py`
- [Chart files](https://github.com/sanjeevans408/statbot-pro/blob/main/charts): `charts`
- [Thought stream](https://github.com/sanjeevans408/statbot-pro/blob/main/UI-design.py): `UI-design.py`

### Other components

- **Analyst**

## Connections

- Analyst → Sandbox CLI: enters commands (evidence: `README.md`)
- Sandbox CLI → Data loader: loads data (evidence: `Sandbox.py`)
- Data loader → CSV dataset: reads (evidence: `Sandbox.py`)
- Data loader → DataFrame: returns (evidence: `Sandbox.py`)
- Sandbox CLI → Code sandbox: initializes (evidence: `Sandbox.py`)
- Sandbox CLI → Pandas agent: creates (evidence: `Sandbox.py`)
- Pandas agent → NVIDIA endpoint: queries (evidence: `Sandbox.py`)
- Sandbox CLI → Retry handling: invokes with retries (evidence: `Sandbox.py`)
- Retry handling → Pandas agent: invokes (evidence: `Sandbox.py`)
- Sandbox CLI → Local statistics: falls back to (evidence: `Sandbox.py`)
- Sandbox CLI → Local plotting: generates charts (evidence: `Sandbox.py`)
- Local plotting → Chart files: writes (evidence: `Sandbox.py`)
- Sandbox CLI → Security audit: runs audit (evidence: `Sandbox.py`)
- Security audit → Code sandbox: tests isolation (evidence: `Sandbox.py`)
- Analyst → Graph CLI: enters commands (evidence: `Graph.py`)
- Graph CLI → Data loader: loads data (evidence: `Graph.py`)
- Data loader → CSV dataset: reads (evidence: `Graph.py`)
- Data loader → DataFrame: returns (evidence: `Graph.py`)
- Graph CLI → Pandas agent: creates (evidence: `Graph.py`)
- Pandas agent → NVIDIA endpoint: queries (evidence: `Graph.py`)
- Graph CLI → Local plotting: generates charts (evidence: `Graph.py`)
- Local plotting → Chart files: writes (evidence: `Graph.py`)
- Analyst → UI-design CLI: enters commands (evidence: `README.md`)
- UI-design CLI → Code sandbox: initializes (evidence: `UI-design.py`)
- UI-design CLI → Thought stream: records steps (evidence: `UI-design.py`)
- UI-design CLI → Pandas agent: creates
