# ch-dhanush-29/incentmindai architecture

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

- Interactive diagram: https://gitdiagram.com/ch-dhanush-29/incentmindai
- Repository: https://github.com/ch-dhanush-29/incentmindai

## Overview

IncidentMind AI is an SRE incident-response copilot: engineers declare and investigate incidents, compare memory-grounded and baseline diagnosis, then verify resolutions so postmortem knowledge can be retained. The README documents dashboard, incident history, analytics, memory exploration, and postmortem capabilities; sampled code confirms investigation, persistence, retention, Slack dispatch, and event broadcasts. Some UI-to-API and unsampled route wiring is not shown, so those relationships are omitted or limited to the documented architecture.

Main entry points: [`frontend/src/App.tsx`](https://github.com/ch-dhanush-29/incentmindai/blob/main/frontend/src/App.tsx) (Console app), [`backend/app/services/incident_service.py`](https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/services/incident_service.py) (Incident orchestrator), [`backend/app/repositories/incident_repo.py`](https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/repositories/incident_repo.py) (Incident repository), [`backend/app/main.py`](https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/main.py) (FastAPI server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Responder experience"]
  node_app["Console app<br/>[App.tsx]"]
  node_dashboard["SRE dashboard<br/>[Dashboard.tsx]"]
  node_incidents_ui["Incident workspace<br/>[IncidentList.tsx]"]
  node_investigation_ui["Investigation studio"]
  node_memory_ui["Memory explorer<br/>[MemoryExplorer.tsx]"]
  node_analytics_ui["Analytics reports<br/>[AnalyticsPage.tsx]"]
  node_postmortem_ui["Postmortem review<br/>[Postmortem.tsx]"]
end

subgraph group_api["API and workflows"]
  node_api_server["FastAPI server<br/>[main.py]"]
  node_incident_api["Incident endpoints<br/>[incidents.py]"]
  node_memory_api["Memory endpoints<br/>[memory.py]"]
  node_analytics_api["Analytics endpoints<br/>[analytics.py]"]
  node_slack_webhooks["Slack webhooks<br/>[webhooks.py]"]
  node_incident_service["Incident orchestrator"]
  node_incident_model["Incident records<br/>[incident.py]"]
end

subgraph group_intelligence["Diagnosis and memory"]
  node_memory_adapter["Hindsight adapter"]
  node_retrieval["TEMPR retrieval"]
  node_llm_adapter["Groq inference<br/>[groq_adapter.py]"]
end

subgraph group_integrations["State and integrations"]
  node_repository["Incident repository<br/>[incident_repo.py]"]
  node_mongo[("MongoDB store")]
  node_event_hub["Realtime events<br/>[events.py]"]
  node_slack_service["Slack dispatcher<br/>[slack_service.py]"]
end

node_engineer(("SRE engineer"))
node_hindsight[("Hindsight service")]
node_groq["Groq API"]
node_slack["Slack"]
node_clerk["Clerk identity"]

node_engineer -->|"uses console"| node_app
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_incidents_ui
node_app -->|"renders"| node_investigation_ui
node_app -->|"renders"| node_memory_ui
node_app -->|"renders"| node_analytics_ui
node_app -->|"renders"| node_postmortem_ui
node_app -->|"calls API"| node_api_server
node_api_server -->|"dispatches"| node_incident_api
node_api_server -->|"dispatches"| node_memory_api
node_api_server -->|"dispatches"| node_analytics_api
node_api_server -->|"dispatches"| node_slack_webhooks
node_incident_api -->|"orchestrates"| node_incident_service
node_incident_api -->|"accesses incidents"| node_repository
node_memory_api -->|"accesses memory"| node_memory_adapter
node_analytics_api -->|"reads incidents"| node_repository
node_slack_webhooks -->|"saves incident"| node_repository
node_slack_webhooks -->|"notifies"| node_slack_service
node_incident_service -->|"reads and saves"| node_repository
node_incident_service -->|"recalls and retains"| node_memory_adapter
node_incident_service -->|"requests diagnosis"| node_llm_adapter
node_incident_service -->|"dispatches updates"| node_slack_service
node_incident_service -->|"broadcasts events"| node_event_hub
node_repository -->|"stores records"| node_incident_model
node_repository -.->|"reads and writes"| node_mongo
node_memory_adapter -->|"recalls and retains"| node_hindsight
node_hindsight -->|"retrieves records"| node_retrieval
node_llm_adapter -->|"runs inference"| node_groq
node_slack_service -.->|"sends messages"| node_slack
node_slack -.->|"submits events"| node_slack_webhooks
node_app -.->|"authenticates"| node_clerk

click node_app "https://github.com/ch-dhanush-29/incentmindai/blob/main/frontend/src/App.tsx"
click node_dashboard "https://github.com/ch-dhanush-29/incentmindai/blob/main/frontend/src/pages/Dashboard.tsx"
click node_incidents_ui "https://github.com/ch-dhanush-29/incentmindai/blob/main/frontend/src/pages/IncidentList.tsx"
click node_investigation_ui "https://github.com/ch-dhanush-29/incentmindai/blob/main/frontend/src/pages/InvestigationWorkspace.tsx"
click node_memory_ui "https://github.com/ch-dhanush-29/incentmindai/blob/main/frontend/src/pages/MemoryExplorer.tsx"
click node_analytics_ui "https://github.com/ch-dhanush-29/incentmindai/blob/main/frontend/src/pages/AnalyticsPage.tsx"
click node_postmortem_ui "https://github.com/ch-dhanush-29/incentmindai/blob/main/frontend/src/pages/Postmortem.tsx"
click node_api_server "https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/main.py"
click node_incident_api "https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/api/incidents.py"
click node_memory_api "https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/api/memory.py"
click node_analytics_api "https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/api/analytics.py"
click node_slack_webhooks "https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/api/webhooks.py"
click node_incident_service "https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/services/incident_service.py"
click node_incident_model "https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/models/incident.py"
click node_memory_adapter "https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/services/hindsight_adapter.py"
click node_llm_adapter "https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/services/groq_adapter.py"
click node_repository "https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/repositories/incident_repo.py"
click node_event_hub "https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/core/events.py"
click node_slack_service "https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/services/slack_service.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_app,node_dashboard,node_incidents_ui,node_investigation_ui,node_memory_ui,node_analytics_ui,node_postmortem_ui toneBlue
class node_api_server,node_incident_api,node_memory_api,node_analytics_api,node_slack_webhooks,node_incident_service,node_incident_model,node_hindsight toneAmber
class node_memory_adapter,node_retrieval,node_llm_adapter,node_groq toneMint
class node_repository,node_mongo,node_event_hub,node_slack_service toneRose
class node_engineer,node_slack,node_clerk toneIndigo
```

## Components

### Responder experience

- [Console app](https://github.com/ch-dhanush-29/incentmindai/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [SRE dashboard](https://github.com/ch-dhanush-29/incentmindai/blob/main/frontend/src/pages/Dashboard.tsx): `frontend/src/pages/Dashboard.tsx`
- [Incident workspace](https://github.com/ch-dhanush-29/incentmindai/blob/main/frontend/src/pages/IncidentList.tsx): `frontend/src/pages/IncidentList.tsx`
- [Investigation studio](https://github.com/ch-dhanush-29/incentmindai/blob/main/frontend/src/pages/InvestigationWorkspace.tsx): `frontend/src/pages/InvestigationWorkspace.tsx`
- [Memory explorer](https://github.com/ch-dhanush-29/incentmindai/blob/main/frontend/src/pages/MemoryExplorer.tsx): `frontend/src/pages/MemoryExplorer.tsx`
- [Analytics reports](https://github.com/ch-dhanush-29/incentmindai/blob/main/frontend/src/pages/AnalyticsPage.tsx): `frontend/src/pages/AnalyticsPage.tsx`
- [Postmortem review](https://github.com/ch-dhanush-29/incentmindai/blob/main/frontend/src/pages/Postmortem.tsx): `frontend/src/pages/Postmortem.tsx`

### API and workflows

- [FastAPI server](https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/main.py): `backend/app/main.py`
- [Incident endpoints](https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/api/incidents.py): `backend/app/api/incidents.py`
- [Memory endpoints](https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/api/memory.py): `backend/app/api/memory.py`
- [Analytics endpoints](https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/api/analytics.py): `backend/app/api/analytics.py`
- [Slack webhooks](https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/api/webhooks.py): `backend/app/api/webhooks.py`
- [Incident orchestrator](https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/services/incident_service.py): `backend/app/services/incident_service.py`
- [Incident records](https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/models/incident.py): `backend/app/models/incident.py`

### Diagnosis and memory

- [Hindsight adapter](https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/services/hindsight_adapter.py): `backend/app/services/hindsight_adapter.py`
- **TEMPR retrieval**
- [Groq inference](https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/services/groq_adapter.py): `backend/app/services/groq_adapter.py`

### State and integrations

- [Incident repository](https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/repositories/incident_repo.py): `backend/app/repositories/incident_repo.py`
- **MongoDB store**
- [Realtime events](https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/core/events.py): `backend/app/core/events.py`
- [Slack dispatcher](https://github.com/ch-dhanush-29/incentmindai/blob/main/backend/app/services/slack_service.py): `backend/app/services/slack_service.py`

### Other components

- **SRE engineer**
- **Hindsight service**
- **Groq API**
- **Slack**
- **Clerk identity**

## Connections

- SRE engineer → Console app: uses console
- Console app → SRE dashboard: renders
- Console app → Incident workspace: renders
- Console app → Investigation studio: renders
- Console app → Memory explorer: renders
- Console app → Analytics reports: renders
- Console app → Postmortem review: renders
- Console app → FastAPI server: calls API
- FastAPI server → Incident endpoints: dispatches
- FastAPI server → Memory endpoints: dispatches
- FastAPI server → Analytics endpoints: dispatches
- FastAPI server → Slack webhooks: dispatches
- Incident endpoints → Incident orchestrator: orchestrates
- Incident endpoints → Incident repository: accesses incidents
- Memory endpoints → Hindsight adapter: accesses memory
- Analytics endpoints → Incident repository: reads incidents
- Slack webhooks → Incident repository: saves incident
- Slack webhooks → Slack dispatcher: notifies
- Incident orchestrator → Incident repository: reads and saves
- Incident orchestrator → Hindsight adapter: recalls and retains
- Incident orchestrator → Groq inference: requests diagnosis
- Incident orchestrator → Slack dispatcher: dispatches updates
- Incident orchestrator → Realtime events: broadcasts events
- Incident repository → Incident records: stores records
- Incident repository → MongoDB store: reads and writes
- Hindsight adapter → Hindsight service: recalls and retains
- Hindsight service → TEMPR retrieval: retrieves records
- Groq inference → Groq API: runs inference
- Slack dispatcher → Slack: sends messages
- Slack → Slack webhooks: submits events
- Console app → Clerk identity: authenticates
