# makarand-kulkarni1/autonomous-data-scientist-agent architecture

> Architecture diagram of the GitHub repository makarand-kulkarni1/autonomous-data-scientist-agent, 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/makarand-kulkarni1/autonomous-data-scientist-agent
- Repository: https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent

## Overview

This is an autonomous data-science application: a user submits a CSV and prediction goal, then receives a trained model, evaluation outputs, and run reports. The main runtime path profiles the dataset, creates a validated plan, generates and sandbox-executes code, reviews each successful step, and retries rejected work before advancing. The README documents tracking, resumable runs, benchmarking, and both API and Streamlit interfaces. Some of those implementations were not excerpted, so their connections are shown only where documented.

Main entry points: [`src/orchestrator.py`](https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/orchestrator.py) (Pipeline orchestrator), [`api/main.py`](https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/api/main.py) (Run API), [`src/llm.py`](https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/llm.py) (LLM client), [`src/agents/planner.py`](https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/agents/planner.py) (Plan generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interfaces"]
  node_streamlit["Streamlit UI<br/>[streamlit_app.py]"]
  node_api["Run API<br/>[main.py]"]
end

subgraph group_workflow["Run orchestration"]
  node_orchestrator["Pipeline orchestrator<br/>[orchestrator.py]"]
  node_profiler["Dataset profiler<br/>[profiler.py]"]
end

subgraph group_agents["Agent execution"]
  node_planner["Plan generation<br/>[planner.py]"]
  node_schemas["Plan validation<br/>[schemas.py]"]
  node_coder["Code generation<br/>[coder.py]"]
  node_sandbox["Code sandbox<br/>[sandbox.py]"]
  node_reviewer["Step review<br/>[reviewer.py]"]
  node_llm["LLM client<br/>[llm.py]"]
end

subgraph group_outputs["Evaluation and records"]
  node_metrics["Metric contract"]
  node_tracking["Run tracking<br/>[tracking.py]"]
  node_evaluation["Benchmark evaluation<br/>[evaluation.py]"]
  node_report["Report generation<br/>[report.py]"]
end

node_user(("Dataset user"))
node_llm_service{{"LLM provider"}}
node_docker{{"Docker runtime"}}
node_mlflow{{"MLflow service"}}

node_user -->|"submits CSV"| node_streamlit
node_streamlit -.->|"starts run"| node_api
node_user -->|"uploads CSV"| node_api
node_api -->|"runs pipeline"| node_orchestrator
node_api -->|"generates reports"| node_report
node_orchestrator -->|"profiles data"| node_profiler
node_orchestrator -->|"requests plan"| node_planner
node_planner -->|"validates plan"| node_schemas
node_planner -->|"requests plan"| node_llm
node_orchestrator -->|"solves steps"| node_coder
node_coder -->|"generates code"| node_llm
node_coder -->|"executes code"| node_sandbox
node_sandbox -->|"runs container"| node_docker
node_orchestrator -->|"reviews output"| node_reviewer
node_reviewer -->|"judges step"| node_llm
node_llm -->|"sends prompts"| node_llm_service
node_orchestrator -->|"validates metric"| node_metrics
node_orchestrator -.->|"records run"| node_tracking
node_tracking -.->|"logs run"| node_mlflow
node_user -.->|"requests benchmark"| node_evaluation
node_report -->|"reads run result"| node_orchestrator

click node_streamlit "https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/app/streamlit_app.py"
click node_api "https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/api/main.py"
click node_orchestrator "https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/orchestrator.py"
click node_profiler "https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/profiler.py"
click node_planner "https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/agents/planner.py"
click node_schemas "https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/schemas.py"
click node_coder "https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/agents/coder.py"
click node_sandbox "https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/sandbox.py"
click node_reviewer "https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/agents/reviewer.py"
click node_llm "https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/llm.py"
click node_metrics "https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/metrics_contract.py"
click node_tracking "https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/tracking.py"
click node_evaluation "https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/evaluation.py"
click node_report "https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/report.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_api,node_user toneBlue
class node_orchestrator,node_profiler toneAmber
class node_planner,node_schemas,node_coder,node_sandbox,node_reviewer,node_llm toneMint
class node_metrics,node_tracking,node_evaluation,node_report toneRose
class node_llm_service,node_docker,node_mlflow toneIndigo
```

## Components

### User interfaces

- [Streamlit UI](https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/app/streamlit_app.py): `app/streamlit_app.py`
- [Run API](https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/api/main.py): `api/main.py`

### Run orchestration

- [Pipeline orchestrator](https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/orchestrator.py): `src/orchestrator.py`
- [Dataset profiler](https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/profiler.py): `src/profiler.py`

### Agent execution

- [Plan generation](https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/agents/planner.py): `src/agents/planner.py`
- [Plan validation](https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/schemas.py): `src/schemas.py`
- [Code generation](https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/agents/coder.py): `src/agents/coder.py`
- [Code sandbox](https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/sandbox.py): `src/sandbox.py`
- [Step review](https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/agents/reviewer.py): `src/agents/reviewer.py`
- [LLM client](https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/llm.py): `src/llm.py`

### Evaluation and records

- [Metric contract](https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/metrics_contract.py): `src/metrics_contract.py`
- [Run tracking](https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/tracking.py): `src/tracking.py`
- [Benchmark evaluation](https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/evaluation.py): `src/evaluation.py`
- [Report generation](https://github.com/makarand-kulkarni1/autonomous-data-scientist-agent/blob/main/src/report.py): `src/report.py`

### Other components

- **Dataset user**
- **LLM provider**
- **Docker runtime**
- **MLflow service**

## Connections

- Dataset user → Streamlit UI: submits CSV (evidence: `README.md`)
- Streamlit UI → Run API: starts run (evidence: `README.md`)
- Dataset user → Run API: uploads CSV (evidence: `README.md`)
- Run API → Pipeline orchestrator: runs pipeline (evidence: `api/main.py`)
- Run API → Report generation: generates reports (evidence: `api/main.py`)
- Pipeline orchestrator → Dataset profiler: profiles data (evidence: `src/orchestrator.py`)
- Pipeline orchestrator → Plan generation: requests plan (evidence: `src/orchestrator.py`)
- Plan generation → Plan validation: validates plan (evidence: `src/agents/planner.py`)
- Plan generation → LLM client: requests plan (evidence: `src/agents/planner.py`)
- Pipeline orchestrator → Code generation: solves steps (evidence: `src/orchestrator.py`)
- Code generation → LLM client: generates code (evidence: `src/agents/coder.py`)
- Code generation → Code sandbox: executes code (evidence: `src/agents/coder.py`)
- Code sandbox → Docker runtime: runs container (evidence: `src/sandbox.py`)
- Pipeline orchestrator → Step review: reviews output (evidence: `src/orchestrator.py`)
- Step review → LLM client: judges step (evidence: `src/agents/reviewer.py`)
- LLM client → LLM provider: sends prompts (evidence: `src/llm.py`)
- Pipeline orchestrator → Metric contract: validates metric (evidence: `src/orchestrator.py`)
- Pipeline orchestrator → Run tracking: records run (evidence: `README.md`)
- Run tracking → MLflow service: logs run (evidence: `README.md`)
- Dataset user → Benchmark evaluation: requests benchmark (evidence: `README.md`)
- Report generation → Pipeline orchestrator: reads run result (evidence: `src/report.py`)
