# dhanishetty/incident-triage-agents architecture

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

- Interactive diagram: https://gitdiagram.com/dhanishetty/incident-triage-agents
- Repository: https://github.com/dhanishetty/incident-triage-agents

## Overview

This repository is an early incident-triage product: a browser architecture page can replay a scripted incident or start a live backend run, while the backend executes a LangGraph workflow in demo mode. The workflow gathers logs, metrics, and change evidence, diagnoses a cause, proposes remediation, pauses for human approval, and files a postmortem. The graph includes the user-facing replay/live branches and the backend’s orchestration, dependency, connector, and event layers. Azure services and a real LLM are documented as planned; live integrations are not implemented yet.

Main entry points: [`backend/src/triage/api.py`](https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/api.py) (Run API), [`frontend/src/features/architecture/useLiveRun.ts`](https://github.com/dhanishetty/incident-triage-agents/blob/main/frontend/src/features/architecture/useLiveRun.ts) (Live run client), [`backend/src/triage/agents.py`](https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/agents.py) (Triage and evidence agents), [`backend/src/triage/deps.py`](https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/deps.py) (Dependency wiring)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_backend["Triage backend"]
  node_api["Run API<br/>[api.py]"]
  node_runs["Run manager<br/>[runs.py]"]
  node_events["Event stream<br/>[events.py]"]
  node_models["Run data models<br/>[models.py]"]
end

subgraph group_workflow["Incident workflow"]
  node_graph["Agent graph<br/>[graph.py]"]
  node_agents["Triage and evidence agents<br/>[agents.py]"]
  node_diagnosis["Diagnosis and evidence loop<br/>[agents.py]"]
  node_remediation["Remediation proposal<br/>[agents.py]"]
  node_approval["Approval gate<br/>[agents.py]"]
  node_executor["Action executor<br/>[agents.py]"]
  node_postmortem["Postmortem filing<br/>[agents.py]"]
end

subgraph group_integrations["Demo integrations"]
  node_deps["Dependency wiring<br/>[deps.py]"]
  node_connectors["Connector interfaces<br/>[base.py]"]
  node_demo["Demo connectors<br/>[demo.py]"]
  node_reasoner["Scripted reasoner<br/>[fake.py]"]
end

subgraph group_frontend["Run experience"]
  node_controls["Run controls<br/>[RunControls.tsx]"]
  node_live["Live run client<br/>[useLiveRun.ts]"]
  node_replay["Simulated replay<br/>[useRun.ts]"]
  node_runapi["Run interface<br/>[runApi.ts]"]
  node_diagram["Interactive flow diagram<br/>[FlowDiagram.tsx]"]
end

subgraph group_frontenddata["Replay and diagrams"]
  node_scenario["Replay scenarios<br/>[scenarios.ts]"]
  node_diagramdata["Architecture diagram data<br/>[diagrams.ts]"]
end

node_monitor(("Azure Monitor alert"))
node_engineer(("On-call engineer"))
node_workitems["Azure Boards work item"]

node_monitor -->|"starts run"| node_api
node_controls -->|"starts live run"| node_live
node_controls -->|"plays replay"| node_replay
node_controls -->|"uses interface"| node_runapi
node_live -->|"posts run"| node_api
node_live -->|"requests approval"| node_api
node_live -->|"receives SSE"| node_events
node_replay -->|"replays steps"| node_scenario
node_live -->|"selects scenario"| node_scenario
node_live -->|"implements interface"| node_runapi
node_replay -->|"implements interface"| node_runapi
node_runapi -->|"supplies run view"| node_diagram
node_diagramdata -->|"defines rendering data"| node_diagram
node_engineer -->|"chooses mode"| node_controls
node_engineer -->|"approves or rejects"| node_api
node_api -->|"starts and decides"| node_runs
node_api -->|"builds workflow"| node_graph
node_api -->|"streams events"| node_events
node_runs -->|"stores run events"| node_events
node_graph -->|"dispatches nodes"| node_agents
node_agents -->|"uses dependencies"| node_deps
node_agents -->|"emits progress"| node_events
node_agents -->|"gathers evidence"| node_diagnosis
node_diagnosis -->|"provides cause"| node_remediation
node_remediation -->|"requests approval"| node_approval
node_approval -->|"pauses for decision"| node_engineer
node_approval -->|"runs if approved"| node_executor
node_executor -->|"reports outcome"| node_postmortem
node_approval -->|"continues if rejected"| node_postmortem
node_postmortem -->|"files report"| node_workitems
node_deps -->|"configures interfaces"| node_connectors
node_deps -->|"selects demo adapters"| node_demo
node_deps -->|"selects scripted reasoner"| node_reasoner
node_demo -->|"loads incident facts"| node_scenario
node_agents -->|"reads and writes state"| node_models
node_api -->|"validates requests"| node_models

click node_api "https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/api.py"
click node_runs "https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/runs.py"
click node_events "https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/events.py"
click node_models "https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/models.py"
click node_graph "https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/graph.py"
click node_agents "https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/agents.py"
click node_diagnosis "https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/agents.py"
click node_remediation "https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/agents.py"
click node_approval "https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/agents.py"
click node_executor "https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/agents.py"
click node_postmortem "https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/agents.py"
click node_deps "https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/deps.py"
click node_connectors "https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/connectors/base.py"
click node_demo "https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/connectors/demo.py"
click node_reasoner "https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/llm/fake.py"
click node_controls "https://github.com/dhanishetty/incident-triage-agents/blob/main/frontend/src/features/architecture/RunControls.tsx"
click node_live "https://github.com/dhanishetty/incident-triage-agents/blob/main/frontend/src/features/architecture/useLiveRun.ts"
click node_replay "https://github.com/dhanishetty/incident-triage-agents/blob/main/frontend/src/features/architecture/useRun.ts"
click node_scenario "https://github.com/dhanishetty/incident-triage-agents/blob/main/frontend/src/features/architecture/scenarios.ts"
click node_runapi "https://github.com/dhanishetty/incident-triage-agents/blob/main/frontend/src/features/architecture/runApi.ts"
click node_diagramdata "https://github.com/dhanishetty/incident-triage-agents/blob/main/frontend/src/features/architecture/diagrams.ts"
click node_diagram "https://github.com/dhanishetty/incident-triage-agents/blob/main/frontend/src/features/architecture/FlowDiagram.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_api,node_runs,node_events,node_models toneBlue
class node_graph,node_agents,node_diagnosis,node_remediation,node_approval,node_executor,node_postmortem toneAmber
class node_deps,node_connectors,node_demo,node_reasoner toneMint
class node_controls,node_live,node_replay,node_runapi,node_diagram toneRose
class node_scenario,node_diagramdata,node_monitor,node_engineer,node_workitems toneIndigo
```

## Components

### Triage backend

- [Run API](https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/api.py): `backend/src/triage/api.py`
- [Run manager](https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/runs.py): `backend/src/triage/runs.py`
- [Event stream](https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/events.py): `backend/src/triage/events.py`
- [Run data models](https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/models.py): `backend/src/triage/models.py`

### Incident workflow

- [Agent graph](https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/graph.py): `backend/src/triage/graph.py`
- [Triage and evidence agents](https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/agents.py): `backend/src/triage/agents.py`
- [Diagnosis and evidence loop](https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/agents.py): `backend/src/triage/agents.py`
- [Remediation proposal](https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/agents.py): `backend/src/triage/agents.py`
- [Approval gate](https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/agents.py): `backend/src/triage/agents.py`
- [Action executor](https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/agents.py): `backend/src/triage/agents.py`
- [Postmortem filing](https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/agents.py): `backend/src/triage/agents.py`

### Demo integrations

- [Dependency wiring](https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/deps.py): `backend/src/triage/deps.py`
- [Connector interfaces](https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/connectors/base.py): `backend/src/triage/connectors/base.py`
- [Demo connectors](https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/connectors/demo.py): `backend/src/triage/connectors/demo.py`
- [Scripted reasoner](https://github.com/dhanishetty/incident-triage-agents/blob/main/backend/src/triage/llm/fake.py): `backend/src/triage/llm/fake.py`

### Run experience

- [Run controls](https://github.com/dhanishetty/incident-triage-agents/blob/main/frontend/src/features/architecture/RunControls.tsx): `frontend/src/features/architecture/RunControls.tsx`
- [Live run client](https://github.com/dhanishetty/incident-triage-agents/blob/main/frontend/src/features/architecture/useLiveRun.ts): `frontend/src/features/architecture/useLiveRun.ts`
- [Simulated replay](https://github.com/dhanishetty/incident-triage-agents/blob/main/frontend/src/features/architecture/useRun.ts): `frontend/src/features/architecture/useRun.ts`
- [Run interface](https://github.com/dhanishetty/incident-triage-agents/blob/main/frontend/src/features/architecture/runApi.ts): `frontend/src/features/architecture/runApi.ts`
- [Interactive flow diagram](https://github.com/dhanishetty/incident-triage-agents/blob/main/frontend/src/features/architecture/FlowDiagram.tsx): `frontend/src/features/architecture/FlowDiagram.tsx`

### Replay and diagrams

- [Replay scenarios](https://github.com/dhanishetty/incident-triage-agents/blob/main/frontend/src/features/architecture/scenarios.ts): `frontend/src/features/architecture/scenarios.ts`
- [Architecture diagram data](https://github.com/dhanishetty/incident-triage-agents/blob/main/frontend/src/features/architecture/diagrams.ts): `frontend/src/features/architecture/diagrams.ts`

### Other components

- **Azure Monitor alert**
- **On-call engineer**
- **Azure Boards work item**

## Connections

- Azure Monitor alert → Run API: starts run (evidence: `README.md`)
- Run controls → Live run client: starts live run (evidence: `frontend/src/features/architecture/ArchitecturePage.tsx`)
- Run controls → Simulated replay: plays replay (evidence: `frontend/src/features/architecture/ArchitecturePage.tsx`)
- Run controls → Run interface: uses interface (evidence: `frontend/src/features/architecture/RunControls.tsx`)
- Live run client → Run API: posts run (evidence: `frontend/src/features/architecture/useLiveRun.ts`)
- Live run client → Run API: requests approval (evidence: `frontend/src/features/architecture/useLiveRun.ts`)
- Live run client → Event stream: receives SSE (evidence: `README.md`)
- Simulated replay → Replay scenarios: replays steps (evidence: `frontend/src/features/architecture/useRun.ts`)
- Live run client → Replay scenarios: selects scenario (evidence: `frontend/src/features/architecture/useLiveRun.ts`)
- Live run client → Run interface: implements interface (evidence: `frontend/src/features/architecture/useLiveRun.ts`)
- Simulated replay → Run interface: implements interface (evidence: `frontend/src/features/architecture/useRun.ts`)
- Run interface → Interactive flow diagram: supplies run view (evidence: `frontend/src/features/architecture/runApi.ts`)
- Architecture diagram data → Interactive flow diagram: defines rendering data (evidence: `frontend/src/features/architecture/diagrams.ts`)
- On-call engineer → Run controls: chooses mode (evidence: `README.md`)
- On-call engineer → Run API: approves or rejects (evidence: `README.md`)
- Run API → Run manager: starts and decides (evidence: `backend/src/triage/api.py`)
- Run API → Agent graph: builds workflow (evidence: `backend/src/triage/api.py`)
- Run API → Event stream: streams events (evidence: `backend/src/triage/api.py`)
- Run manager → Event stream: stores run events (evidence: `backend/src/triage/runs.py`)
- Agent graph → Triage and evidence agents: dispatches nodes (evidence: `backend/src/triage/graph.py`)
- Triage and evidence agents → Dependency wiring: uses dependencies (evidence: `backend/src/triage/agents.py`)
- Triage and evidence agents → Event stream: emits progress (evidence: `backend/src/triage/agents.py`)
- Triage and evidence agents → Diagnosis and evidence loop: gathers evidence (evidence: `backend/src/triage/agents.py`)
- Diagnosis and evidence loop → Remediation proposal: provides cause (evidence: `README.md`)
- Remediation proposal → Approval gate: requests approval (evidence: `backend/src/triage/agents.py`)
- Approval gate → On-call engineer: pauses for decision (evidence: `README.md`)
- Approval gate → Action executor: runs if approved (evidence: `README.md`)
- Action executor → Postmortem filing: reports outcome (evidence: `backend/src/triage/agents.py`)
- Approval gate → Postmortem filing: continues if rejected (evidence: `backend/src/triage/agents.py`)
- Postmortem filing → Azure Boards work item: files report (evidence: `backend/src/triage/agents.py`)
- Dependency wiring → Connector interfaces: configures interfaces (evidence: `backend/src/triage/deps.py`)
- Dependency wiring → Demo connectors: selects demo adapters (evidence: `backend/src/triage/deps.py`)
- Dependency wiring → Scripted reasoner: selects scripted reasoner (evidence: `backend/src/triage/deps.py`)
- Demo connectors → Replay scenarios: loads incident facts (evidence: `backend/src/triage/connectors/demo.py`)
- Triage and evidence agents → Run data models: reads and writes state (evidence: `backend/src/triage/agents.py`)
- Run API → Run data models: validates requests (evidence: `backend/src/triage/api.py`)
