# anushkabadakh/sentinel-ai architecture

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

- Interactive diagram: https://gitdiagram.com/anushkabadakh/sentinel-ai
- Repository: https://github.com/anushkabadakh/sentinel-ai

## Overview

SentinelAI is a web application for analysing dependencies, sequencing, risks, resource conflicts, and bottlenecks across an enterprise transformation programme. Users explore the dashboard and analysis views or submit a new initiative for live analysis; the backend routes requests to deterministic graph and rule engines, persists programme data in SQLite, and returns evidence-based explanations. The new-initiative path grounds free text against known technologies and teams before assessing impact and collisions. Edges reflect README statements and shown source references; unsampled route details are not inferred.

Main entry points: [`backend/app.py`](https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/app.py) (REST API), [`backend/engine/new_initiative_analyzer.py`](https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/engine/new_initiative_analyzer.py) (New Initiative Analysis), [`backend/engine/risk_engine.py`](https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/engine/risk_engine.py) (Risk Scoring), [`backend/ai_service.py`](https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/ai_service.py) (Explanation Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Web Interface"]
  node_frontend["Web App<br/>[app.js]"]
end

subgraph group_service["API and Analysis"]
  node_api["REST API<br/>[app.py]"]
  node_new_analysis["New Initiative Analysis"]
  node_explanations["Explanation Service<br/>[ai_service.py]"]
end

subgraph group_reasoning["Analysis Engines"]
  node_graph_builder["Dependency Graph<br/>[graph_builder.py]"]
  node_dependency["Dependency Analysis"]
  node_risk["Risk Scoring<br/>[risk_engine.py]"]
  node_conflicts["Conflict Detection<br/>[conflict_engine.py]"]
  node_bottlenecks["Bottleneck Detection"]
  node_sequencing["Build Sequencing"]
  node_nlp["Grounded Extraction<br/>[nlp_extract.py]"]
end

subgraph group_data["Programme Data"]
  node_database[("SQLite Store<br/>[db.py]")]
  node_seed["Scenario Seed Data<br/>[seed_data.py]"]
end

node_user(("Programme User"))
node_llm["Optional LLM Service"]

node_user -->|"uses"| node_frontend
node_frontend -->|"sends REST requests"| node_api
node_api -->|"reads and writes"| node_database
node_api -->|"requests graph"| node_graph_builder
node_api -->|"requests analysis"| node_dependency
node_api -->|"requests scoring"| node_risk
node_api -->|"requests detection"| node_conflicts
node_api -->|"requests detection"| node_bottlenecks
node_api -->|"requests sequence"| node_sequencing
node_api -->|"routes analysis"| node_new_analysis
node_api -->|"requests explanation"| node_explanations
node_graph_builder -->|"loads graph data"| node_database
node_risk -->|"uses report"| node_dependency
node_risk -->|"checks collisions"| node_conflicts
node_new_analysis -->|"matches text"| node_nlp
node_new_analysis -->|"builds landscape"| node_graph_builder
node_new_analysis -->|"tests allocations"| node_conflicts
node_new_analysis -->|"checks bottlenecks"| node_bottlenecks
node_new_analysis -->|"requests explanation"| node_explanations
node_database -->|"seeds on first run"| node_seed
node_explanations -.->|"optionally calls"| node_llm

click node_frontend "https://github.com/anushkabadakh/sentinel-ai/blob/main/frontend/app.js"
click node_api "https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/app.py"
click node_new_analysis "https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/engine/new_initiative_analyzer.py"
click node_explanations "https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/ai_service.py"
click node_graph_builder "https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/engine/graph_builder.py"
click node_dependency "https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/engine/dependency_engine.py"
click node_risk "https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/engine/risk_engine.py"
click node_conflicts "https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/engine/conflict_engine.py"
click node_bottlenecks "https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/engine/bottleneck_engine.py"
click node_sequencing "https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/engine/sequencing_engine.py"
click node_nlp "https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/engine/nlp_extract.py"
click node_database "https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/db.py"
click node_seed "https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/seed_data.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_frontend,node_user toneBlue
class node_api,node_new_analysis,node_explanations toneAmber
class node_graph_builder,node_dependency,node_risk,node_conflicts,node_bottlenecks,node_sequencing,node_nlp toneMint
class node_database,node_seed toneRose
class node_llm toneIndigo
```

## Components

### Web Interface

- [Web App](https://github.com/anushkabadakh/sentinel-ai/blob/main/frontend/app.js): `frontend/app.js`

### API and Analysis

- [REST API](https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/app.py): `backend/app.py`
- [New Initiative Analysis](https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/engine/new_initiative_analyzer.py): `backend/engine/new_initiative_analyzer.py`
- [Explanation Service](https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/ai_service.py): `backend/ai_service.py`

### Analysis Engines

- [Dependency Graph](https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/engine/graph_builder.py): `backend/engine/graph_builder.py`
- [Dependency Analysis](https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/engine/dependency_engine.py): `backend/engine/dependency_engine.py`
- [Risk Scoring](https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/engine/risk_engine.py): `backend/engine/risk_engine.py`
- [Conflict Detection](https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/engine/conflict_engine.py): `backend/engine/conflict_engine.py`
- [Bottleneck Detection](https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/engine/bottleneck_engine.py): `backend/engine/bottleneck_engine.py`
- [Build Sequencing](https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/engine/sequencing_engine.py): `backend/engine/sequencing_engine.py`
- [Grounded Extraction](https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/engine/nlp_extract.py): `backend/engine/nlp_extract.py`

### Programme Data

- [SQLite Store](https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/db.py): `backend/db.py`
- [Scenario Seed Data](https://github.com/anushkabadakh/sentinel-ai/blob/main/backend/seed_data.py): `backend/seed_data.py`

### Other components

- **Programme User**
- **Optional LLM Service**

## Connections

- Programme User → Web App: uses (evidence: `README.md`)
- Web App → REST API: sends REST requests (evidence: `README.md`)
- REST API → SQLite Store: reads and writes (evidence: `backend/app.py`)
- REST API → Dependency Graph: requests graph (evidence: `backend/app.py`)
- REST API → Dependency Analysis: requests analysis (evidence: `backend/app.py`)
- REST API → Risk Scoring: requests scoring (evidence: `backend/app.py`)
- REST API → Conflict Detection: requests detection (evidence: `backend/app.py`)
- REST API → Bottleneck Detection: requests detection (evidence: `backend/app.py`)
- REST API → Build Sequencing: requests sequence (evidence: `backend/app.py`)
- REST API → New Initiative Analysis: routes analysis (evidence: `backend/app.py`)
- REST API → Explanation Service: requests explanation (evidence: `backend/app.py`)
- Dependency Graph → SQLite Store: loads graph data (evidence: `backend/engine/graph_builder.py`)
- Risk Scoring → Dependency Analysis: uses report (evidence: `backend/engine/risk_engine.py`)
- Risk Scoring → Conflict Detection: checks collisions (evidence: `backend/engine/risk_engine.py`)
- New Initiative Analysis → Grounded Extraction: matches text (evidence: `backend/engine/new_initiative_analyzer.py`)
- New Initiative Analysis → Dependency Graph: builds landscape (evidence: `backend/engine/new_initiative_analyzer.py`)
- New Initiative Analysis → Conflict Detection: tests allocations (evidence: `backend/engine/new_initiative_analyzer.py`)
- New Initiative Analysis → Bottleneck Detection: checks bottlenecks (evidence: `backend/engine/new_initiative_analyzer.py`)
- New Initiative Analysis → Explanation Service: requests explanation (evidence: `backend/engine/new_initiative_analyzer.py`)
- SQLite Store → Scenario Seed Data: seeds on first run (evidence: `backend/db.py`)
- Explanation Service → Optional LLM Service: optionally calls (evidence: `README.md`)
