# joshkumar50/hindsight-incident-agent architecture

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

- Interactive diagram: https://gitdiagram.com/joshkumar50/hindsight-incident-agent
- Repository: https://github.com/joshkumar50/hindsight-incident-agent

## Overview

Hindsight Incident Agent is an autonomous Kubernetes SRE platform: it observes incidents, analyzes causes, consults persistent incident memory, plans remediation, and executes or rolls back recovery. Its React dashboard exposes incident, analysis, observability, chaos, audit, and memory capabilities through a BFF. The README describes Redis Streams as the service decoupling layer; sampled code confirms the orchestrator’s RCA-to-planning calls and recovery execution’s policy and Kubernetes calls. Many specialized services are represented from the tree and README, but their internal wiring was not sampled, so those links are omitted or marked unverified.

Main entry points: [`pkg/eventbus/client.py`](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/pkg/eventbus/client.py) (Redis Streams event bus), [`platform/ai-orchestrator/main.py`](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/ai-orchestrator/main.py) (AI workflow orchestrator), [`platform/execution-engine/main.py`](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/execution-engine/main.py) (Recovery execution), [`ui/src/App.tsx`](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/ui/src/App.tsx) (React dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Dashboard Experience"]
  node_ui["React dashboard<br/>[App.tsx]"]
  node_incident_views["Incident and analysis views<br/>[IncidentCenter.tsx]"]
  node_chaos_view["Chaos console"]
  node_api_client["UI API client<br/>[client.ts]"]
  node_bff["Dashboard BFF<br/>[main.py]"]
end

subgraph group_incident["Incident Intelligence"]
  node_incident_engine["Incident management<br/>[main.py]"]
  node_orchestrator["AI workflow orchestrator<br/>[main.py]"]
  node_rca["Root-cause analysis<br/>[main.py]"]
  node_knowledge["Incident memory<br/>[main.py]"]
  node_decision["Decision engine<br/>[main.py]"]
  node_copilot["AI copilot<br/>[main.py]"]
end

subgraph group_recovery["Recovery Control"]
  node_planner["Recovery planner<br/>[main.py]"]
  node_execution["Recovery execution<br/>[main.py]"]
  node_policy["Policy authorization<br/>[main.py]"]
  node_kube_controller["Kubernetes controller<br/>[main.py]"]
  node_verification["Recovery verification<br/>[main.py]"]
  node_rollback["Rollback engine<br/>[main.py]"]
end

subgraph group_operations["Operations and Chaos"]
  node_chaos_controller["Chaos controller<br/>[main.py]"]
  node_scenario_manager["Chaos scenarios<br/>[main.py]"]
  node_chaos_engine["Chaos engine<br/>[main.py]"]
  node_fault_injection["Fault injection<br/>[main.py]"]
  node_monitoring["Monitoring engine<br/>[main.py]"]
  node_telemetry_collector["Telemetry collector<br/>[main.py]"]
  node_audit["Audit engine<br/>[main.py]"]
end

subgraph group_foundation["Shared Runtime"]
  node_eventbus["Redis Streams event bus<br/>[client.py]"]
  node_core["Shared service foundations"]
  node_anomaly_math["Anomaly math<br/>[anomaly.py]"]
end

node_operator(("SRE operator"))
node_hindsight[("Hindsight memory service")]
node_prometheus[("Prometheus")]
node_target_apps["Target microservices"]

node_operator -->|"uses"| node_ui
node_ui -.->|"renders"| node_incident_views
node_ui -.->|"renders"| node_chaos_view
node_incident_views -.->|"requests data"| node_api_client
node_chaos_view -->|"requests data"| node_api_client
node_api_client -->|"calls API"| node_bff
node_bff -->|"requests explanations"| node_copilot
node_bff -->|"reads incidents"| node_incident_engine
node_eventbus -.->|"delivers events"| node_orchestrator
node_orchestrator -->|"requests analysis"| node_rca
node_orchestrator -->|"searches history"| node_knowledge
node_orchestrator -->|"evaluates decision"| node_decision
node_orchestrator -->|"requests plan"| node_planner
node_orchestrator -->|"recalls and retains"| node_hindsight
node_knowledge -->|"searches and stores"| node_hindsight
node_orchestrator -.->|"publishes decisions"| node_eventbus
node_eventbus -.->|"delivers recovery plans"| node_execution
node_execution -->|"checks authorization"| node_policy
node_execution -->|"requests changes"| node_kube_controller
node_execution -->|"publishes recovery status"| node_eventbus
node_eventbus -->|"delivers failures"| node_rollback
node_rollback -->|"requests undo"| node_kube_controller
node_rollback -->|"publishes rollback status"| node_eventbus
node_eventbus -->|"delivers recovery events"| node_chaos_controller
node_chaos_controller -->|"publishes chaos events"| node_eventbus
node_eventbus -->|"delivers telemetry events"| node_monitoring
node_monitoring -->|"queries metrics"| node_prometheus
node_telemetry_collector -.->|"publishes telemetry"| node_eventbus
node_scenario_manager -.->|"configures experiments"| node_chaos_controller
node_chaos_engine -.->|"injects chaos"| node_target_apps
node_fault_injection -.->|"injects faults"| node_target_apps
node_audit -.->|"records events"| node_eventbus
node_core -.->|"supports services"| node_eventbus
node_monitoring -.->|"uses calculations"| node_anomaly_math

click node_ui "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/ui/src/App.tsx"
click node_incident_views "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/ui/src/pages/IncidentCenter.tsx"
click node_chaos_view "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/ui/src/pages/ChaosEngineering.tsx"
click node_api_client "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/ui/src/api/client.ts"
click node_bff "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/dashboard-bff/main.py"
click node_incident_engine "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/incident-engine/main.py"
click node_orchestrator "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/ai-orchestrator/main.py"
click node_rca "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/root-cause-analysis-engine/main.py"
click node_knowledge "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/knowledge-engine/main.py"
click node_decision "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/decision-engine/main.py"
click node_copilot "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/ai-copilot/main.py"
click node_planner "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/recovery-planning-engine/main.py"
click node_execution "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/execution-engine/main.py"
click node_policy "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/policy-engine/main.py"
click node_kube_controller "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/kubernetes-controller/main.py"
click node_verification "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/recovery-verification-engine/main.py"
click node_rollback "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/rollback-engine/main.py"
click node_chaos_controller "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/chaos-controller/main.py"
click node_scenario_manager "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/chaos-scenario-manager/main.py"
click node_chaos_engine "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/chaos-engine/main.py"
click node_fault_injection "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/fault-injection-engine/main.py"
click node_monitoring "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/monitoring-engine/main.py"
click node_telemetry_collector "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/telemetry-collector/main.py"
click node_audit "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/audit-engine/main.py"
click node_eventbus "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/pkg/eventbus/client.py"
click node_core "https://github.com/joshkumar50/hindsight-incident-agent/tree/main/pkg/core"
click node_anomaly_math "https://github.com/joshkumar50/hindsight-incident-agent/blob/main/pkg/math_engine/anomaly.py"
click node_target_apps "https://github.com/joshkumar50/hindsight-incident-agent/tree/main/apps"

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_ui,node_incident_views,node_chaos_view,node_api_client,node_bff toneBlue
class node_incident_engine,node_orchestrator,node_rca,node_knowledge,node_decision,node_copilot,node_hindsight,node_prometheus toneAmber
class node_planner,node_execution,node_policy,node_kube_controller,node_verification,node_rollback toneMint
class node_chaos_controller,node_scenario_manager,node_chaos_engine,node_fault_injection,node_monitoring,node_telemetry_collector,node_audit toneRose
class node_eventbus,node_core,node_anomaly_math,node_operator toneIndigo
class node_target_apps toneTeal
```

## Components

### Dashboard Experience

- [React dashboard](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/ui/src/App.tsx): `ui/src/App.tsx`
- [Incident and analysis views](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/ui/src/pages/IncidentCenter.tsx): `ui/src/pages/IncidentCenter.tsx`
- [Chaos console](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/ui/src/pages/ChaosEngineering.tsx): `ui/src/pages/ChaosEngineering.tsx`
- [UI API client](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/ui/src/api/client.ts): `ui/src/api/client.ts`
- [Dashboard BFF](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/dashboard-bff/main.py): `platform/dashboard-bff/main.py`

### Incident Intelligence

- [Incident management](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/incident-engine/main.py): `platform/incident-engine/main.py`
- [AI workflow orchestrator](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/ai-orchestrator/main.py): `platform/ai-orchestrator/main.py`
- [Root-cause analysis](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/root-cause-analysis-engine/main.py): `platform/root-cause-analysis-engine/main.py`
- [Incident memory](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/knowledge-engine/main.py): `platform/knowledge-engine/main.py`
- [Decision engine](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/decision-engine/main.py): `platform/decision-engine/main.py`
- [AI copilot](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/ai-copilot/main.py): `platform/ai-copilot/main.py`

### Recovery Control

- [Recovery planner](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/recovery-planning-engine/main.py): `platform/recovery-planning-engine/main.py`
- [Recovery execution](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/execution-engine/main.py): `platform/execution-engine/main.py`
- [Policy authorization](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/policy-engine/main.py): `platform/policy-engine/main.py`
- [Kubernetes controller](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/kubernetes-controller/main.py): `platform/kubernetes-controller/main.py`
- [Recovery verification](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/recovery-verification-engine/main.py): `platform/recovery-verification-engine/main.py`
- [Rollback engine](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/rollback-engine/main.py): `platform/rollback-engine/main.py`

### Operations and Chaos

- [Chaos controller](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/chaos-controller/main.py): `platform/chaos-controller/main.py`
- [Chaos scenarios](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/chaos-scenario-manager/main.py): `platform/chaos-scenario-manager/main.py`
- [Chaos engine](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/chaos-engine/main.py): `platform/chaos-engine/main.py`
- [Fault injection](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/fault-injection-engine/main.py): `platform/fault-injection-engine/main.py`
- [Monitoring engine](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/monitoring-engine/main.py): `platform/monitoring-engine/main.py`
- [Telemetry collector](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/telemetry-collector/main.py): `platform/telemetry-collector/main.py`
- [Audit engine](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/platform/audit-engine/main.py): `platform/audit-engine/main.py`

### Shared Runtime

- [Redis Streams event bus](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/pkg/eventbus/client.py): `pkg/eventbus/client.py`
- [Shared service foundations](https://github.com/joshkumar50/hindsight-incident-agent/tree/main/pkg/core): `pkg/core`
- [Anomaly math](https://github.com/joshkumar50/hindsight-incident-agent/blob/main/pkg/math_engine/anomaly.py): `pkg/math_engine/anomaly.py`

### Other components

- **SRE operator**
- **Hindsight memory service**
- **Prometheus**
- [Target microservices](https://github.com/joshkumar50/hindsight-incident-agent/tree/main/apps): `apps`

## Connections

- SRE operator → React dashboard: uses (evidence: `README.md`)
- React dashboard → Incident and analysis views: renders
- React dashboard → Chaos console: renders
- Incident and analysis views → UI API client: requests data
- Chaos console → UI API client: requests data (evidence: `ui/src/pages/ChaosEngineering.tsx`)
- UI API client → Dashboard BFF: calls API (evidence: `README.md`)
- Dashboard BFF → AI copilot: requests explanations (evidence: `README.md`)
- Dashboard BFF → Incident management: reads incidents (evidence: `README.md`)
- Redis Streams event bus → AI workflow orchestrator: delivers events (evidence: `README.md`)
- AI workflow orchestrator → Root-cause analysis: requests analysis (evidence: `platform/ai-orchestrator/main.py`)
- AI workflow orchestrator → Incident memory: searches history (evidence: `platform/ai-orchestrator/main.py`)
- AI workflow orchestrator → Decision engine: evaluates decision (evidence: `platform/ai-orchestrator/main.py`)
- AI workflow orchestrator → Recovery planner: requests plan (evidence: `platform/ai-orchestrator/main.py`)
- AI workflow orchestrator → Hindsight memory service: recalls and retains (evidence: `platform/ai-orchestrator/main.py`)
- Incident memory → Hindsight memory service: searches and stores (evidence: `platform/knowledge-engine/main.py`)
- AI workflow orchestrator → Redis Streams event bus: publishes decisions (evidence: `platform/ai-orchestrator/main.py`)
- Redis Streams event bus → Recovery execution: delivers recovery plans (evidence: `platform/execution-engine/main.py`)
- Recovery execution → Policy authorization: checks authorization (evidence: `platform/execution-engine/main.py`)
- Recovery execution → Kubernetes controller: requests changes (evidence: `platform/execution-engine/main.py`)
- Recovery execution → Redis Streams event bus: publishes recovery status (evidence: `platform/execution-engine/main.py`)
- Redis Streams event bus → Rollback engine: delivers failures (evidence: `platform/rollback-engine/main.py`)
- Rollback engine → Kubernetes controller: requests undo (evidence: `platform/rollback-engine/main.py`)
- Rollback engine → Redis Streams event bus: publishes rollback status (evidence: `platform/rollback-engine/main.py`)
- Redis Streams event bus → Chaos controller: delivers recovery events (evidence: `platform/chaos-controller/main.py`)
- Chaos controller → Redis Streams event bus: publishes chaos events (evidence: `platform/chaos-controller/main.py`)
- Redis Streams event bus → Monitoring engine: delivers telemetry events (evidence: `platform/monitoring-engine/main.py`)
- Monitoring engine → Prometheus: queries metrics (evidence: `platform/monitoring-engine/main.py`)
- Telemetry collector → Redis Streams event bus: publishes telemetry (evidence: `platform/telemetry-collector/main.py`)
- Chaos scenarios → Chaos controller: configures experiments
- Chaos engine → Target microservices: injects chaos
- Fault injection → Target microservices: injects faults
- Audit engine → Redis Streams event bus: records events (evidence: `platform/audit-engine/main.py`)
- Shared service foundations → Redis Streams event bus: supports services (evidence: `pkg/eventbus/client.py`)
- Monitoring engine → Anomaly math: uses calculations
