# m-awais-11/datapilot-ai architecture

> Architecture diagram of the GitHub repository m-awais-11/datapilot-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/m-awais-11/datapilot-ai
- Repository: https://github.com/m-awais-11/datapilot-ai

## Overview

This is an AI data-science application: users upload datasets, launch experiments, follow an autonomous analysis and modeling workflow, then review results, explanations, and reports or chat about an experiment. The README documents the ordered agent stages; sampled task code confirms that experiment execution invokes the LangGraph workflow, and sampled frontend code confirms API access and pipeline-result polling. Several API handlers and agent implementations were not sampled, so uncertain internal service wiring is omitted.

Main entry points: [`frontend/src/app/core/services/api.service.ts`](https://github.com/m-awais-11/datapilot-ai/blob/main/frontend/src/app/core/services/api.service.ts) (API client), [`backend/app/agents/supervisor.py`](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/agents/supervisor.py) (Workflow supervisor), [`frontend/src/app/app.component.ts`](https://github.com/m-awais-11/datapilot-ai/blob/main/frontend/src/app/app.component.ts) (Angular app), [`backend/app/database/connection.py`](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/database/connection.py) (Application database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_web["Angular app<br/>[app.component.ts]"]
  node_authui["Sign-in<br/>[login.component.ts]"]
  node_datasetui["Dataset upload"]
  node_experimentui["Experiment setup"]
  node_pipelineui["Pipeline results"]
  node_predui["Prediction form"]
  node_chatui["Chat interface<br/>[chat.component.ts]"]
  node_clientapi["API client<br/>[api.service.ts]"]
end

subgraph group_api["Backend API"]
  node_authapi["Authentication API<br/>[auth.py]"]
  node_datasetapi["Dataset API<br/>[datasets.py]"]
  node_experimentapi["Experiment API<br/>[experiments.py]"]
  node_predictionapi["Prediction API<br/>[predictions.py]"]
  node_reportapi["Reports API<br/>[reports.py]"]
  node_chatapi["Chat API<br/>[chat.py]"]
end

subgraph group_workflow["Experiment workflow"]
  node_task["Experiment task"]
  node_supervisor["Workflow supervisor<br/>[supervisor.py]"]
  node_understand["Data understanding"]
  node_clean["Data cleaning<br/>[cleaning.py]"]
  node_eda["Exploratory analysis<br/>[eda.py]"]
  node_features["Feature engineering"]
  node_selection["Model selection<br/>[model_selection.py]"]
  node_training["Model training<br/>[training.py]"]
  node_evaluation["Model evaluation<br/>[evaluation.py]"]
  node_explain["SHAP explainability<br/>[explainability.py]"]
  node_reporting["Report generation<br/>[reporting.py]"]
end

subgraph group_artifacts["Persistence and artifacts"]
  node_database[("Application database<br/>[connection.py]")]
  node_datasetservice["Dataset service<br/>[dataset_service.py]"]
  node_mlflow["MLflow tracking<br/>[mlflow_service.py]"]
end

subgraph group_assistance["Serving and assistance"]
  node_chatservice["Grounded chat service<br/>[chat_service.py]"]
  node_llm(("LLM provider"))
end

node_user(("User"))

node_user -->|"uses"| node_web
node_web -->|"routes to"| node_authui
node_web -->|"routes to"| node_datasetui
node_web -->|"routes to"| node_experimentui
node_web -->|"routes to"| node_pipelineui
node_web -->|"routes to"| node_predui
node_web -->|"routes to"| node_chatui
node_authui -->|"requests auth"| node_clientapi
node_datasetui -->|"uploads data"| node_clientapi
node_experimentui -->|"creates run"| node_clientapi
node_pipelineui -->|"polls results"| node_clientapi
node_predui -->|"requests prediction"| node_clientapi
node_chatui -->|"sends messages"| node_clientapi
node_clientapi -->|"HTTP requests"| node_authapi
node_clientapi -->|"HTTP requests"| node_datasetapi
node_clientapi -->|"HTTP requests"| node_experimentapi
node_clientapi -->|"HTTP requests"| node_predictionapi
node_clientapi -->|"HTTP requests"| node_reportapi
node_clientapi -->|"HTTP requests"| node_chatapi
node_datasetapi -->|"dataset operations"| node_datasetservice
node_datasetservice -->|"persists metadata"| node_database
node_experimentapi -->|"starts experiment"| node_task
node_task -->|"loads and updates"| node_database
node_task -->|"invokes workflow"| node_supervisor
node_supervisor -->|"dispatches stage"| node_understand
node_supervisor -->|"dispatches stage"| node_clean
node_supervisor -->|"dispatches stage"| node_eda
node_supervisor -->|"dispatches stage"| node_features
node_supervisor -->|"dispatches stage"| node_selection
node_supervisor -->|"dispatches stage"| node_training
node_supervisor -->|"dispatches stage"| node_evaluation
node_supervisor -->|"dispatches stage"| node_explain
node_supervisor -->|"dispatches stage"| node_reporting
node_training -->|"logs metrics"| node_mlflow
node_chatapi -->|"handles conversation"| node_chatservice
node_chatservice -->|"reads context and saves"| node_database
node_chatservice -->|"requests answers"| node_llm
node_reportapi -->|"retrieves report records"| node_database
node_predictionapi -->|"retrieves model records"| node_database

click node_web "https://github.com/m-awais-11/datapilot-ai/blob/main/frontend/src/app/app.component.ts"
click node_authui "https://github.com/m-awais-11/datapilot-ai/blob/main/frontend/src/app/auth/login.component.ts"
click node_datasetui "https://github.com/m-awais-11/datapilot-ai/blob/main/frontend/src/app/dashboard/dashboard.component.ts"
click node_experimentui "https://github.com/m-awais-11/datapilot-ai/blob/main/frontend/src/app/experiments/new-experiment.component.ts"
click node_pipelineui "https://github.com/m-awais-11/datapilot-ai/blob/main/frontend/src/app/experiments/pipeline.component.ts"
click node_predui "https://github.com/m-awais-11/datapilot-ai/blob/main/frontend/src/app/predictions/prediction-form.component.ts"
click node_chatui "https://github.com/m-awais-11/datapilot-ai/blob/main/frontend/src/app/chat/chat.component.ts"
click node_clientapi "https://github.com/m-awais-11/datapilot-ai/blob/main/frontend/src/app/core/services/api.service.ts"
click node_authapi "https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/api/auth.py"
click node_datasetapi "https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/api/datasets.py"
click node_experimentapi "https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/api/experiments.py"
click node_predictionapi "https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/api/predictions.py"
click node_reportapi "https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/api/reports.py"
click node_chatapi "https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/api/chat.py"
click node_task "https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/tasks/experiment_tasks.py"
click node_supervisor "https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/agents/supervisor.py"
click node_understand "https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/agents/data_understanding.py"
click node_clean "https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/agents/cleaning.py"
click node_eda "https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/agents/eda.py"
click node_features "https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/agents/feature_engineering.py"
click node_selection "https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/agents/model_selection.py"
click node_training "https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/agents/training.py"
click node_evaluation "https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/agents/evaluation.py"
click node_explain "https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/agents/explainability.py"
click node_reporting "https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/agents/reporting.py"
click node_database "https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/database/connection.py"
click node_datasetservice "https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/services/dataset_service.py"
click node_mlflow "https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/services/mlflow_service.py"
click node_chatservice "https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/services/chat_service.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_web,node_authui,node_datasetui,node_experimentui,node_pipelineui,node_predui,node_chatui,node_clientapi,node_user toneBlue
class node_authapi,node_datasetapi,node_experimentapi,node_predictionapi,node_reportapi,node_chatapi toneAmber
class node_task,node_supervisor,node_understand,node_clean,node_eda,node_features,node_selection,node_training,node_evaluation,node_explain,node_reporting toneMint
class node_database,node_datasetservice,node_mlflow toneRose
class node_chatservice,node_llm toneIndigo
```

## Components

### Web application

- [Angular app](https://github.com/m-awais-11/datapilot-ai/blob/main/frontend/src/app/app.component.ts): `frontend/src/app/app.component.ts`
- [Sign-in](https://github.com/m-awais-11/datapilot-ai/blob/main/frontend/src/app/auth/login.component.ts): `frontend/src/app/auth/login.component.ts`
- [Dataset upload](https://github.com/m-awais-11/datapilot-ai/blob/main/frontend/src/app/dashboard/dashboard.component.ts): `frontend/src/app/dashboard/dashboard.component.ts`
- [Experiment setup](https://github.com/m-awais-11/datapilot-ai/blob/main/frontend/src/app/experiments/new-experiment.component.ts): `frontend/src/app/experiments/new-experiment.component.ts`
- [Pipeline results](https://github.com/m-awais-11/datapilot-ai/blob/main/frontend/src/app/experiments/pipeline.component.ts): `frontend/src/app/experiments/pipeline.component.ts`
- [Prediction form](https://github.com/m-awais-11/datapilot-ai/blob/main/frontend/src/app/predictions/prediction-form.component.ts): `frontend/src/app/predictions/prediction-form.component.ts`
- [Chat interface](https://github.com/m-awais-11/datapilot-ai/blob/main/frontend/src/app/chat/chat.component.ts): `frontend/src/app/chat/chat.component.ts`
- [API client](https://github.com/m-awais-11/datapilot-ai/blob/main/frontend/src/app/core/services/api.service.ts): `frontend/src/app/core/services/api.service.ts`

### Backend API

- [Authentication API](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/api/auth.py): `backend/app/api/auth.py`
- [Dataset API](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/api/datasets.py): `backend/app/api/datasets.py`
- [Experiment API](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/api/experiments.py): `backend/app/api/experiments.py`
- [Prediction API](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/api/predictions.py): `backend/app/api/predictions.py`
- [Reports API](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/api/reports.py): `backend/app/api/reports.py`
- [Chat API](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/api/chat.py): `backend/app/api/chat.py`

### Experiment workflow

- [Experiment task](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/tasks/experiment_tasks.py): `backend/app/tasks/experiment_tasks.py`
- [Workflow supervisor](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/agents/supervisor.py): `backend/app/agents/supervisor.py`
- [Data understanding](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/agents/data_understanding.py): `backend/app/agents/data_understanding.py`
- [Data cleaning](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/agents/cleaning.py): `backend/app/agents/cleaning.py`
- [Exploratory analysis](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/agents/eda.py): `backend/app/agents/eda.py`
- [Feature engineering](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/agents/feature_engineering.py): `backend/app/agents/feature_engineering.py`
- [Model selection](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/agents/model_selection.py): `backend/app/agents/model_selection.py`
- [Model training](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/agents/training.py): `backend/app/agents/training.py`
- [Model evaluation](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/agents/evaluation.py): `backend/app/agents/evaluation.py`
- [SHAP explainability](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/agents/explainability.py): `backend/app/agents/explainability.py`
- [Report generation](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/agents/reporting.py): `backend/app/agents/reporting.py`

### Persistence and artifacts

- [Application database](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/database/connection.py): `backend/app/database/connection.py`
- [Dataset service](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/services/dataset_service.py): `backend/app/services/dataset_service.py`
- [MLflow tracking](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/services/mlflow_service.py): `backend/app/services/mlflow_service.py`

### Serving and assistance

- [Grounded chat service](https://github.com/m-awais-11/datapilot-ai/blob/main/backend/app/services/chat_service.py): `backend/app/services/chat_service.py`
- **LLM provider**

### Other components

- **User**

## Connections

- User → Angular app: uses
- Angular app → Sign-in: routes to
- Angular app → Dataset upload: routes to
- Angular app → Experiment setup: routes to
- Angular app → Pipeline results: routes to
- Angular app → Prediction form: routes to
- Angular app → Chat interface: routes to
- Sign-in → API client: requests auth
- Dataset upload → API client: uploads data
- Experiment setup → API client: creates run
- Pipeline results → API client: polls results
- Prediction form → API client: requests prediction
- Chat interface → API client: sends messages
- API client → Authentication API: HTTP requests
- API client → Dataset API: HTTP requests
- API client → Experiment API: HTTP requests
- API client → Prediction API: HTTP requests
- API client → Reports API: HTTP requests
- API client → Chat API: HTTP requests
- Dataset API → Dataset service: dataset operations
- Dataset service → Application database: persists metadata
- Experiment API → Experiment task: starts experiment
- Experiment task → Application database: loads and updates
- Experiment task → Workflow supervisor: invokes workflow
- Workflow supervisor → Data understanding: dispatches stage
- Workflow supervisor → Data cleaning: dispatches stage
- Workflow supervisor → Exploratory analysis: dispatches stage
- Workflow supervisor → Feature engineering: dispatches stage
- Workflow supervisor → Model selection: dispatches stage
- Workflow supervisor → Model training: dispatches stage
- Workflow supervisor → Model evaluation: dispatches stage
- Workflow supervisor → SHAP explainability: dispatches stage
- Workflow supervisor → Report generation: dispatches stage
- Model training → MLflow tracking: logs metrics
- Chat API → Grounded chat service: handles conversation
- Grounded chat service → Application database: reads context and saves
- Grounded chat service → LLM provider: requests answers
- Reports API → Application database: retrieves report records
- Prediction API → Application database: retrieves model records
