# nithinvn/microsoft_hackathon architecture

> Architecture diagram of the GitHub repository nithinvn/microsoft_hackathon, 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/nithinvn/microsoft_hackathon
- Repository: https://github.com/nithinvn/microsoft_hackathon

## Overview

IncidentMind is a prototype incident-response application: monitoring alerts and simulated incidents enter a FastAPI backend, which can coordinate investigation, blast-radius assessment, memory retrieval, diagnosis, and bounded remediation with human approval. Results and post-incident records are presented in a React dashboard and stored in PostgreSQL; runbooks and optional Hindsight Cloud memory provide separate evidence sources. The frontend also offers a scripted demo. Relationships below follow excerpts, SOURCE INDEX references, or README documentation; unsampled implementation details and uncertain wiring are omitted.

Main entry points: [`backend/app/orchestration/incident_orchestrator.py`](https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/orchestration/incident_orchestrator.py) (Workflow Orchestrator), [`backend/app/api/v1/endpoints`](https://github.com/nithinvn/microsoft_hackathon/tree/main/backend/app/api/v1/endpoints) (FastAPI API), [`frontend/src/App.tsx`](https://github.com/nithinvn/microsoft_hackathon/blob/main/frontend/src/App.tsx) (React Dashboard), [`backend/app/simulator/engine.py`](https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/simulator/engine.py) (Incident Simulator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Intake and State"]
  node_api["FastAPI API"]
  node_intake_service["Incident Intake<br/>[incident_intake.py]"]
  node_simulator["Incident Simulator<br/>[engine.py]"]
  node_repository["Incident Repository"]
  node_postgres[("PostgreSQL State")]
end

subgraph group_workflow["Response Workflow"]
  node_orchestrator["Workflow Orchestrator"]
  node_investigation["Investigation"]
  node_blast["Blast Radius"]
  node_memory_agent["Incident Memory"]
  node_diagnosis["Diagnosis<br/>[diagnosis_agent.py]"]
  node_remediation["Remediation Options"]
  node_time_machine["Time Machine"]
  node_tools["Response Tools"]
end

subgraph group_evidence["Evidence Sources"]
  node_rag["Runbook Retrieval<br/>[rag_service.py]"]
  node_hindsight_adapter["Memory Adapter"]
  node_hindsight[("Hindsight Cloud")]
end

subgraph group_interface["Operator Interface"]
  node_dashboard["React Dashboard<br/>[App.tsx]"]
  node_api_client["API Client<br/>[client.ts]"]
  node_demo["Scripted Demo<br/>[App.tsx]"]
  node_approval["Human Approval"]
  node_postmortem["Post-incident Learning"]
end

node_responders(("Responders"))
node_monitoring(("Alert Sources"))

node_monitoring -->|"sends alerts"| node_api
node_responders -->|"uses API"| node_api
node_api -->|"normalizes alerts"| node_intake_service
node_api -->|"starts workflow"| node_orchestrator
node_api -->|"runs simulation"| node_simulator
node_intake_service -->|"records incidents"| node_repository
node_repository -->|"persists state"| node_postgres
node_simulator -->|"uses intake path"| node_intake_service
node_simulator -->|"writes records"| node_repository
node_orchestrator -->|"runs investigation"| node_investigation
node_orchestrator -->|"assesses impact"| node_blast
node_orchestrator -->|"assesses memory"| node_memory_agent
node_orchestrator -->|"diagnoses cause"| node_diagnosis
node_orchestrator -->|"proposes actions"| node_remediation
node_orchestrator -->|"uses tools"| node_tools
node_investigation -.->|"retrieves runbooks"| node_rag
node_diagnosis -.->|"uses guidance"| node_rag
node_memory_agent -->|"requests evidence"| node_hindsight_adapter
node_hindsight_adapter -->|"recalls and retains"| node_hindsight
node_orchestrator -->|"retains lessons"| node_hindsight_adapter
node_orchestrator -.->|"compares actions"| node_time_machine
node_dashboard -->|"fetches health"| node_api_client
node_api_client -.->|"calls backend"| node_api
node_responders -->|"views results"| node_dashboard
node_dashboard -->|"launches demo"| node_demo
node_dashboard -.->|"presents approval"| node_approval
node_dashboard -->|"shows learning"| node_postmortem

click node_api "https://github.com/nithinvn/microsoft_hackathon/tree/main/backend/app/api/v1/endpoints"
click node_intake_service "https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/services/incident_intake.py"
click node_simulator "https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/simulator/engine.py"
click node_repository "https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/repositories/incident_repository.py"
click node_orchestrator "https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/orchestration/incident_orchestrator.py"
click node_investigation "https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/agents/investigation_agent.py"
click node_blast "https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/agents/blast_radius_agent.py"
click node_memory_agent "https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/agents/incident_memory_agent.py"
click node_diagnosis "https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/agents/diagnosis_agent.py"
click node_remediation "https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/agents/remediation_agent.py"
click node_time_machine "https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/agents/time_machine_agent.py"
click node_tools "https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/tools/incident_response_tools.py"
click node_rag "https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/knowledge/rag_service.py"
click node_hindsight_adapter "https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/memory/hindsight_service.py"
click node_dashboard "https://github.com/nithinvn/microsoft_hackathon/blob/main/frontend/src/App.tsx"
click node_api_client "https://github.com/nithinvn/microsoft_hackathon/blob/main/frontend/src/api/client.ts"
click node_demo "https://github.com/nithinvn/microsoft_hackathon/blob/main/frontend/src/App.tsx"
click node_approval "https://github.com/nithinvn/microsoft_hackathon/blob/main/frontend/src/components/HumanApprovalModal.tsx"
click node_postmortem "https://github.com/nithinvn/microsoft_hackathon/blob/main/frontend/src/components/PostmortemLearningLoop.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_intake_service,node_simulator,node_repository,node_postgres toneBlue
class node_orchestrator,node_investigation,node_blast,node_memory_agent,node_diagnosis,node_remediation,node_time_machine,node_tools toneAmber
class node_rag,node_hindsight_adapter,node_hindsight toneMint
class node_dashboard,node_api_client,node_demo,node_approval,node_postmortem toneRose
class node_responders,node_monitoring toneIndigo
```

## Components

### Intake and State

- [FastAPI API](https://github.com/nithinvn/microsoft_hackathon/tree/main/backend/app/api/v1/endpoints): `backend/app/api/v1/endpoints`
- [Incident Intake](https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/services/incident_intake.py): `backend/app/services/incident_intake.py`
- [Incident Simulator](https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/simulator/engine.py): `backend/app/simulator/engine.py`
- [Incident Repository](https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/repositories/incident_repository.py): `backend/app/repositories/incident_repository.py`
- **PostgreSQL State**

### Response Workflow

- [Workflow Orchestrator](https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/orchestration/incident_orchestrator.py): `backend/app/orchestration/incident_orchestrator.py`
- [Investigation](https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/agents/investigation_agent.py): `backend/app/agents/investigation_agent.py`
- [Blast Radius](https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/agents/blast_radius_agent.py): `backend/app/agents/blast_radius_agent.py`
- [Incident Memory](https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/agents/incident_memory_agent.py): `backend/app/agents/incident_memory_agent.py`
- [Diagnosis](https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/agents/diagnosis_agent.py): `backend/app/agents/diagnosis_agent.py`
- [Remediation Options](https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/agents/remediation_agent.py): `backend/app/agents/remediation_agent.py`
- [Time Machine](https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/agents/time_machine_agent.py): `backend/app/agents/time_machine_agent.py`
- [Response Tools](https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/tools/incident_response_tools.py): `backend/app/tools/incident_response_tools.py`

### Evidence Sources

- [Runbook Retrieval](https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/knowledge/rag_service.py): `backend/app/knowledge/rag_service.py`
- [Memory Adapter](https://github.com/nithinvn/microsoft_hackathon/blob/main/backend/app/memory/hindsight_service.py): `backend/app/memory/hindsight_service.py`
- **Hindsight Cloud**

### Operator Interface

- [React Dashboard](https://github.com/nithinvn/microsoft_hackathon/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API Client](https://github.com/nithinvn/microsoft_hackathon/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Scripted Demo](https://github.com/nithinvn/microsoft_hackathon/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Human Approval](https://github.com/nithinvn/microsoft_hackathon/blob/main/frontend/src/components/HumanApprovalModal.tsx): `frontend/src/components/HumanApprovalModal.tsx`
- [Post-incident Learning](https://github.com/nithinvn/microsoft_hackathon/blob/main/frontend/src/components/PostmortemLearningLoop.tsx): `frontend/src/components/PostmortemLearningLoop.tsx`

### Other components

- **Responders**
- **Alert Sources**

## Connections

- Alert Sources → FastAPI API: sends alerts
- Responders → FastAPI API: uses API
- FastAPI API → Incident Intake: normalizes alerts (evidence: `backend/app/api/v1/endpoints/webhooks.py`)
- FastAPI API → Workflow Orchestrator: starts workflow (evidence: `backend/app/api/v1/endpoints/incidents.py`)
- FastAPI API → Incident Simulator: runs simulation (evidence: `backend/app/api/v1/endpoints/simulator.py`)
- Incident Intake → Incident Repository: records incidents (evidence: `backend/app/services/incident_intake.py`)
- Incident Repository → PostgreSQL State: persists state
- Incident Simulator → Incident Intake: uses intake path (evidence: `backend/app/simulator/engine.py`)
- Incident Simulator → Incident Repository: writes records (evidence: `backend/app/simulator/engine.py`)
- Workflow Orchestrator → Investigation: runs investigation (evidence: `backend/app/orchestration/incident_orchestrator.py`)
- Workflow Orchestrator → Blast Radius: assesses impact (evidence: `backend/app/orchestration/incident_orchestrator.py`)
- Workflow Orchestrator → Incident Memory: assesses memory (evidence: `backend/app/orchestration/incident_orchestrator.py`)
- Workflow Orchestrator → Diagnosis: diagnoses cause (evidence: `backend/app/orchestration/incident_orchestrator.py`)
- Workflow Orchestrator → Remediation Options: proposes actions (evidence: `backend/app/orchestration/incident_orchestrator.py`)
- Workflow Orchestrator → Response Tools: uses tools (evidence: `backend/app/orchestration/incident_orchestrator.py`)
- Investigation → Runbook Retrieval: retrieves runbooks
- Diagnosis → Runbook Retrieval: uses guidance
- Incident Memory → Memory Adapter: requests evidence (evidence: `backend/app/agents/incident_memory_agent.py`)
- Memory Adapter → Hindsight Cloud: recalls and retains
- Workflow Orchestrator → Memory Adapter: retains lessons (evidence: `backend/app/orchestration/incident_orchestrator.py`)
- Workflow Orchestrator → Time Machine: compares actions
- React Dashboard → API Client: fetches health (evidence: `frontend/src/App.tsx`)
- API Client → FastAPI API: calls backend
- Responders → React Dashboard: views results
- React Dashboard → Scripted Demo: launches demo (evidence: `frontend/src/App.tsx`)
- React Dashboard → Human Approval: presents approval
- React Dashboard → Post-incident Learning: shows learning (evidence: `frontend/src/components/PostmortemLearningLoop.tsx`)
