# teamastrax/sentinelai architecture

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

- Interactive diagram: https://gitdiagram.com/teamastrax/sentinelai
- Repository: https://github.com/teamastrax/sentinelai

## Overview

SentinelAI is a behavioral threat-detection product with a FastAPI backend and SOC dashboards in Streamlit and Next.js. The principal workflow is activity and historical context through behavioral profiling and hybrid detection, then explainable alerts for investigation and simulated containment. MITRE mapping, graph analysis, model evaluation, and a read-only experimental quantum plane are additional capabilities. The README documents the product-level stages; source excerpts and the SOURCE INDEX support only some internal links, so unverified implementation links are omitted or marked dashed.

Main entry points: [`src/sentinel_ai/api/app.py`](https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/api/app.py) (FastAPI), [`src/sentinel_ai/response/service.py`](https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/response/service.py) (Containment service), [`src/sentinel_ai/features/builder.py`](https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/features/builder.py) (Feature building), [`src/sentinel_ai/services/sentinel_service.py`](https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/services/sentinel_service.py) (Sentinel service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontends["SOC interfaces"]
  node_dashboard["Streamlit dashboard<br/>[streamlit_app.py]"]
  node_web["Next.js SOC dashboard<br/>[page.tsx]"]
  node_data["Frontend data sources<br/>[data-source.ts]"]
end

subgraph group_analysis["Detection and context"]
  node_activity["Activity intake"]
  node_baselines["Behavioral baselines<br/>[service.py]"]
  node_features["Feature building<br/>[builder.py]"]
  node_rules["Rule detection<br/>[rules.py]"]
  node_models["Anomaly models"]
  node_sequence["Sequence analysis<br/>[sequences.py]"]
  node_risk["Hybrid risk scoring<br/>[risk.py]"]
  node_service["Sentinel service"]
  node_database[("SQLite store<br/>[database.py]")]
  node_api["FastAPI<br/>[app.py]"]
end

subgraph group_intel["Threat intelligence"]
  node_mitre["MITRE mapping and stories<br/>[mapper.py]"]
  node_graph["Graph analysis<br/>[analyzer.py]"]
end

subgraph group_response["Response management"]
  node_response["Containment service<br/>[service.py]"]
  node_policy["Response policy<br/>[policy.py]"]
  node_adapter["Simulation adapter<br/>[adapter.py]"]
end

subgraph group_experimental["Experimental quantum"]
  node_quantum["Quantum analysis<br/>[analysis.py]"]
  node_qaoa["QAOA prioritization<br/>[qaoa_optimizer.py]"]
  node_quantumui["Quantum lab<br/>[page.tsx]"]
end

node_analyst(("SOC analyst"))

node_analyst -->|"investigates"| node_dashboard
node_analyst -->|"investigates"| node_web
node_activity -.->|"profiles behavior"| node_baselines
node_baselines -.->|"provides context"| node_features
node_features -.->|"supports detection"| node_rules
node_features -.->|"supports scoring"| node_models
node_rules -.->|"contributes evidence"| node_risk
node_models -.->|"contributes score"| node_risk
node_sequence -.->|"adds context"| node_risk
node_service -.->|"persists and reads"| node_database
node_api -->|"orchestrates"| node_service
node_dashboard -.->|"uses"| node_service
node_api -.->|"serves threat intelligence"| node_mitre
node_api -.->|"serves graph findings"| node_graph
node_web -->|"requests dashboard data"| node_data
node_data -.->|"fetches API data"| node_api
node_api -->|"exposes containment"| node_response
node_response -->|"checks policy"| node_policy
node_response -->|"applies actions"| node_adapter
node_response -->|"records actions"| node_database
node_api -->|"exposes analysis"| node_quantum
node_api -.->|"exposes prioritization"| node_qaoa
node_quantumui -.->|"requests analysis"| node_api
node_quantumui -->|"shows rankings"| node_qaoa

click node_activity "https://github.com/teamastrax/sentinelai/tree/main/src/sentinel_ai/ingestion"
click node_baselines "https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/baselines/service.py"
click node_features "https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/features/builder.py"
click node_rules "https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/detection/rules.py"
click node_models "https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/models/isolation_forest.py"
click node_sequence "https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/detection/sequences.py"
click node_risk "https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/detection/risk.py"
click node_service "https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/services/sentinel_service.py"
click node_database "https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/storage/database.py"
click node_api "https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/api/app.py"
click node_mitre "https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/mitre/mapper.py"
click node_graph "https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/graph/analyzer.py"
click node_dashboard "https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/ui/streamlit_app.py"
click node_web "https://github.com/teamastrax/sentinelai/blob/main/frontend/src/app/page.tsx"
click node_data "https://github.com/teamastrax/sentinelai/blob/main/frontend/src/data/data-source.ts"
click node_response "https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/response/service.py"
click node_policy "https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/response/policy.py"
click node_adapter "https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/response/adapter.py"
click node_quantum "https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/quantum/analysis.py"
click node_qaoa "https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/quantum/qaoa_optimizer.py"
click node_quantumui "https://github.com/teamastrax/sentinelai/blob/main/frontend/src/app/quantum/page.tsx"

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_dashboard,node_web,node_data toneBlue
class node_activity,node_baselines,node_features,node_rules,node_models,node_sequence,node_risk,node_service,node_database,node_api toneAmber
class node_mitre,node_graph toneMint
class node_response,node_policy,node_adapter toneRose
class node_quantum,node_qaoa,node_quantumui,node_analyst toneIndigo
```

## Components

### SOC interfaces

- [Streamlit dashboard](https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/ui/streamlit_app.py): `src/sentinel_ai/ui/streamlit_app.py`
- [Next.js SOC dashboard](https://github.com/teamastrax/sentinelai/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Frontend data sources](https://github.com/teamastrax/sentinelai/blob/main/frontend/src/data/data-source.ts): `frontend/src/data/data-source.ts`

### Detection and context

- [Activity intake](https://github.com/teamastrax/sentinelai/tree/main/src/sentinel_ai/ingestion): `src/sentinel_ai/ingestion`
- [Behavioral baselines](https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/baselines/service.py): `src/sentinel_ai/baselines/service.py`
- [Feature building](https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/features/builder.py): `src/sentinel_ai/features/builder.py`
- [Rule detection](https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/detection/rules.py): `src/sentinel_ai/detection/rules.py`
- [Anomaly models](https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/models/isolation_forest.py): `src/sentinel_ai/models/isolation_forest.py`
- [Sequence analysis](https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/detection/sequences.py): `src/sentinel_ai/detection/sequences.py`
- [Hybrid risk scoring](https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/detection/risk.py): `src/sentinel_ai/detection/risk.py`
- [Sentinel service](https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/services/sentinel_service.py): `src/sentinel_ai/services/sentinel_service.py`
- [SQLite store](https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/storage/database.py): `src/sentinel_ai/storage/database.py`
- [FastAPI](https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/api/app.py): `src/sentinel_ai/api/app.py`

### Threat intelligence

- [MITRE mapping and stories](https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/mitre/mapper.py): `src/sentinel_ai/mitre/mapper.py`
- [Graph analysis](https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/graph/analyzer.py): `src/sentinel_ai/graph/analyzer.py`

### Response management

- [Containment service](https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/response/service.py): `src/sentinel_ai/response/service.py`
- [Response policy](https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/response/policy.py): `src/sentinel_ai/response/policy.py`
- [Simulation adapter](https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/response/adapter.py): `src/sentinel_ai/response/adapter.py`

### Experimental quantum

- [Quantum analysis](https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/quantum/analysis.py): `src/sentinel_ai/quantum/analysis.py`
- [QAOA prioritization](https://github.com/teamastrax/sentinelai/blob/main/src/sentinel_ai/quantum/qaoa_optimizer.py): `src/sentinel_ai/quantum/qaoa_optimizer.py`
- [Quantum lab](https://github.com/teamastrax/sentinelai/blob/main/frontend/src/app/quantum/page.tsx): `frontend/src/app/quantum/page.tsx`

### Other components

- **SOC analyst**

## Connections

- SOC analyst → Streamlit dashboard: investigates (evidence: `README.md`)
- SOC analyst → Next.js SOC dashboard: investigates (evidence: `README.md`)
- Activity intake → Behavioral baselines: profiles behavior
- Behavioral baselines → Feature building: provides context
- Feature building → Rule detection: supports detection
- Feature building → Anomaly models: supports scoring
- Rule detection → Hybrid risk scoring: contributes evidence
- Anomaly models → Hybrid risk scoring: contributes score
- Sequence analysis → Hybrid risk scoring: adds context
- Sentinel service → SQLite store: persists and reads
- FastAPI → Sentinel service: orchestrates (evidence: `src/sentinel_ai/api/app.py`)
- Streamlit dashboard → Sentinel service: uses
- FastAPI → MITRE mapping and stories: serves threat intelligence
- FastAPI → Graph analysis: serves graph findings
- Next.js SOC dashboard → Frontend data sources: requests dashboard data (evidence: `frontend/src/app/page.tsx`)
- Frontend data sources → FastAPI: fetches API data
- FastAPI → Containment service: exposes containment (evidence: `src/sentinel_ai/api/app.py`)
- Containment service → Response policy: checks policy (evidence: `src/sentinel_ai/response/service.py`)
- Containment service → Simulation adapter: applies actions (evidence: `src/sentinel_ai/response/service.py`)
- Containment service → SQLite store: records actions (evidence: `src/sentinel_ai/response/service.py`)
- FastAPI → Quantum analysis: exposes analysis (evidence: `src/sentinel_ai/api/app.py`)
- FastAPI → QAOA prioritization: exposes prioritization
- Quantum lab → FastAPI: requests analysis
- Quantum lab → QAOA prioritization: shows rankings (evidence: `frontend/src/app/quantum/page.tsx`)
