# reneilwekeoagile061/intellipipeline architecture

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

- Interactive diagram: https://gitdiagram.com/reneilwekeoagile061/intellipipeline
- Repository: https://github.com/reneilwekeoagile061/intellipipeline

## Overview

#### Purpose and local entry points
IntelliPipeline is a local-first MLOps platform for fraud detection: synthetic transaction data is transformed into features, trained and explained, monitored for drift, and exposed through a Flask API and React dashboard. Primary local run path: `scripts/run_local_pipeline.py`; API: `api/app.py`; UI bootstrap: `dashboard/src/main.jsx`.

#### 1. Data generation and feature contract
Synthetic source data is generated before the ML loop. Local feature engineering and validation establish the feature-store boundary and schema consumed by training. The cloud-oriented notebooks mirror this stage for Databricks/Delta migration.
- `scripts/generate_sample_data.py`
- `feature_store/local/feature_engineering.py`
- `feature_store/schema/feature_schema.json`

#### 2. Training, model registration, and explainability
The training layer builds fraud models against local features, benchmarks alternatives, records model artifacts/metrics, and produces SHAP-oriented explainability output. Local MLflow file storage is the intended experiment/runtime mechanism; Azure ML is a future deployment target.
- `ml_training/train.py`
- `ml_training/automl_benchmark.py`
- `ml_training/xai_report.py`

#### 3. Orchestration and governance control plane
Airflow DAGs coordinate the pipeline stages, including the local subprocess-based implementation, retraining flow, and policy-as-code governance checks. This is the primary scheduled/control-flow boundary between data, training, and serving.
- `orchestration/dags/fraud_pipeline_local.py`
- `orchestration/dags/retraining_dag.py`
- `orchestration/dags/governance_policies.py`

#### 4. Serving, scoring, drift, and retraining signals
Serving provides local scoring and drift detection. PSI drift results are persisted as JSON signals; retraining logic consumes or emits triggers based on those signals. The cloud trajectory is a managed endpoint configured separately.
- `serving/local_score_server.py`
- `serving/drift_detector_local.py`
- `serving/retraining_trigger.py`

#### 5. Artifact and observability boundary
Local files under `data/local/` are the contract between pipeline/serving jobs and the API/dashboard: model health metrics and latest drift status are read directly rather than through a database. Explainability output is also materialized as a report.
- `data/local/model_metrics.json`
- `data/local/drift_signals/latest_drift.json`
- `data/xai_report.json`

#### 6. API integration layer
Flask registers route modules that expose health, drift, explanation, analytics, and natural-language query capabilities. It mediates dashboard access to local artifacts and provides Claude-backed behavior where an Anthropic key is available, with demo behavior otherwise.
- `api/app.py`
- `api/routes/models.py`
- `api/routes/query.py`

#### 7. Operations dashboard
The Vite/React dashboard is the operator-facing surface for model health, drift, transaction activity, segmentation, green metrics, XAI, and NL queries. Its service layer calls Flask and separately encapsulates Claude interaction.
- `dashboard/src/App.jsx`
- `dashboard/src/services/api.js`
- `dashboard/src/services/claudeService.js`

#### Runtime and deployment boundaries
Python runs the pipeline, Airflow, Flask, and ML components; Node/Vite runs the dashboard. Docker Compose and image definitions support multi-service local/container execution. Azure/Databricks integration is optional and not yet deployed.
- `docker-compose.local.yml`
- `docker/Dockerfile.api`
- `docker/Dockerfile.dashboard`

