# rakshithay3/incident-mind architecture

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

- Interactive diagram: https://gitdiagram.com/rakshithay3/incident-mind
- Repository: https://github.com/rakshithay3/incident-mind

## Overview

IncidentMind investigates microservice incidents, ranks likely faulty services, dispatches specialist investigations, and presents an evidence-based RCA in a dashboard. Its documented workflow combines GraphSAGE anomaly scoring and PPO dispatch with Log, Metrics, Code, and Report agents; a separate recovery path waits for services to return to baseline before notifying registered users. The repository also documents priority-weighted multi-instance dispatch and a fault-injectable ShopMind testbed. Some of these latter connections are documented capabilities rather than inspected call paths; unsampled implementations are represented at their existing directory paths.

Main entry points: [`pipeline.py`](https://github.com/rakshithay3/incident-mind/blob/main/pipeline.py) (Investigation Pipeline), [`incidentmind_p1/pipeline.py`](https://github.com/rakshithay3/incident-mind/blob/main/incidentmind_p1/pipeline.py) (Inference Pipeline), [`dashboard/src/App.jsx`](https://github.com/rakshithay3/incident-mind/blob/main/dashboard/src/App.jsx) (Dashboard App), [`notifications/recovery.py`](https://github.com/rakshithay3/incident-mind/blob/main/notifications/recovery.py) (Recovery Monitor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Detection and Dispatch"]
  node_p1pipe["Inference Pipeline<br/>[pipeline.py]"]
  node_loader["Incident Loader<br/>[loader.py]"]
  node_scorer["Anomaly Scorer<br/>[scoring.py]"]
  node_gnn["GraphSAGE Scorer<br/>[gnn_scorer.py]"]
  node_ppo["PPO Dispatcher<br/>[dispatch.py]"]
  node_contracts["Incident Contracts<br/>[contracts.py]"]
  node_priority["Priority Dispatch<br/>[global_dispatch.py]"]
  node_multi["Multi-instance Queue"]
end

subgraph group_investigation["Agent Investigation"]
  node_investigation["Investigation Pipeline<br/>[pipeline.py]"]
  node_logagent["Log Agent<br/>[log_agent.py]"]
  node_metricsagent["Metrics Agent<br/>[metrics_agent.py]"]
  node_codeagent["Code Agent<br/>[code_agent.py]"]
  node_reportagent["Report Agent<br/>[report_agent.py]"]
end

subgraph group_operations["Operations and Recovery"]
  node_testbed["ShopMind Services"]
  node_faults["Fault Injection<br/>[fault-injector.js]"]
  node_recovery["Recovery Monitor<br/>[recovery.py]"]
  node_recipients["User Recipients<br/>[recipients.py]"]
  node_notifier["Email Notifier<br/>[notifier.py]"]
end

subgraph group_console["Incident Console"]
  node_app["Dashboard App<br/>[App.jsx]"]
  node_incidenthook["Incident Data Hook<br/>[useIncidentData.js]"]
  node_transform["Result Transformer"]
  node_graph["Service Graph<br/>[ServiceGraph.jsx]"]
  node_tabs["Incident Views"]
end

node_telemetry(("Incident Telemetry"))

node_telemetry -.->|"supplies incident"| node_p1pipe
node_p1pipe -->|"loads graph"| node_loader
node_p1pipe -->|"scores graph"| node_scorer
node_scorer -.->|"may use"| node_gnn
node_p1pipe -->|"chooses dispatch"| node_ppo
node_p1pipe -->|"returns output"| node_contracts
node_telemetry -.->|"submits instances"| node_priority
node_priority -->|"queues dispatch"| node_multi
node_ppo -.->|"dispatches agents"| node_investigation
node_investigation -->|"calls"| node_logagent
node_investigation -->|"calls"| node_metricsagent
node_investigation -->|"calls"| node_codeagent
node_investigation -->|"generates report"| node_reportagent
node_testbed -.->|"exports telemetry"| node_telemetry
node_faults -->|"injects faults"| node_testbed
node_recovery -.->|"checks baseline"| node_testbed
node_recovery -.->|"gets users"| node_recipients
node_recovery -.->|"requests email"| node_notifier
node_investigation -.->|"publishes RCA"| node_app
node_app -->|"loads incident"| node_incidenthook
node_incidenthook -->|"transforms result"| node_transform
node_app -->|"renders topology"| node_graph
node_app -->|"renders views"| node_tabs

click node_p1pipe "https://github.com/rakshithay3/incident-mind/blob/main/incidentmind_p1/pipeline.py"
click node_loader "https://github.com/rakshithay3/incident-mind/blob/main/incidentmind_p1/loader.py"
click node_scorer "https://github.com/rakshithay3/incident-mind/blob/main/incidentmind_p1/scoring.py"
click node_gnn "https://github.com/rakshithay3/incident-mind/blob/main/incidentmind_p1/gnn_scorer.py"
click node_ppo "https://github.com/rakshithay3/incident-mind/blob/main/incidentmind_p1/dispatch.py"
click node_contracts "https://github.com/rakshithay3/incident-mind/blob/main/incidentmind_p1/contracts.py"
click node_priority "https://github.com/rakshithay3/incident-mind/blob/main/priority/global_dispatch.py"
click node_multi "https://github.com/rakshithay3/incident-mind/blob/main/priority/cross_instance_queue.py"
click node_investigation "https://github.com/rakshithay3/incident-mind/blob/main/pipeline.py"
click node_logagent "https://github.com/rakshithay3/incident-mind/blob/main/agents/log_agent.py"
click node_metricsagent "https://github.com/rakshithay3/incident-mind/blob/main/agents/metrics_agent.py"
click node_codeagent "https://github.com/rakshithay3/incident-mind/blob/main/agents/code_agent.py"
click node_reportagent "https://github.com/rakshithay3/incident-mind/blob/main/agents/report_agent.py"
click node_testbed "https://github.com/rakshithay3/incident-mind/tree/main/services"
click node_faults "https://github.com/rakshithay3/incident-mind/blob/main/services/order-service/fault-injector.js"
click node_recovery "https://github.com/rakshithay3/incident-mind/blob/main/notifications/recovery.py"
click node_recipients "https://github.com/rakshithay3/incident-mind/blob/main/notifications/recipients.py"
click node_notifier "https://github.com/rakshithay3/incident-mind/blob/main/notifications/notifier.py"
click node_app "https://github.com/rakshithay3/incident-mind/blob/main/dashboard/src/App.jsx"
click node_incidenthook "https://github.com/rakshithay3/incident-mind/blob/main/dashboard/src/hooks/useIncidentData.js"
click node_transform "https://github.com/rakshithay3/incident-mind/blob/main/dashboard/src/data/transformDemoResult.js"
click node_graph "https://github.com/rakshithay3/incident-mind/blob/main/dashboard/src/components/ServiceGraph.jsx"
click node_tabs "https://github.com/rakshithay3/incident-mind/tree/main/dashboard/src/components/tabs"

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_p1pipe,node_loader,node_scorer,node_gnn,node_ppo,node_contracts,node_priority,node_multi toneBlue
class node_investigation,node_logagent,node_metricsagent,node_codeagent,node_reportagent toneAmber
class node_testbed,node_faults,node_recovery,node_recipients,node_notifier toneMint
class node_app,node_incidenthook,node_transform,node_graph,node_tabs toneRose
class node_telemetry toneIndigo
```

## Components

### Detection and Dispatch

- [Inference Pipeline](https://github.com/rakshithay3/incident-mind/blob/main/incidentmind_p1/pipeline.py): `incidentmind_p1/pipeline.py`
- [Incident Loader](https://github.com/rakshithay3/incident-mind/blob/main/incidentmind_p1/loader.py): `incidentmind_p1/loader.py`
- [Anomaly Scorer](https://github.com/rakshithay3/incident-mind/blob/main/incidentmind_p1/scoring.py): `incidentmind_p1/scoring.py`
- [GraphSAGE Scorer](https://github.com/rakshithay3/incident-mind/blob/main/incidentmind_p1/gnn_scorer.py): `incidentmind_p1/gnn_scorer.py`
- [PPO Dispatcher](https://github.com/rakshithay3/incident-mind/blob/main/incidentmind_p1/dispatch.py): `incidentmind_p1/dispatch.py`
- [Incident Contracts](https://github.com/rakshithay3/incident-mind/blob/main/incidentmind_p1/contracts.py): `incidentmind_p1/contracts.py`
- [Priority Dispatch](https://github.com/rakshithay3/incident-mind/blob/main/priority/global_dispatch.py): `priority/global_dispatch.py`
- [Multi-instance Queue](https://github.com/rakshithay3/incident-mind/blob/main/priority/cross_instance_queue.py): `priority/cross_instance_queue.py`

### Agent Investigation

- [Investigation Pipeline](https://github.com/rakshithay3/incident-mind/blob/main/pipeline.py): `pipeline.py`
- [Log Agent](https://github.com/rakshithay3/incident-mind/blob/main/agents/log_agent.py): `agents/log_agent.py`
- [Metrics Agent](https://github.com/rakshithay3/incident-mind/blob/main/agents/metrics_agent.py): `agents/metrics_agent.py`
- [Code Agent](https://github.com/rakshithay3/incident-mind/blob/main/agents/code_agent.py): `agents/code_agent.py`
- [Report Agent](https://github.com/rakshithay3/incident-mind/blob/main/agents/report_agent.py): `agents/report_agent.py`

### Operations and Recovery

- [ShopMind Services](https://github.com/rakshithay3/incident-mind/tree/main/services): `services`
- [Fault Injection](https://github.com/rakshithay3/incident-mind/blob/main/services/order-service/fault-injector.js): `services/order-service/fault-injector.js`
- [Recovery Monitor](https://github.com/rakshithay3/incident-mind/blob/main/notifications/recovery.py): `notifications/recovery.py`
- [User Recipients](https://github.com/rakshithay3/incident-mind/blob/main/notifications/recipients.py): `notifications/recipients.py`
- [Email Notifier](https://github.com/rakshithay3/incident-mind/blob/main/notifications/notifier.py): `notifications/notifier.py`

### Incident Console

- [Dashboard App](https://github.com/rakshithay3/incident-mind/blob/main/dashboard/src/App.jsx): `dashboard/src/App.jsx`
- [Incident Data Hook](https://github.com/rakshithay3/incident-mind/blob/main/dashboard/src/hooks/useIncidentData.js): `dashboard/src/hooks/useIncidentData.js`
- [Result Transformer](https://github.com/rakshithay3/incident-mind/blob/main/dashboard/src/data/transformDemoResult.js): `dashboard/src/data/transformDemoResult.js`
- [Service Graph](https://github.com/rakshithay3/incident-mind/blob/main/dashboard/src/components/ServiceGraph.jsx): `dashboard/src/components/ServiceGraph.jsx`
- [Incident Views](https://github.com/rakshithay3/incident-mind/tree/main/dashboard/src/components/tabs): `dashboard/src/components/tabs`

### Other components

- **Incident Telemetry**

## Connections

- Incident Telemetry → Inference Pipeline: supplies incident
- Inference Pipeline → Incident Loader: loads graph (evidence: `incidentmind_p1/pipeline.py`)
- Inference Pipeline → Anomaly Scorer: scores graph (evidence: `incidentmind_p1/pipeline.py`)
- Anomaly Scorer → GraphSAGE Scorer: may use
- Inference Pipeline → PPO Dispatcher: chooses dispatch (evidence: `incidentmind_p1/pipeline.py`)
- Inference Pipeline → Incident Contracts: returns output (evidence: `incidentmind_p1/pipeline.py`)
- Incident Telemetry → Priority Dispatch: submits instances
- Priority Dispatch → Multi-instance Queue: queues dispatch (evidence: `priority/global_dispatch.py`)
- PPO Dispatcher → Investigation Pipeline: dispatches agents
- Investigation Pipeline → Log Agent: calls (evidence: `pipeline.py`)
- Investigation Pipeline → Metrics Agent: calls (evidence: `pipeline.py`)
- Investigation Pipeline → Code Agent: calls (evidence: `pipeline.py`)
- Investigation Pipeline → Report Agent: generates report (evidence: `pipeline.py`)
- ShopMind Services → Incident Telemetry: exports telemetry
- Fault Injection → ShopMind Services: injects faults (evidence: `services/order-service/server.js`)
- Recovery Monitor → ShopMind Services: checks baseline
- Recovery Monitor → User Recipients: gets users
- Recovery Monitor → Email Notifier: requests email
- Investigation Pipeline → Dashboard App: publishes RCA
- Dashboard App → Incident Data Hook: loads incident (evidence: `dashboard/src/App.jsx`)
- Incident Data Hook → Result Transformer: transforms result (evidence: `dashboard/src/hooks/useIncidentData.js`)
- Dashboard App → Service Graph: renders topology (evidence: `dashboard/src/App.jsx`)
- Dashboard App → Incident Views: renders views (evidence: `dashboard/src/App.jsx`)
