# abhinavteja123/sentinel_ai architecture

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

- Interactive diagram: https://gitdiagram.com/abhinavteja123/sentinel_ai
- Repository: https://github.com/abhinavteja123/sentinel_ai

## Overview

SENTINEL-AI is an autonomous incident-management platform with a React dashboard, a Python backend, and an optional Google ADK chat integration. Its main workflow generates logs, detects anomalies, classifies risk, plans remediation, routes higher-risk cases through human approval, executes remediation, and retains incident patterns in agent memory. The dashboard presents logs, incidents, agent activity, approvals, and chat over real-time updates. The graph follows README-described workflow links where source excerpts are incomplete; dashed edges mark optional integrations. No persistent database is evident in the supplied tree.

Main entry points: [`backend/services/orchestrator.py`](https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/services/orchestrator.py) (Workflow Orchestrator), [`frontend/src/App.jsx`](https://github.com/abhinavteja123/sentinel_ai/blob/main/frontend/src/App.jsx) (Dashboard App), [`backend/agents/incident_detector.py`](https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/agents/incident_detector.py) (Incident Detector), [`backend/agents/planner.py`](https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/agents/planner.py) (Remediation Planner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_backend["Incident Backend"]
  node_main["API Server<br/>[main.py]"]
  node_orchestrator["Workflow Orchestrator<br/>[orchestrator.py]"]
  node_config["Runtime Configuration<br/>[config.py]"]
  node_models["Incident Models<br/>[__init__.py]"]
  node_logwatcher["Log Generator<br/>[log_watcher.py]"]
  node_notifications["Alert Delivery"]
end

subgraph group_analysis["Analysis And Response"]
  node_detector["Incident Detector"]
  node_anomaly["Anomaly Detection"]
  node_risk["Risk Classifier<br/>[risk_classifier.py]"]
  node_planner["Remediation Planner<br/>[planner.py]"]
  node_llm["Gemini LLM Service<br/>[llm_service.py]"]
  node_approval["Human Approval<br/>[approval.py]"]
  node_executor["Remediation Executor<br/>[executor.py]"]
  node_memory["Incident Memory<br/>[memory.py]"]
end

subgraph group_realtime["Realtime Interface"]
  node_wsmanager["WebSocket Manager<br/>[__init__.py]"]
  node_frontend["Dashboard App<br/>[App.jsx]"]
  node_socket_hook["WebSocket Hook<br/>[useWebSocket.js]"]
  node_logview["Log Stream<br/>[LogStream.jsx]"]
  node_incidentview["Incident Views<br/>[IncidentList.jsx]"]
  node_details["Incident Details"]
  node_observer["Agent Observer<br/>[AgentObserver.jsx]"]
  node_approvalview["Approval Popup<br/>[ApprovalPopup.jsx]"]
end

subgraph group_chat["Chat Integrations"]
  node_chatagent["Incident Chat Agent<br/>[chat.py]"]
  node_adkservice["ADK Chat Service"]
  node_adkview["ADK Chat UI<br/>[ADKChat.jsx]"]
  node_adkagent["Optional ADK Agent<br/>[agent.py]"]
end

node_operator(("SRE Operator"))

node_operator -->|"uses dashboard"| node_frontend
node_main -->|"routes workflow"| node_orchestrator
node_main -->|"serves chat"| node_adkservice
node_orchestrator -->|"starts agent"| node_logwatcher
node_orchestrator -->|"coordinates agent"| node_detector
node_orchestrator -->|"coordinates agent"| node_risk
node_orchestrator -->|"coordinates agent"| node_planner
node_orchestrator -->|"coordinates agent"| node_approval
node_orchestrator -->|"calls executor"| node_executor
node_orchestrator -->|"stores incident"| node_memory
node_orchestrator -->|"coordinates agent"| node_chatagent
node_logwatcher -->|"sends logs"| node_detector
node_detector -->|"analyzes logs"| node_anomaly
node_detector -->|"creates incident"| node_risk
node_risk -->|"classifies risk"| node_planner
node_planner -->|"requests analysis"| node_llm
node_planner -->|"requests approval"| node_approval
node_approval -->|"approves plan"| node_executor
node_approval -->|"sends critical alerts"| node_notifications
node_executor -->|"records outcome"| node_memory
node_chatagent -->|"requests analysis"| node_llm
node_frontend -->|"opens updates"| node_socket_hook
node_frontend -->|"renders logs"| node_logview
node_frontend -->|"renders incidents"| node_incidentview
node_frontend -->|"renders details"| node_details
node_frontend -->|"renders activity"| node_observer
node_frontend -->|"renders approvals"| node_approvalview
node_frontend -->|"renders chat"| node_adkview
node_wsmanager -->|"broadcasts updates"| node_socket_hook
node_adkview -.->|"requests chat"| node_adkservice
node_adkservice -.->|"optional integration"| node_adkagent
node_config -->|"sets timing"| node_logwatcher
node_config -->|"sets thresholds"| node_anomaly
node_config -->|"selects provider"| node_llm

click node_main "https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/main.py"
click node_orchestrator "https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/services/orchestrator.py"
click node_config "https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/config.py"
click node_models "https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/models/__init__.py"
click node_logwatcher "https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/agents/log_watcher.py"
click node_detector "https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/agents/incident_detector.py"
click node_anomaly "https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/services/anomaly_detection.py"
click node_risk "https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/agents/risk_classifier.py"
click node_planner "https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/agents/planner.py"
click node_llm "https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/services/llm_service.py"
click node_approval "https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/agents/approval.py"
click node_executor "https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/agents/executor.py"
click node_memory "https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/agents/memory.py"
click node_chatagent "https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/agents/chat.py"
click node_notifications "https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/services/notification_service.py"
click node_wsmanager "https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/websocket/__init__.py"
click node_frontend "https://github.com/abhinavteja123/sentinel_ai/blob/main/frontend/src/App.jsx"
click node_socket_hook "https://github.com/abhinavteja123/sentinel_ai/blob/main/frontend/src/hooks/useWebSocket.js"
click node_logview "https://github.com/abhinavteja123/sentinel_ai/blob/main/frontend/src/components/LogStream.jsx"
click node_incidentview "https://github.com/abhinavteja123/sentinel_ai/blob/main/frontend/src/components/IncidentList.jsx"
click node_details "https://github.com/abhinavteja123/sentinel_ai/blob/main/frontend/src/components/IncidentDetails.jsx"
click node_observer "https://github.com/abhinavteja123/sentinel_ai/blob/main/frontend/src/components/AgentObserver.jsx"
click node_approvalview "https://github.com/abhinavteja123/sentinel_ai/blob/main/frontend/src/components/ApprovalPopup.jsx"
click node_adkservice "https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/services/adk_chat_service.py"
click node_adkview "https://github.com/abhinavteja123/sentinel_ai/blob/main/frontend/src/components/ADKChat.jsx"
click node_adkagent "https://github.com/abhinavteja123/sentinel_ai/blob/main/my_agent/agent.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_main,node_orchestrator,node_config,node_models,node_logwatcher,node_notifications toneBlue
class node_detector,node_anomaly,node_risk,node_planner,node_llm,node_approval,node_executor,node_memory toneAmber
class node_wsmanager,node_frontend,node_socket_hook,node_logview,node_incidentview,node_details,node_observer,node_approvalview toneMint
class node_chatagent,node_adkservice,node_adkview,node_adkagent toneRose
class node_operator toneIndigo
```

## Components

### Incident Backend

- [API Server](https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/main.py): `backend/main.py`
- [Workflow Orchestrator](https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/services/orchestrator.py): `backend/services/orchestrator.py`
- [Runtime Configuration](https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/config.py): `backend/config.py`
- [Incident Models](https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/models/__init__.py): `backend/models/__init__.py`
- [Log Generator](https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/agents/log_watcher.py): `backend/agents/log_watcher.py`
- [Alert Delivery](https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/services/notification_service.py): `backend/services/notification_service.py`

### Analysis And Response

- [Incident Detector](https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/agents/incident_detector.py): `backend/agents/incident_detector.py`
- [Anomaly Detection](https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/services/anomaly_detection.py): `backend/services/anomaly_detection.py`
- [Risk Classifier](https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/agents/risk_classifier.py): `backend/agents/risk_classifier.py`
- [Remediation Planner](https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/agents/planner.py): `backend/agents/planner.py`
- [Gemini LLM Service](https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/services/llm_service.py): `backend/services/llm_service.py`
- [Human Approval](https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/agents/approval.py): `backend/agents/approval.py`
- [Remediation Executor](https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/agents/executor.py): `backend/agents/executor.py`
- [Incident Memory](https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/agents/memory.py): `backend/agents/memory.py`

### Realtime Interface

- [WebSocket Manager](https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/websocket/__init__.py): `backend/websocket/__init__.py`
- [Dashboard App](https://github.com/abhinavteja123/sentinel_ai/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [WebSocket Hook](https://github.com/abhinavteja123/sentinel_ai/blob/main/frontend/src/hooks/useWebSocket.js): `frontend/src/hooks/useWebSocket.js`
- [Log Stream](https://github.com/abhinavteja123/sentinel_ai/blob/main/frontend/src/components/LogStream.jsx): `frontend/src/components/LogStream.jsx`
- [Incident Views](https://github.com/abhinavteja123/sentinel_ai/blob/main/frontend/src/components/IncidentList.jsx): `frontend/src/components/IncidentList.jsx`
- [Incident Details](https://github.com/abhinavteja123/sentinel_ai/blob/main/frontend/src/components/IncidentDetails.jsx): `frontend/src/components/IncidentDetails.jsx`
- [Agent Observer](https://github.com/abhinavteja123/sentinel_ai/blob/main/frontend/src/components/AgentObserver.jsx): `frontend/src/components/AgentObserver.jsx`
- [Approval Popup](https://github.com/abhinavteja123/sentinel_ai/blob/main/frontend/src/components/ApprovalPopup.jsx): `frontend/src/components/ApprovalPopup.jsx`

### Chat Integrations

- [Incident Chat Agent](https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/agents/chat.py): `backend/agents/chat.py`
- [ADK Chat Service](https://github.com/abhinavteja123/sentinel_ai/blob/main/backend/services/adk_chat_service.py): `backend/services/adk_chat_service.py`
- [ADK Chat UI](https://github.com/abhinavteja123/sentinel_ai/blob/main/frontend/src/components/ADKChat.jsx): `frontend/src/components/ADKChat.jsx`
- [Optional ADK Agent](https://github.com/abhinavteja123/sentinel_ai/blob/main/my_agent/agent.py): `my_agent/agent.py`

### Other components

- **SRE Operator**

## Connections

- SRE Operator → Dashboard App: uses dashboard (evidence: `README.md`)
- API Server → Workflow Orchestrator: routes workflow (evidence: `backend/main.py`)
- API Server → ADK Chat Service: serves chat (evidence: `backend/main.py`)
- Workflow Orchestrator → Log Generator: starts agent (evidence: `backend/services/orchestrator.py`)
- Workflow Orchestrator → Incident Detector: coordinates agent (evidence: `backend/services/orchestrator.py`)
- Workflow Orchestrator → Risk Classifier: coordinates agent (evidence: `backend/services/orchestrator.py`)
- Workflow Orchestrator → Remediation Planner: coordinates agent (evidence: `backend/services/orchestrator.py`)
- Workflow Orchestrator → Human Approval: coordinates agent (evidence: `backend/services/orchestrator.py`)
- Workflow Orchestrator → Remediation Executor: calls executor (evidence: `backend/services/orchestrator.py`)
- Workflow Orchestrator → Incident Memory: stores incident (evidence: `backend/services/orchestrator.py`)
- Workflow Orchestrator → Incident Chat Agent: coordinates agent (evidence: `backend/services/orchestrator.py`)
- Log Generator → Incident Detector: sends logs (evidence: `README.md`)
- Incident Detector → Anomaly Detection: analyzes logs (evidence: `backend/agents/incident_detector.py`)
- Incident Detector → Risk Classifier: creates incident (evidence: `README.md`)
- Risk Classifier → Remediation Planner: classifies risk (evidence: `README.md`)
- Remediation Planner → Gemini LLM Service: requests analysis (evidence: `backend/agents/planner.py`)
- Remediation Planner → Human Approval: requests approval (evidence: `README.md`)
- Human Approval → Remediation Executor: approves plan (evidence: `backend/services/orchestrator.py`)
- Human Approval → Alert Delivery: sends critical alerts (evidence: `backend/agents/approval.py`)
- Remediation Executor → Incident Memory: records outcome (evidence: `backend/services/orchestrator.py`)
- Incident Chat Agent → Gemini LLM Service: requests analysis (evidence: `backend/agents/chat.py`)
- Dashboard App → WebSocket Hook: opens updates (evidence: `frontend/src/App.jsx`)
- Dashboard App → Log Stream: renders logs (evidence: `frontend/src/App.jsx`)
- Dashboard App → Incident Views: renders incidents (evidence: `frontend/src/App.jsx`)
- Dashboard App → Incident Details: renders details (evidence: `frontend/src/App.jsx`)
- Dashboard App → Agent Observer: renders activity (evidence: `frontend/src/App.jsx`)
- Dashboard App → Approval Popup: renders approvals (evidence: `frontend/src/App.jsx`)
- Dashboard App → ADK Chat UI: renders chat (evidence: `frontend/src/App.jsx`)
- WebSocket Manager → WebSocket Hook: broadcasts updates (evidence: `README.md`)
- ADK Chat UI → ADK Chat Service: requests chat
- ADK Chat Service → Optional ADK Agent: optional integration
- Runtime Configuration → Log Generator: sets timing (evidence: `backend/agents/log_watcher.py`)
- Runtime Configuration → Anomaly Detection: sets thresholds (evidence: `backend/services/anomaly_detection.py`)
- Runtime Configuration → Gemini LLM Service: selects provider (evidence: `backend/services/llm_service.py`)
