Agentic ML Studio is a modular, multi-agent machine learning studio that automates end-to-end data science workflows. It unites LangGraph stateful agent orchestration, Model Context Protocol (MCP) tool servers, scikit-learn pipelines, and a local Ollama LLM backend under an intuitive Streamlit multi-page interface.
- Overview
- Architecture
- Key Features
- Workflow Pipeline
- Repository Structure
- Installation & Quickstart
- Usage Guide
- Supported Models
- Testing
- Storage Artifacts
- Limitations & Roadmap
Building baseline machine learning models often involves repetitive steps: profiling datasets, handling missing values, encoding categories, picking algorithms, training pipelines, calculating metrics, and writing reports.
Agentic ML Studio addresses this by deploying specialized, cooperating agents:
-
Deterministic Operations (e.g., calculating schema, imputing data, fitting regressors, computing
$R^2$ /MAE/RMSE) are delegated to scikit-learn and pandas. - Tool Protocol Integration is handled via FastMCP stdio servers.
- Reasoning & Natural-Language Interpretations are generated using local LLMs (Ollama / LLaMA 3) with automated heuristic fallback.
- State Management is coordinated via a compiled LangGraph state machine.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Streamlit Frontend β
β (00_Dataset | 01_Visualizations | 02_Insights | 03_Training | 04_Reportβ
β 05_Agentic_Studio Multi-Agent UI) β
ββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββ΄ββββββββββββββββββββ
βΌ βΌ
βββββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββ
β LangGraph Agentic Workflow β β FastMCP Tool Servers β
β β β β
β [Data Analysis Agent] β β β’ Dataset Server (profile/schema) β
β β β β β’ Visualization Server (Plotly) β
β [Preprocessing Agent] β β β’ Training Server (fit/save) β
β β β β β’ Reporting Server (export) β
β [Model Selection Agent] β βββββββββββββββββββββββββββββββββββββ
β β β
β [Training Agent] β βββββββββββββββββββββββββββββββββββββ
β β β β LLM Integration β
β [Evaluation Agent] β β β
β β β β β’ Ollama (llama3) β
β [AI Insights Agent] β β β’ Resilient Heuristic Fallback β
β β β βββββββββββββββββββββββββββββββββββββ
β [Reporting Agent] β
βββββββββββββββββββββββββββββββββββββ
- Data Analysis Agent: Automatically computes dataset shape, schema data types, missing value distributions, duplicate rows, and numeric summary statistics.
-
Preprocessing Agent: Dynamically constructs scikit-learn
ColumnTransformerpipelines with median imputation & standard scaling for numeric features, and mode imputation & one-hot encoding for categorical variables. - Model Selection Agent: Analyzes dataset characteristics (sample size, feature count, categorical presence) to deterministically select the optimal model, or respects explicit user selections.
-
Training Agent: Executes train-test splitting (80/20) and trains the end-to-end preprocessing + regressor pipeline, persisting models with
joblib. -
Evaluation Agent: Evaluates model predictions on held-out test data, computing genuine
$R^2$ , MAE, and RMSE metrics. -
AI Insights Agent: Interprets data quality, explains error metrics, and provides actionable recommendations using Ollama (
llama3). Falls back to deterministic heuristics if the LLM is offline. - Reporting Agent: Generates and exports a comprehensive Markdown report summarizing the entire execution.
- Independent FastMCP stdio servers:
dataset_server: Dataset profiling, schema, missing values, duplicates.visualization_server: Interactive Plotly histograms, correlation matrices, and scatter plots.training_server: Linear regression fitting and model serialization.reporting_server: Markdown report compilation.
- Real-time Plotly rendering of distributions, correlation heatmaps, and customizable scatter plots.
graph TD
A[Upload / Select Dataset] --> B[Data Analysis Agent]
B --> C[Preprocessing Agent]
C --> D[Model Selection Agent]
D --> E[Training Agent]
E --> F[Evaluation Agent]
F --> G[AI Insights Agent]
G --> H[Reporting Agent]
H --> I[Downloadable Report & Model Artifact]
agentic-ml-studio/
βββ .ai/ # AI coding instructions & workflow specs
βββ docs/ # Project status and documentation
β βββ project_status.md
βββ src/
β βββ app/
β βββ agent/ # LangGraph Multi-Agent Engine
β β βββ nodes/ # Individual agent nodes
β β β βββ analysis.py
β β β βββ preprocessing.py
β β β βββ model_selection.py
β β β βββ training.py
β β β βββ evaluation.py
β β β βββ insights.py
β β β βββ reporting.py
β β βββ state.py # TypedDict AgentState
β β βββ workflow.py # Compiled StateGraph workflow
β βββ llm/ # Ollama LLM integration & prompt templates
β β βββ ollama_client.py
β β βββ prompts.py
β βββ mcp/ # Model Context Protocol servers & clients
β β βββ client/
β β βββ dataset_server/
β β βββ reporting_server/
β β βββ training_server/
β β βββ visualization_server/
β βββ services/ # Supporting services
β βββ ui/ # Multi-page Streamlit application
β βββ Home.py
β βββ pages/
β βββ 00_Dataset.py
β βββ 01_Visualizations.py
β βββ 02_Insights.py
β βββ 03_Training.py
β βββ 04_Reporting.py
β βββ 05_Agentic_Studio.py
βββ storage/ # Saved datasets, models, and reports
β βββ datasets/
β βββ models/
β βββ reports/
βββ tests/ # Pytest automated test suite
βββ pyproject.toml # Dependencies and build configuration
βββ README.md
- Python:
>= 3.14 - uv: Recommended package manager (Install uv)
- Ollama (Optional): Local LLM runner (Download Ollama). If installed, pull the default model:
ollama pull llama3
git clone https://github.com/pathummadhusanka/agentic-ml-studio.git
cd agentic-ml-studio
uv syncLaunch the Streamlit web application:
uv run streamlit run src/app/ui/Home.pyOpen your browser at http://localhost:8501 and navigate to 05_Agentic_Studio:
- Select or upload a CSV dataset.
- Choose your numeric target column.
- Select a model preference (
Autoor a specific model). - Click π Run Agentic Workflow.
- Inspect real-time agent traces, data quality metrics, trained model performance, AI insights, and download the full Markdown report.
You can also interact with individual stages independently:
00_Dataset: Upload and inspect schema, missing values, and duplicate rows.01_Visualizations: Render interactive Plotly histograms, correlation matrices, and scatter plots.02_Insights: Request AI recommendations on data preprocessing.03_Training: Fit baseline linear models.04_Reporting: Export standalone summaries.
To run the FastMCP tool servers over stdio for external agent integrations:
uv run -m app.mcp.dataset_server.server
uv run -m app.mcp.visualization_server.server
uv run -m app.mcp.training_server.server
uv run -m app.mcp.reporting_server.server| Model Key | Model Name | Description | Best Suited For |
|---|---|---|---|
linear_regression |
Linear Regression | Fast baseline linear model | Small datasets, simple linear relationships |
decision_tree |
Decision Tree Regressor | Non-linear tree model | Moderate datasets, non-linear interactions |
random_forest |
Random Forest Regressor | Ensemble of bagging trees | Tabular data with mixed features and noise |
gradient_boosting |
Gradient Boosting Regressor | Sequential boosting ensemble | Large datasets requiring maximum predictive accuracy |
The repository includes a comprehensive automated test suite testing analysis, preprocessing, model selection, training, evaluation, and end-to-end LangGraph execution.
Run the test suite:
uv run pytestGenerated artifacts are automatically persisted in the storage/ directory:
storage/datasets/β Uploaded CSV datasets.storage/models/β Serialized scikit-learn pipeline artifacts (.pkl).storage/reports/β Exported markdown reports (.md).
- Current Scope: Focuses on tabular regression problems with CSV input.
- Planned Enhancements:
- Support for multi-class and binary classification tasks.
- Hyperparameter tuning agent (GridSearch / Optuna).
- External LLM provider support (Gemini, OpenAI, Anthropic) alongside Ollama.
- Model explainability agent (SHAP / feature importances).
This project is licensed under the MIT License.