Main entry points: [`ml_training/train.py`](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/ml_training/train.py) (Fraud Model Training), [`api/routes/models.py`](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/api/routes/models.py) (Model & Query Routes), [`orchestration/dags/fraud_pipeline_local.py`](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/orchestration/dags/fraud_pipeline_local.py) (Local Pipeline DAG), [`feature_store/local/feature_engineering.py`](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/feature_store/local/feature_engineering.py) (Feature Engineering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pipeline["Data &amp; ML Pipeline"]
  node_data_generator["Synthetic Data Generator<br/>Python job"]
  node_feature_engineering["Feature Engineering<br/>feature pipeline"]
  node_feature_schema["Feature Schema<br/>data contract"]
  node_training["Fraud Model Training<br/>ML training<br/>[train.py]"]
  node_automl["Model Benchmarking<br/>AutoML benchmark"]
  node_xai_reporter["XAI Reporting<br/>SHAP reporting<br/>[xai_report.py]"]
end

subgraph group_control["Orchestration"]
  node_local_pipeline_dag{{"Local Pipeline DAG<br/>Airflow DAG"}}
  node_retraining_dag{{"Retraining DAG<br/>Airflow DAG<br/>[retraining_dag.py]"}}
  node_governance["Governance Policies<br/>policy checks"]
end

subgraph group_serving["Serving &amp; Artifacts"]
  node_score_server["Local Score Server<br/>model scoring"]
  node_drift_detector["PSI Drift Detector<br/>drift monitoring"]
  node_retraining_trigger["Retraining Trigger<br/>signal handler"]
  node_model_metrics["Model Metrics<br/>local artifact<br/>[model_metrics.json]"]
  node_drift_status["Latest Drift Status<br/>local artifact<br/>[latest_drift.json]"]
  node_xai_artifact["XAI Report Artifact<br/>local artifact<br/>[xai_report.json]"]
end

subgraph group_product["API &amp; Dashboard"]
  node_flask_api["Flask API<br/>Python API<br/>[app.py]"]
  node_api_routes["Model &amp; Query Routes<br/>Flask routes<br/>[models.py]"]
  node_dashboard["React Dashboard<br/>Vite frontend<br/>[App.jsx]"]
  node_dashboard_api["Dashboard API Service<br/>frontend service<br/>[api.js]"]
end

subgraph group_runtime["Local Runtime"]
  node_local_runner(("Local Pipeline Runner<br/>Python entry point"))
  node_compose{{"Docker Compose<br/>container runtime"}}
end

node_local_runner -->|"starts"| node_local_pipeline_dag
node_local_pipeline_dag -->|"orchestrates"| node_data_generator
node_data_generator -->|"source transactions"| node_feature_engineering
node_feature_schema -->|"validates"| node_feature_engineering
node_feature_engineering -->|"local features"| node_training
node_local_pipeline_dag -->|"orchestrates"| node_training
node_training -->|"benchmarks"| node_automl
node_training -->|"trained model"| node_xai_reporter
node_training -->|"writes metrics"| node_model_metrics
node_xai_reporter -->|"writes report"| node_xai_artifact
node_governance -.->|"policy checks"| node_local_pipeline_dag
node_training -->|"model artifact"| node_score_server
node_score_server -->|"scoring activity"| node_drift_detector
node_drift_detector -->|"writes PSI signal"| node_drift_status
node_drift_status -->|"drift signal"| node_retraining_trigger
node_retraining_trigger -->|"triggers"| node_retraining_dag
node_retraining_dag -->|"retrain"| node_training
node_flask_api -->|"registers"| node_api_routes
node_api_routes -->|"reads"| node_model_metrics
node_api_routes -->|"reads"| node_drift_status
node_api_routes -->|"reads"| node_xai_artifact
node_dashboard -->|"uses"| node_dashboard_api
node_dashboard_api -->|"HTTP"| node_flask_api
node_compose -->|"runs"| node_flask_api
node_compose -->|"runs"| node_dashboard

click node_data_generator "https://github.com/reneilwekeoagile061/intellipipeline/blob/main/scripts/generate_sample_data.py"
click node_feature_engineering "https://github.com/reneilwekeoagile061/intellipipeline/blob/main/feature_store/local/feature_engineering.py"
click node_feature_schema "https://github.com/reneilwekeoagile061/intellipipeline/blob/main/feature_store/schema/feature_schema.json"
click node_training "https://github.com/reneilwekeoagile061/intellipipeline/blob/main/ml_training/train.py"
click node_automl "https://github.com/reneilwekeoagile061/intellipipeline/blob/main/ml_training/automl_benchmark.py"
click node_xai_reporter "https://github.com/reneilwekeoagile061/intellipipeline/blob/main/ml_training/xai_report.py"
click node_local_pipeline_dag "https://github.com/reneilwekeoagile061/intellipipeline/blob/main/orchestration/dags/fraud_pipeline_local.py"
click node_retraining_dag "https://github.com/reneilwekeoagile061/intellipipeline/blob/main/orchestration/dags/retraining_dag.py"
click node_governance "https://github.com/reneilwekeoagile061/intellipipeline/blob/main/orchestration/dags/governance_policies.py"
click node_score_server "https://github.com/reneilwekeoagile061/intellipipeline/blob/main/serving/local_score_server.py"
click node_drift_detector "https://github.com/reneilwekeoagile061/intellipipeline/blob/main/serving/drift_detector_local.py"
click node_retraining_trigger "https://github.com/reneilwekeoagile061/intellipipeline/blob/main/serving/retraining_trigger.py"
click node_model_metrics "https://github.com/reneilwekeoagile061/intellipipeline/blob/main/data/local/model_metrics.json"
click node_drift_status "https://github.com/reneilwekeoagile061/intellipipeline/blob/main/data/local/drift_signals/latest_drift.json"
click node_xai_artifact "https://github.com/reneilwekeoagile061/intellipipeline/blob/main/data/xai_report.json"
click node_flask_api "https://github.com/reneilwekeoagile061/intellipipeline/blob/main/api/app.py"
click node_api_routes "https://github.com/reneilwekeoagile061/intellipipeline/blob/main/api/routes/models.py"
click node_dashboard "https://github.com/reneilwekeoagile061/intellipipeline/blob/main/dashboard/src/App.jsx"
click node_dashboard_api "https://github.com/reneilwekeoagile061/intellipipeline/blob/main/dashboard/src/services/api.js"
click node_local_runner "https://github.com/reneilwekeoagile061/intellipipeline/blob/main/scripts/run_local_pipeline.py"
click node_compose "https://github.com/reneilwekeoagile061/intellipipeline/blob/main/docker-compose.local.yml"

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_data_generator,node_feature_engineering,node_feature_schema,node_training,node_automl,node_xai_reporter toneBlue
class node_local_pipeline_dag,node_retraining_dag,node_governance toneAmber
class node_score_server,node_drift_detector,node_retraining_trigger,node_model_metrics,node_drift_status,node_xai_artifact toneMint
class node_flask_api,node_api_routes,node_dashboard,node_dashboard_api toneRose
class node_local_runner,node_compose toneIndigo
```

## Components

### Data & ML Pipeline

- [Synthetic Data Generator](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/scripts/generate_sample_data.py): Python job · `scripts/generate_sample_data.py`
- [Feature Engineering](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/feature_store/local/feature_engineering.py): feature pipeline · Creates validated local training features. · `feature_store/local/feature_engineering.py`
- [Feature Schema](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/feature_store/schema/feature_schema.json): data contract · `feature_store/schema/feature_schema.json`
- [Fraud Model Training](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/ml_training/train.py): ML training · `ml_training/train.py`
- [Model Benchmarking](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/ml_training/automl_benchmark.py): AutoML benchmark · `ml_training/automl_benchmark.py`
- [XAI Reporting](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/ml_training/xai_report.py): SHAP reporting · `ml_training/xai_report.py`

### Orchestration

- [Local Pipeline DAG](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/orchestration/dags/fraud_pipeline_local.py): Airflow DAG · Coordinates local subprocess pipeline stages. · `orchestration/dags/fraud_pipeline_local.py`
- [Retraining DAG](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/orchestration/dags/retraining_dag.py): Airflow DAG · `orchestration/dags/retraining_dag.py`
- [Governance Policies](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/orchestration/dags/governance_policies.py): policy checks · `orchestration/dags/governance_policies.py`

### Serving & Artifacts

- [Local Score Server](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/serving/local_score_server.py): model scoring · `serving/local_score_server.py`
- [PSI Drift Detector](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/serving/drift_detector_local.py): drift monitoring · `serving/drift_detector_local.py`
- [Retraining Trigger](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/serving/retraining_trigger.py): signal handler · `serving/retraining_trigger.py`
- [Model Metrics](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/data/local/model_metrics.json): local artifact · API and dashboard-facing health contract. · `data/local/model_metrics.json`
- [Latest Drift Status](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/data/local/drift_signals/latest_drift.json): local artifact · Persisted PSI drift signal. · `data/local/drift_signals/latest_drift.json`
- [XAI Report Artifact](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/data/xai_report.json): local artifact · `data/xai_report.json`

### API & Dashboard

- [Flask API](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/api/app.py): Python API · Mediates dashboard access to local artifacts and query behavior. · `api/app.py`
- [Model & Query Routes](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/api/routes/models.py): Flask routes · Exposes health, drift, explanations, analytics, and NL queries. · `api/routes/models.py`
- [React Dashboard](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/dashboard/src/App.jsx): Vite frontend · Operator UI for health, drift, XAI, and transactions. · `dashboard/src/App.jsx`
- [Dashboard API Service](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/dashboard/src/services/api.js): frontend service · `dashboard/src/services/api.js`

### Local Runtime

- [Local Pipeline Runner](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/scripts/run_local_pipeline.py): Python entry point · `scripts/run_local_pipeline.py`
- [Docker Compose](https://github.com/reneilwekeoagile061/intellipipeline/blob/main/docker-compose.local.yml): container runtime · Runs API and dashboard as local services. · `docker-compose.local.yml`

## Connections

- Local Pipeline Runner → Local Pipeline DAG: starts
- Local Pipeline DAG → Synthetic Data Generator: orchestrates
- Synthetic Data Generator → Feature Engineering: source transactions
- Feature Schema → Feature Engineering: validates
- Feature Engineering → Fraud Model Training: local features
- Local Pipeline DAG → Fraud Model Training: orchestrates
- Fraud Model Training → Model Benchmarking: benchmarks
- Fraud Model Training → XAI Reporting: trained model
- Fraud Model Training → Model Metrics: writes metrics
- XAI Reporting → XAI Report Artifact: writes report
- Governance Policies → Local Pipeline DAG: policy checks
- Fraud Model Training → Local Score Server: model artifact
- Local Score Server → PSI Drift Detector: scoring activity
- PSI Drift Detector → Latest Drift Status: writes PSI signal
- Latest Drift Status → Retraining Trigger: drift signal
- Retraining Trigger → Retraining DAG: triggers
- Retraining DAG → Fraud Model Training: retrain
- Flask API → Model & Query Routes: registers
- Model & Query Routes → Model Metrics: reads
- Model & Query Routes → Latest Drift Status: reads
- Model & Query Routes → XAI Report Artifact: reads
- React Dashboard → Dashboard API Service: uses
- Dashboard API Service → Flask API: HTTP
- Docker Compose → Flask API: runs
- Docker Compose → React Dashboard: runs
