# luialv2502/ml_framework architecture

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

- Interactive diagram: https://gitdiagram.com/luialv2502/ml_framework
- Repository: https://github.com/luialv2502/ml_framework

## Overview

Laboratorio IA is a local Streamlit application for exploring datasets and running EDA, preprocessing, clustering, classification, regression, and multi-agent analyses. The user loads data, explores and prepares it, then runs an analysis and can review or compare saved experiments. The documented controller is the frontend’s sole entry point and delegates tasks to an agent coordinator; execution details for several unsampled agents and pages are represented only at subsystem level. Optional Gemini support and agent messaging are shown separately where evidence permits.

Main entry points: [`framework_ia/agents`](https://github.com/luialv2502/ml_framework/tree/main/framework_ia/agents) (Analysis agents), [`framework_ia/controller.py`](https://github.com/luialv2502/ml_framework/blob/main/framework_ia/controller.py) (Framework controller), [`app.py`](https://github.com/luialv2502/ml_framework/blob/main/app.py) (Streamlit entry), [`frontend/dashboard.py`](https://github.com/luialv2502/ml_framework/blob/main/frontend/dashboard.py) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Streamlit interface"]
  node_app["Streamlit entry<br/>[app.py]"]
  node_dashboard["Dashboard<br/>[dashboard.py]"]
  node_pages["Analysis pages"]
  node_shared_ui["Shared UI<br/>[shared.py]"]
  node_supervised_ui["Supervised reports"]
  node_theme["Visual theme<br/>[theme.py]"]
end

subgraph group_orchestration["Task orchestration"]
  node_controller["Framework controller<br/>[controller.py]"]
  node_agency["Agent agency<br/>[agency.py]"]
  node_coordinator["Task coordinator"]
  node_agent_runtime["Agent runtime<br/>[base_agent.py]"]
  node_agent_factory["Agent factory<br/>[agent_factory.py]"]
  node_messaging["Agent messaging<br/>[messaging.py]"]
  node_llm["Gemini integration<br/>[llm.py]"]
  node_agent_specialists["Analysis agents"]
end

subgraph group_analytics["Data analysis"]
  node_eda["EDA operations<br/>[dataframe.py]"]
  node_preprocessing["Preprocessing"]
  node_transforms["Data transforms<br/>[transforms.py]"]
  node_clustering["Clustering and PCA"]
  node_classification["Classification"]
  node_regression["Regression<br/>[regression.py]"]
end

subgraph group_state["Data and persistence"]
  node_dataset["Dataset service<br/>[dataset_service.py]"]
  node_experiments["Experiment service"]
  node_experiment_store[("Experiment records")]
end

subgraph group_support["Shared infrastructure"]
  node_validation["Input validation<br/>[validation.py]"]
  node_serialization["Result serialization<br/>[serialization.py]"]
end

node_user(("Analyst"))
node_gemini["Gemini<br/>external system"]

node_user -->|"opens"| node_app
node_app -->|"starts"| node_dashboard
node_dashboard -->|"applies"| node_theme
node_user -->|"uses"| node_pages
node_pages -->|"shares controls"| node_shared_ui
node_shared_ui -->|"calls"| node_controller
node_supervised_ui -->|"renders with"| node_theme
node_controller -->|"loads active data"| node_dataset
node_controller -->|"dispatches task"| node_agency
node_agency -.->|"routes task"| node_coordinator
node_coordinator -->|"delegates analysis"| node_agent_specialists
node_agent_factory -->|"constructs"| node_agent_runtime
node_agent_runtime -->|"uses bus"| node_messaging
node_agent_specialists -->|"uses EDA"| node_eda
node_agent_specialists -->|"uses preparation"| node_preprocessing
node_preprocessing -->|"applies operations"| node_transforms
node_agent_specialists -.->|"runs clustering"| node_clustering
node_agent_specialists -.->|"runs classification"| node_classification
node_agent_specialists -.->|"runs regression"| node_regression
node_controller -->|"records runs"| node_experiments
node_experiments -->|"persists"| node_experiment_store
node_controller -->|"validates requests"| node_validation
node_messaging -->|"serializes messages"| node_serialization
node_llm -.->|"calls provider"| node_gemini

click node_app "https://github.com/luialv2502/ml_framework/blob/main/app.py"
click node_dashboard "https://github.com/luialv2502/ml_framework/blob/main/frontend/dashboard.py"
click node_pages "https://github.com/luialv2502/ml_framework/tree/main/frontend/pages"
click node_shared_ui "https://github.com/luialv2502/ml_framework/blob/main/frontend/components/shared.py"
click node_supervised_ui "https://github.com/luialv2502/ml_framework/blob/main/frontend/components/supervised_agent.py"
click node_theme "https://github.com/luialv2502/ml_framework/blob/main/frontend/components/theme.py"
click node_controller "https://github.com/luialv2502/ml_framework/blob/main/framework_ia/controller.py"
click node_agency "https://github.com/luialv2502/ml_framework/blob/main/framework_ia/agents/agency.py"
click node_coordinator "https://github.com/luialv2502/ml_framework/blob/main/framework_ia/agents/coordinator_agent.py"
click node_agent_runtime "https://github.com/luialv2502/ml_framework/blob/main/framework_ia/agents/base_agent.py"
click node_agent_factory "https://github.com/luialv2502/ml_framework/blob/main/framework_ia/agents/agent_factory.py"
click node_messaging "https://github.com/luialv2502/ml_framework/blob/main/framework_ia/agents/messaging.py"
click node_llm "https://github.com/luialv2502/ml_framework/blob/main/framework_ia/agents/llm.py"
click node_dataset "https://github.com/luialv2502/ml_framework/blob/main/framework_ia/services/dataset_service.py"
click node_experiments "https://github.com/luialv2502/ml_framework/blob/main/framework_ia/services/experiment_service.py"
click node_experiment_store "https://github.com/luialv2502/ml_framework/blob/main/framework_ia/persistence/experiment_store.py"
click node_eda "https://github.com/luialv2502/ml_framework/blob/main/framework_ia/ml/eda/dataframe.py"
click node_preprocessing "https://github.com/luialv2502/ml_framework/blob/main/framework_ia/services/preprocessing_service.py"
click node_transforms "https://github.com/luialv2502/ml_framework/blob/main/framework_ia/ml/preprocessing/transforms.py"
click node_clustering "https://github.com/luialv2502/ml_framework/tree/main/framework_ia/ml/clustering"
click node_classification "https://github.com/luialv2502/ml_framework/tree/main/framework_ia/ml/classification"
click node_regression "https://github.com/luialv2502/ml_framework/blob/main/framework_ia/ml/regression/regression.py"
click node_agent_specialists "https://github.com/luialv2502/ml_framework/tree/main/framework_ia/agents"
click node_validation "https://github.com/luialv2502/ml_framework/blob/main/framework_ia/utils/validation.py"
click node_serialization "https://github.com/luialv2502/ml_framework/blob/main/framework_ia/utils/serialization.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_app,node_dashboard,node_pages,node_shared_ui,node_supervised_ui,node_theme toneBlue
class node_controller,node_agency,node_coordinator,node_agent_runtime,node_agent_factory,node_messaging,node_llm,node_agent_specialists toneAmber
class node_eda,node_preprocessing,node_transforms,node_clustering,node_classification,node_regression toneMint
class node_dataset,node_experiments,node_experiment_store toneRose
class node_validation,node_serialization,node_user,node_gemini toneIndigo
```

## Components

### Streamlit interface

- [Streamlit entry](https://github.com/luialv2502/ml_framework/blob/main/app.py): `app.py`
- [Dashboard](https://github.com/luialv2502/ml_framework/blob/main/frontend/dashboard.py): `frontend/dashboard.py`
- [Analysis pages](https://github.com/luialv2502/ml_framework/tree/main/frontend/pages): `frontend/pages`
- [Shared UI](https://github.com/luialv2502/ml_framework/blob/main/frontend/components/shared.py): `frontend/components/shared.py`
- [Supervised reports](https://github.com/luialv2502/ml_framework/blob/main/frontend/components/supervised_agent.py): `frontend/components/supervised_agent.py`
- [Visual theme](https://github.com/luialv2502/ml_framework/blob/main/frontend/components/theme.py): `frontend/components/theme.py`

### Task orchestration

- [Framework controller](https://github.com/luialv2502/ml_framework/blob/main/framework_ia/controller.py): `framework_ia/controller.py`
- [Agent agency](https://github.com/luialv2502/ml_framework/blob/main/framework_ia/agents/agency.py): `framework_ia/agents/agency.py`
- [Task coordinator](https://github.com/luialv2502/ml_framework/blob/main/framework_ia/agents/coordinator_agent.py): `framework_ia/agents/coordinator_agent.py`
- [Agent runtime](https://github.com/luialv2502/ml_framework/blob/main/framework_ia/agents/base_agent.py): `framework_ia/agents/base_agent.py`
- [Agent factory](https://github.com/luialv2502/ml_framework/blob/main/framework_ia/agents/agent_factory.py): `framework_ia/agents/agent_factory.py`
- [Agent messaging](https://github.com/luialv2502/ml_framework/blob/main/framework_ia/agents/messaging.py): `framework_ia/agents/messaging.py`
- [Gemini integration](https://github.com/luialv2502/ml_framework/blob/main/framework_ia/agents/llm.py): `framework_ia/agents/llm.py`
- [Analysis agents](https://github.com/luialv2502/ml_framework/tree/main/framework_ia/agents): `framework_ia/agents`

### Data analysis

- [EDA operations](https://github.com/luialv2502/ml_framework/blob/main/framework_ia/ml/eda/dataframe.py): `framework_ia/ml/eda/dataframe.py`
- [Preprocessing](https://github.com/luialv2502/ml_framework/blob/main/framework_ia/services/preprocessing_service.py): `framework_ia/services/preprocessing_service.py`
- [Data transforms](https://github.com/luialv2502/ml_framework/blob/main/framework_ia/ml/preprocessing/transforms.py): `framework_ia/ml/preprocessing/transforms.py`
- [Clustering and PCA](https://github.com/luialv2502/ml_framework/tree/main/framework_ia/ml/clustering): `framework_ia/ml/clustering`
- [Classification](https://github.com/luialv2502/ml_framework/tree/main/framework_ia/ml/classification): `framework_ia/ml/classification`
- [Regression](https://github.com/luialv2502/ml_framework/blob/main/framework_ia/ml/regression/regression.py): `framework_ia/ml/regression/regression.py`

### Data and persistence

- [Dataset service](https://github.com/luialv2502/ml_framework/blob/main/framework_ia/services/dataset_service.py): `framework_ia/services/dataset_service.py`
- [Experiment service](https://github.com/luialv2502/ml_framework/blob/main/framework_ia/services/experiment_service.py): `framework_ia/services/experiment_service.py`
- [Experiment records](https://github.com/luialv2502/ml_framework/blob/main/framework_ia/persistence/experiment_store.py): `framework_ia/persistence/experiment_store.py`

### Shared infrastructure

- [Input validation](https://github.com/luialv2502/ml_framework/blob/main/framework_ia/utils/validation.py): `framework_ia/utils/validation.py`
- [Result serialization](https://github.com/luialv2502/ml_framework/blob/main/framework_ia/utils/serialization.py): `framework_ia/utils/serialization.py`

### Other components

- **Analyst**
- **Gemini**: external system

## Connections

- Analyst → Streamlit entry: opens (evidence: `README.md`)
- Streamlit entry → Dashboard: starts (evidence: `app.py`)
- Dashboard → Visual theme: applies (evidence: `frontend/dashboard.py`)
- Analyst → Analysis pages: uses (evidence: `README.md`)
- Analysis pages → Shared UI: shares controls (evidence: `frontend/pages/classification.py`)
- Shared UI → Framework controller: calls (evidence: `frontend/components/shared.py`)
- Supervised reports → Visual theme: renders with (evidence: `frontend/components/supervised_agent.py`)
- Framework controller → Dataset service: loads active data (evidence: `framework_ia/controller.py`)
- Framework controller → Agent agency: dispatches task (evidence: `framework_ia/controller.py`)
- Agent agency → Task coordinator: routes task
- Task coordinator → Analysis agents: delegates analysis
- Agent factory → Agent runtime: constructs (evidence: `framework_ia/agents/agent_factory.py`)
- Agent runtime → Agent messaging: uses bus (evidence: `framework_ia/agents/base_agent.py`)
- Analysis agents → EDA operations: uses EDA (evidence: `framework_ia/agents/eda_agent.py`)
- Analysis agents → Preprocessing: uses preparation (evidence: `framework_ia/agents/eda_agent.py`)
- Preprocessing → Data transforms: applies operations (evidence: `framework_ia/services/preprocessing_service.py`)
- Analysis agents → Clustering and PCA: runs clustering
- Analysis agents → Classification: runs classification (evidence: `framework_ia/agents/plugins/knn_auto.py`)
- Analysis agents → Regression: runs regression
- Framework controller → Experiment service: records runs (evidence: `framework_ia/controller.py`)
- Experiment service → Experiment records: persists (evidence: `framework_ia/services/experiment_service.py`)
- Framework controller → Input validation: validates requests (evidence: `framework_ia/controller.py`)
- Agent messaging → Result serialization: serializes messages (evidence: `framework_ia/agents/messaging.py`)
- Gemini integration → Gemini: calls provider
