# shivadharshini25/final_year_project architecture

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

- Interactive diagram: https://gitdiagram.com/shivadharshini25/final_year_project
- Repository: https://github.com/shivadharshini25/final_year_project

## Overview

NeuroHeal is a research prototype for autonomous monitoring and recovery of ML pipelines, exposed through a dashboard and FastAPI backend. A user submits a dataset and pipeline settings; the backend starts a run, whose runner executes pipeline stages and coordinates evidence-based diagnosis, strategy selection, recovery, and verification. The system also exposes run history and learned recovery knowledge. The README describes the agent capabilities, while sampled runner excerpts show only portions of their orchestration; edges are limited to documented or indexed relationships.

Main entry points: [`orchestrator`](https://github.com/shivadharshini25/final_year_project/tree/main/orchestrator) (Pipeline runners), [`api/main.py`](https://github.com/shivadharshini25/final_year_project/blob/main/api/main.py) (FastAPI endpoints), [`frontend/src/App.tsx`](https://github.com/shivadharshini25/final_year_project/blob/main/frontend/src/App.tsx) (Dashboard shell), [`frontend/src/pages/MonitorPage.tsx`](https://github.com/shivadharshini25/final_year_project/blob/main/frontend/src/pages/MonitorPage.tsx) (Live monitor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Dashboard"]
  node_app["Dashboard shell<br/>[App.tsx]"]
  node_setup["Run setup<br/>[SetupPage.tsx]"]
  node_monitor["Live monitor<br/>[MonitorPage.tsx]"]
  node_agent_network["Agent network view<br/>[AgentNetwork.tsx]"]
  node_history["Run history<br/>[HistoryPage.tsx]"]
  node_knowledge_view["Knowledge view<br/>[KnowledgePage.tsx]"]
end

subgraph group_api["API and Persistence"]
  node_api["FastAPI endpoints<br/>[main.py]"]
  node_db[("Run and knowledge DB<br/>[database.py]")]
end

subgraph group_runtime["Pipeline Runtime"]
  node_runner["Pipeline runners"]
  node_schemas["Evidence and run models<br/>[schemas.py]"]
end

subgraph group_agents["Evidence Agents"]
  node_failure["Failure detection"]
  node_root_cause["Root cause analysis"]
  node_data_quality["Data quality checks<br/>[data_quality.py]"]
  node_model_analysis["Model analysis<br/>[model_analysis.py]"]
  node_resource_monitor["Resource monitoring"]
end

subgraph group_recovery["Recovery and Learning"]
  node_decision["Strategy ranking<br/>[engine.py]"]
  node_recovery_agent["Recovery planning<br/>[recovery.py]"]
  node_verification["Recovery verification<br/>[verification.py]"]
  node_knowledge[("Recovery knowledge")]
end

node_operator(("Pipeline user"))

node_operator -->|"uses"| node_app
node_app -->|"renders"| node_setup
node_app -->|"renders"| node_monitor
node_app -->|"renders"| node_history
node_app -->|"renders"| node_knowledge_view
node_monitor -->|"renders"| node_agent_network
node_setup -->|"submits run"| node_api
node_monitor -.->|"receives run updates"| node_api
node_history -.->|"reads history"| node_api
node_knowledge_view -.->|"reads knowledge"| node_api
node_api -->|"starts run"| node_runner
node_api -->|"reads and writes"| node_db
node_runner -->|"detects failures"| node_failure
node_runner -->|"diagnoses evidence"| node_root_cause
node_runner -->|"checks data"| node_data_quality
node_runner -->|"analyzes metrics"| node_model_analysis
node_runner -->|"monitors resources"| node_resource_monitor
node_runner -->|"ranks strategies"| node_decision
node_runner -->|"plans recovery"| node_recovery_agent
node_runner -->|"checks recovery"| node_verification
node_runner -->|"advises and records"| node_knowledge
node_decision -->|"looks up outcomes"| node_knowledge
node_knowledge -->|"persists entries"| node_db
node_runner -->|"uses run models"| node_schemas

click node_app "https://github.com/shivadharshini25/final_year_project/blob/main/frontend/src/App.tsx"
click node_setup "https://github.com/shivadharshini25/final_year_project/blob/main/frontend/src/pages/SetupPage.tsx"
click node_monitor "https://github.com/shivadharshini25/final_year_project/blob/main/frontend/src/pages/MonitorPage.tsx"
click node_agent_network "https://github.com/shivadharshini25/final_year_project/blob/main/frontend/src/components/AgentNetwork.tsx"
click node_history "https://github.com/shivadharshini25/final_year_project/blob/main/frontend/src/pages/HistoryPage.tsx"
click node_knowledge_view "https://github.com/shivadharshini25/final_year_project/blob/main/frontend/src/pages/KnowledgePage.tsx"
click node_api "https://github.com/shivadharshini25/final_year_project/blob/main/api/main.py"
click node_db "https://github.com/shivadharshini25/final_year_project/blob/main/api/database.py"
click node_runner "https://github.com/shivadharshini25/final_year_project/tree/main/orchestrator"
click node_schemas "https://github.com/shivadharshini25/final_year_project/blob/main/agents/schemas.py"
click node_failure "https://github.com/shivadharshini25/final_year_project/blob/main/agents/failure_detection.py"
click node_root_cause "https://github.com/shivadharshini25/final_year_project/blob/main/agents/root_cause_analysis.py"
click node_data_quality "https://github.com/shivadharshini25/final_year_project/blob/main/agents/data_quality.py"
click node_model_analysis "https://github.com/shivadharshini25/final_year_project/blob/main/agents/model_analysis.py"
click node_resource_monitor "https://github.com/shivadharshini25/final_year_project/blob/main/agents/resource_monitoring.py"
click node_decision "https://github.com/shivadharshini25/final_year_project/blob/main/decision_engine/engine.py"
click node_recovery_agent "https://github.com/shivadharshini25/final_year_project/blob/main/agents/recovery.py"
click node_verification "https://github.com/shivadharshini25/final_year_project/blob/main/agents/verification.py"
click node_knowledge "https://github.com/shivadharshini25/final_year_project/blob/main/agents/knowledge_repository.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_setup,node_monitor,node_agent_network,node_history,node_knowledge_view,node_operator toneBlue
class node_api,node_db toneAmber
class node_runner,node_schemas toneMint
class node_failure,node_root_cause,node_data_quality,node_model_analysis,node_resource_monitor toneRose
class node_decision,node_recovery_agent,node_verification,node_knowledge toneIndigo
```

## Components

### Dashboard

- [Dashboard shell](https://github.com/shivadharshini25/final_year_project/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Run setup](https://github.com/shivadharshini25/final_year_project/blob/main/frontend/src/pages/SetupPage.tsx): `frontend/src/pages/SetupPage.tsx`
- [Live monitor](https://github.com/shivadharshini25/final_year_project/blob/main/frontend/src/pages/MonitorPage.tsx): `frontend/src/pages/MonitorPage.tsx`
- [Agent network view](https://github.com/shivadharshini25/final_year_project/blob/main/frontend/src/components/AgentNetwork.tsx): `frontend/src/components/AgentNetwork.tsx`
- [Run history](https://github.com/shivadharshini25/final_year_project/blob/main/frontend/src/pages/HistoryPage.tsx): `frontend/src/pages/HistoryPage.tsx`
- [Knowledge view](https://github.com/shivadharshini25/final_year_project/blob/main/frontend/src/pages/KnowledgePage.tsx): `frontend/src/pages/KnowledgePage.tsx`

### API and Persistence

- [FastAPI endpoints](https://github.com/shivadharshini25/final_year_project/blob/main/api/main.py): `api/main.py`
- [Run and knowledge DB](https://github.com/shivadharshini25/final_year_project/blob/main/api/database.py): `api/database.py`

### Pipeline Runtime

- [Pipeline runners](https://github.com/shivadharshini25/final_year_project/tree/main/orchestrator): `orchestrator`
- [Evidence and run models](https://github.com/shivadharshini25/final_year_project/blob/main/agents/schemas.py): `agents/schemas.py`

### Evidence Agents

- [Failure detection](https://github.com/shivadharshini25/final_year_project/blob/main/agents/failure_detection.py): `agents/failure_detection.py`
- [Root cause analysis](https://github.com/shivadharshini25/final_year_project/blob/main/agents/root_cause_analysis.py): `agents/root_cause_analysis.py`
- [Data quality checks](https://github.com/shivadharshini25/final_year_project/blob/main/agents/data_quality.py): `agents/data_quality.py`
- [Model analysis](https://github.com/shivadharshini25/final_year_project/blob/main/agents/model_analysis.py): `agents/model_analysis.py`
- [Resource monitoring](https://github.com/shivadharshini25/final_year_project/blob/main/agents/resource_monitoring.py): `agents/resource_monitoring.py`

### Recovery and Learning

- [Strategy ranking](https://github.com/shivadharshini25/final_year_project/blob/main/decision_engine/engine.py): `decision_engine/engine.py`
- [Recovery planning](https://github.com/shivadharshini25/final_year_project/blob/main/agents/recovery.py): `agents/recovery.py`
- [Recovery verification](https://github.com/shivadharshini25/final_year_project/blob/main/agents/verification.py): `agents/verification.py`
- [Recovery knowledge](https://github.com/shivadharshini25/final_year_project/blob/main/agents/knowledge_repository.py): `agents/knowledge_repository.py`

### Other components

- **Pipeline user**

## Connections

- Pipeline user → Dashboard shell: uses (evidence: `README.md`)
- Dashboard shell → Run setup: renders (evidence: `frontend/src/App.tsx`)
- Dashboard shell → Live monitor: renders (evidence: `frontend/src/App.tsx`)
- Dashboard shell → Run history: renders (evidence: `frontend/src/App.tsx`)
- Dashboard shell → Knowledge view: renders (evidence: `frontend/src/App.tsx`)
- Live monitor → Agent network view: renders (evidence: `frontend/src/pages/MonitorPage.tsx`)
- Run setup → FastAPI endpoints: submits run (evidence: `README.md`)
- Live monitor → FastAPI endpoints: receives run updates
- Run history → FastAPI endpoints: reads history
- Knowledge view → FastAPI endpoints: reads knowledge
- FastAPI endpoints → Pipeline runners: starts run (evidence: `api/main.py`)
- FastAPI endpoints → Run and knowledge DB: reads and writes (evidence: `api/main.py`)
- Pipeline runners → Failure detection: detects failures (evidence: `README.md`)
- Pipeline runners → Root cause analysis: diagnoses evidence (evidence: `README.md`)
- Pipeline runners → Data quality checks: checks data (evidence: `README.md`)
- Pipeline runners → Model analysis: analyzes metrics (evidence: `README.md`)
- Pipeline runners → Resource monitoring: monitors resources (evidence: `README.md`)
- Pipeline runners → Strategy ranking: ranks strategies (evidence: `orchestrator/pipeline_runner.py`)
- Pipeline runners → Recovery planning: plans recovery (evidence: `README.md`)
- Pipeline runners → Recovery verification: checks recovery (evidence: `README.md`)
- Pipeline runners → Recovery knowledge: advises and records (evidence: `orchestrator/pipeline_runner.py`)
- Strategy ranking → Recovery knowledge: looks up outcomes (evidence: `decision_engine/engine.py`)
- Recovery knowledge → Run and knowledge DB: persists entries (evidence: `agents/knowledge_repository.py`)
- Pipeline runners → Evidence and run models: uses run models (evidence: `orchestrator/pipeline_runner.py`)
