# kartik00052/phronesisml architecture

> Architecture diagram of the GitHub repository kartik00052/phronesisml, 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/kartik00052/phronesisml
- Repository: https://github.com/kartik00052/phronesisml

## Overview

PhronesisML is an offline-first, SDK- and CLI-first machine-learning lifecycle tool, with a web application for managing runs and inspecting results. The main workflow accepts a dataset, prepares and validates it, profiles it, detects a target, engineers features, trains and evaluates models, then produces explanations and artifacts. The README documents the cooperating-agent lifecycle; source excerpts establish only selected implementation links, so unsampled wiring is omitted or marked unverified.

Main entry points: [`phronesisml/workflow/graph.py`](https://github.com/kartik00052/phronesisml/blob/main/phronesisml/workflow/graph.py) (Agent Workflow), [`backend/app/services/pipeline_service.py`](https://github.com/kartik00052/phronesisml/blob/main/backend/app/services/pipeline_service.py) (Pipeline Progress), [`phronesisml/__init__.py`](https://github.com/kartik00052/phronesisml/blob/main/phronesisml/__init__.py) (Python SDK), [`phronesisml/agents/reporting/agent.py`](https://github.com/kartik00052/phronesisml/blob/main/phronesisml/agents/reporting/agent.py) (Reports and Artifacts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User Interfaces"]
  node_sdk["Python SDK<br/>[__init__.py]"]
  node_cli["CLI<br/>[app.py]"]
end

subgraph group_orchestration["Workflow and Data"]
  node_workflow["Agent Workflow<br/>[graph.py]"]
  node_engine_select["Engine Selection<br/>[engine_selector.py]"]
  node_engines["Data Engines<br/>[base_engine.py]"]
  node_etl["ETL and Cleaning<br/>[etl.py]"]
  node_validation["Data Validation<br/>[validation.py]"]
  node_eda["Dataset Profiling<br/>[eda.py]"]
end

subgraph group_ml["Modeling and Results"]
  node_target["Target Detection<br/>[agent.py]"]
  node_features["Feature Engineering<br/>[agent.py]"]
  node_modeling["Model Selection<br/>[agent.py]"]
  node_training["AutoML Training<br/>[trainer.py]"]
  node_specialized_ml["Specialized ML<br/>[algorithms.py]"]
  node_evaluation["Model Evaluation<br/>[agent.py]"]
  node_explainability["Explainability<br/>[agent.py]"]
  node_reporting["Reports and Artifacts<br/>[agent.py]"]
  node_storage["Artifact Storage<br/>[storage.py]"]
end

subgraph group_web["Web Run Management"]
  node_web_ui["Run Management UI<br/>[index.tsx]"]
  node_web_api["Backend API<br/>[main.py]"]
  node_pipeline_router["Pipeline Routes<br/>[pipeline.py]"]
  node_pipeline_service["Pipeline Progress"]
  node_repositories[("Run Persistence<br/>[repositories.py]")]
  node_runner["Run Worker<br/>[runner.py]"]
end

node_user(("Data Scientist"))
node_web_user(("Web User"))

node_user -->|"uses"| node_sdk
node_user -->|"invokes"| node_cli
node_cli -->|"calls pipeline"| node_sdk
node_sdk -.->|"starts workflow"| node_workflow
node_workflow -.->|"dispatches stage"| node_etl
node_workflow -.->|"dispatches stage"| node_validation
node_workflow -.->|"dispatches stage"| node_eda
node_workflow -.->|"dispatches stage"| node_target
node_workflow -.->|"dispatches stage"| node_features
node_workflow -.->|"dispatches stage"| node_modeling
node_workflow -.->|"dispatches stage"| node_evaluation
node_workflow -.->|"dispatches stage"| node_explainability
node_workflow -.->|"dispatches stage"| node_reporting
node_workflow -.->|"selects engine"| node_engine_select
node_engine_select -.->|"chooses backend"| node_engines
node_features -->|"uses engine"| node_engines
node_modeling -.->|"trains candidates"| node_training
node_workflow -.->|"offers capability"| node_specialized_ml
node_reporting -.->|"persists artifacts"| node_storage
node_storage -->|"uses report builder"| node_reporting
node_web_user -.->|"manages runs"| node_web_ui
node_web_ui -.->|"requests data"| node_web_api
node_web_api -->|"mounts routes"| node_pipeline_router
node_pipeline_router -->|"queries progress"| node_pipeline_service
node_pipeline_service -->|"reads run state"| node_repositories
node_pipeline_service -->|"references runner"| node_runner

click node_sdk "https://github.com/kartik00052/phronesisml/blob/main/phronesisml/__init__.py"
click node_cli "https://github.com/kartik00052/phronesisml/blob/main/phronesisml/interfaces/cli/app.py"
click node_workflow "https://github.com/kartik00052/phronesisml/blob/main/phronesisml/workflow/graph.py"
click node_engine_select "https://github.com/kartik00052/phronesisml/blob/main/phronesisml/engines/engine_selector.py"
click node_engines "https://github.com/kartik00052/phronesisml/blob/main/phronesisml/engines/base_engine.py"
click node_etl "https://github.com/kartik00052/phronesisml/blob/main/phronesisml/data/etl.py"
click node_validation "https://github.com/kartik00052/phronesisml/blob/main/phronesisml/data/validation.py"
click node_eda "https://github.com/kartik00052/phronesisml/blob/main/phronesisml/data/eda.py"
click node_target "https://github.com/kartik00052/phronesisml/blob/main/phronesisml/agents/target_detection/agent.py"
click node_features "https://github.com/kartik00052/phronesisml/blob/main/phronesisml/agents/feature_engineering/agent.py"
click node_modeling "https://github.com/kartik00052/phronesisml/blob/main/phronesisml/agents/model_selection/agent.py"
click node_training "https://github.com/kartik00052/phronesisml/blob/main/phronesisml/ml/automl/trainer.py"
click node_specialized_ml "https://github.com/kartik00052/phronesisml/blob/main/phronesisml/ml/clustering/algorithms.py"
click node_evaluation "https://github.com/kartik00052/phronesisml/blob/main/phronesisml/agents/evaluation/agent.py"
click node_explainability "https://github.com/kartik00052/phronesisml/blob/main/phronesisml/agents/explainability/agent.py"
click node_reporting "https://github.com/kartik00052/phronesisml/blob/main/phronesisml/agents/reporting/agent.py"
click node_storage "https://github.com/kartik00052/phronesisml/blob/main/phronesisml/services/storage.py"
click node_web_ui "https://github.com/kartik00052/phronesisml/blob/main/frontend/src/pages/runs/index.tsx"
click node_web_api "https://github.com/kartik00052/phronesisml/blob/main/backend/app/main.py"
click node_pipeline_router "https://github.com/kartik00052/phronesisml/blob/main/backend/app/api/v1/pipeline.py"
click node_pipeline_service "https://github.com/kartik00052/phronesisml/blob/main/backend/app/services/pipeline_service.py"
click node_repositories "https://github.com/kartik00052/phronesisml/blob/main/backend/app/db/repositories.py"
click node_runner "https://github.com/kartik00052/phronesisml/blob/main/backend/app/workers/runner.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_sdk,node_cli,node_web_user toneBlue
class node_workflow,node_engine_select,node_engines,node_etl,node_validation,node_eda toneAmber
class node_target,node_features,node_modeling,node_training,node_specialized_ml,node_evaluation,node_explainability,node_reporting,node_storage toneMint
class node_web_ui,node_web_api,node_pipeline_router,node_pipeline_service,node_repositories,node_runner toneRose
class node_user toneIndigo
```

## Components

### User Interfaces

- [Python SDK](https://github.com/kartik00052/phronesisml/blob/main/phronesisml/__init__.py): `phronesisml/__init__.py`
- [CLI](https://github.com/kartik00052/phronesisml/blob/main/phronesisml/interfaces/cli/app.py): `phronesisml/interfaces/cli/app.py`

### Workflow and Data

- [Agent Workflow](https://github.com/kartik00052/phronesisml/blob/main/phronesisml/workflow/graph.py): `phronesisml/workflow/graph.py`
- [Engine Selection](https://github.com/kartik00052/phronesisml/blob/main/phronesisml/engines/engine_selector.py): `phronesisml/engines/engine_selector.py`
- [Data Engines](https://github.com/kartik00052/phronesisml/blob/main/phronesisml/engines/base_engine.py): `phronesisml/engines/base_engine.py`
- [ETL and Cleaning](https://github.com/kartik00052/phronesisml/blob/main/phronesisml/data/etl.py): `phronesisml/data/etl.py`
- [Data Validation](https://github.com/kartik00052/phronesisml/blob/main/phronesisml/data/validation.py): `phronesisml/data/validation.py`
- [Dataset Profiling](https://github.com/kartik00052/phronesisml/blob/main/phronesisml/data/eda.py): `phronesisml/data/eda.py`

### Modeling and Results

- [Target Detection](https://github.com/kartik00052/phronesisml/blob/main/phronesisml/agents/target_detection/agent.py): `phronesisml/agents/target_detection/agent.py`
- [Feature Engineering](https://github.com/kartik00052/phronesisml/blob/main/phronesisml/agents/feature_engineering/agent.py): `phronesisml/agents/feature_engineering/agent.py`
- [Model Selection](https://github.com/kartik00052/phronesisml/blob/main/phronesisml/agents/model_selection/agent.py): `phronesisml/agents/model_selection/agent.py`
- [AutoML Training](https://github.com/kartik00052/phronesisml/blob/main/phronesisml/ml/automl/trainer.py): `phronesisml/ml/automl/trainer.py`
- [Specialized ML](https://github.com/kartik00052/phronesisml/blob/main/phronesisml/ml/clustering/algorithms.py): `phronesisml/ml/clustering/algorithms.py`
- [Model Evaluation](https://github.com/kartik00052/phronesisml/blob/main/phronesisml/agents/evaluation/agent.py): `phronesisml/agents/evaluation/agent.py`
- [Explainability](https://github.com/kartik00052/phronesisml/blob/main/phronesisml/agents/explainability/agent.py): `phronesisml/agents/explainability/agent.py`
- [Reports and Artifacts](https://github.com/kartik00052/phronesisml/blob/main/phronesisml/agents/reporting/agent.py): `phronesisml/agents/reporting/agent.py`
- [Artifact Storage](https://github.com/kartik00052/phronesisml/blob/main/phronesisml/services/storage.py): `phronesisml/services/storage.py`

### Web Run Management

- [Run Management UI](https://github.com/kartik00052/phronesisml/blob/main/frontend/src/pages/runs/index.tsx): `frontend/src/pages/runs/index.tsx`
- [Backend API](https://github.com/kartik00052/phronesisml/blob/main/backend/app/main.py): `backend/app/main.py`
- [Pipeline Routes](https://github.com/kartik00052/phronesisml/blob/main/backend/app/api/v1/pipeline.py): `backend/app/api/v1/pipeline.py`
- [Pipeline Progress](https://github.com/kartik00052/phronesisml/blob/main/backend/app/services/pipeline_service.py): `backend/app/services/pipeline_service.py`
- [Run Persistence](https://github.com/kartik00052/phronesisml/blob/main/backend/app/db/repositories.py): `backend/app/db/repositories.py`
- [Run Worker](https://github.com/kartik00052/phronesisml/blob/main/backend/app/workers/runner.py): `backend/app/workers/runner.py`

### Other components

- **Data Scientist**
- **Web User**

## Connections

- Data Scientist → Python SDK: uses (evidence: `README.md`)
- Data Scientist → CLI: invokes (evidence: `phronesisml/interfaces/cli/app.py`)
- CLI → Python SDK: calls pipeline (evidence: `phronesisml/interfaces/cli/app.py`)
- Python SDK → Agent Workflow: starts workflow
- Agent Workflow → ETL and Cleaning: dispatches stage (evidence: `README.md`)
- Agent Workflow → Data Validation: dispatches stage (evidence: `README.md`)
- Agent Workflow → Dataset Profiling: dispatches stage (evidence: `README.md`)
- Agent Workflow → Target Detection: dispatches stage (evidence: `README.md`)
- Agent Workflow → Feature Engineering: dispatches stage (evidence: `README.md`)
- Agent Workflow → Model Selection: dispatches stage (evidence: `README.md`)
- Agent Workflow → Model Evaluation: dispatches stage (evidence: `README.md`)
- Agent Workflow → Explainability: dispatches stage (evidence: `README.md`)
- Agent Workflow → Reports and Artifacts: dispatches stage (evidence: `README.md`)
- Agent Workflow → Engine Selection: selects engine (evidence: `README.md`)
- Engine Selection → Data Engines: chooses backend (evidence: `README.md`)
- Feature Engineering → Data Engines: uses engine
- Model Selection → AutoML Training: trains candidates (evidence: `README.md`)
- Agent Workflow → Specialized ML: offers capability (evidence: `README.md`)
- Reports and Artifacts → Artifact Storage: persists artifacts
- Artifact Storage → Reports and Artifacts: uses report builder (evidence: `phronesisml/services/storage.py`)
- Web User → Run Management UI: manages runs
- Run Management UI → Backend API: requests data
- Backend API → Pipeline Routes: mounts routes (evidence: `backend/app/main.py`)
- Pipeline Routes → Pipeline Progress: queries progress (evidence: `backend/app/api/v1/pipeline.py`)
- Pipeline Progress → Run Persistence: reads run state (evidence: `backend/app/services/pipeline_service.py`)
- Pipeline Progress → Run Worker: references runner (evidence: `backend/app/services/pipeline_service.py`)
