# neeraj-220622/hackwithhyderabad-agent architecture

> Architecture diagram of the GitHub repository neeraj-220622/hackwithhyderabad-agent, 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/neeraj-220622/hackwithhyderabad-agent
- Repository: https://github.com/neeraj-220622/hackwithhyderabad-agent

## Overview

This repository is an AI agent with an operational incident-response product: engineers submit alerts, receive memory-grounded diagnoses and fix warnings, then provide feedback or close incidents to retain learnings. The React interface also exposes memory inspection, patterns, comparison, evaluation, synthetic seeding, and resilience status. The incident service is the documented orchestrator; some feature implementations and agent internals were not sampled, so their internal wiring is shown only where the excerpts or README support it.

Main entry points: [`backend/incident/service.py`](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/incident/service.py) (Incident orchestrator), [`frontend/src/services/api.js`](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/frontend/src/services/api.js) (API client), [`backend/memory/hindsight.py`](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/memory/hindsight.py) (Hindsight wrapper), [`frontend/src/App.jsx`](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/frontend/src/App.jsx) (Application shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React interface"]
  node_app["Application shell<br/>[App.jsx]"]
  node_incident_ui["Incident dashboard"]
  node_views["Memory and analysis views"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["API and orchestration"]
  node_backend_app["FastAPI app<br/>[main.py]"]
  node_agent_routes["Agent routes<br/>[agent_routes.py]"]
  node_incident_routes["Incident routes<br/>[incident_routes.py]"]
  node_health_routes["Health route<br/>[routes.py]"]
end

subgraph group_incident["Incident response"]
  node_incident_service["Incident orchestrator<br/>[service.py]"]
  node_normalizer["Alert normalization<br/>[normalizer.py]"]
  node_recall_planner["Recall planning<br/>[recall_planner.py]"]
  node_diagnosis["Diagnosis<br/>[diagnosis.py]"]
  node_fix_analysis["Fix analysis<br/>[fix_analyzer.py]"]
  node_stale_detection["Stale fix detection<br/>[stale_detector.py]"]
  node_incident_store[("Session incident store<br/>[service.py]")]
  node_learning_features["Learning features"]
end

subgraph group_services["Agent services"]
  node_agent["Agent core<br/>[agent.py]"]
  node_llm["LLM service<br/>[llm.py]"]
  node_memory["Hindsight wrapper<br/>[hindsight.py]"]
end

node_engineer(("Engineer"))
node_groq{{"Groq API"}}
node_hindsight[("Hindsight server")]

node_engineer -->|"uses"| node_app
node_app -->|"renders"| node_incident_ui
node_app -->|"renders"| node_views
node_incident_ui -->|"requests alerts"| node_api_client
node_views -->|"requests features"| node_api_client
node_app -->|"requests chat and memory"| node_api_client
node_api_client -->|"HTTP requests"| node_incident_routes
node_api_client -->|"HTTP requests"| node_agent_routes
node_backend_app -->|"mounts"| node_agent_routes
node_backend_app -->|"mounts"| node_incident_routes
node_backend_app -->|"mounts"| node_health_routes
node_agent_routes -->|"runs chat"| node_agent
node_agent_routes -->|"lists memories"| node_memory
node_agent -->|"generates replies"| node_llm
node_agent -->|"recalls and retains"| node_memory
node_llm -->|"calls provider"| node_groq
node_memory -->|"recalls and writes"| node_hindsight
node_incident_routes -->|"dispatches operations"| node_incident_service
node_incident_service -->|"normalizes alert"| node_normalizer
node_incident_service -->|"plans recall"| node_recall_planner
node_incident_service -->|"diagnoses alert"| node_diagnosis
node_incident_service -->|"analyzes fixes"| node_fix_analysis
node_incident_service -->|"checks stale fixes"| node_stale_detection
node_incident_service -->|"stores and lists"| node_incident_store
node_incident_service -->|"recalls and retains"| node_memory
node_incident_service -->|"requests diagnosis"| node_llm
node_incident_service -->|"dispatches features"| node_learning_features
node_learning_features -->|"uses memory"| node_memory

click node_app "https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/frontend/src/App.jsx"
click node_incident_ui "https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/frontend/src/components/IncidentDashboard.jsx"
click node_views "https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/frontend/src/components/MemoryInspectorView.jsx"
click node_api_client "https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/frontend/src/services/api.js"
click node_backend_app "https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/main.py"
click node_agent_routes "https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/api/agent_routes.py"
click node_incident_routes "https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/api/incident_routes.py"
click node_health_routes "https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/api/routes.py"
click node_agent "https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/agent/agent.py"
click node_incident_service "https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/incident/service.py"
click node_normalizer "https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/incident/normalizer.py"
click node_recall_planner "https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/incident/recall_planner.py"
click node_diagnosis "https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/incident/diagnosis.py"
click node_fix_analysis "https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/incident/fix_analyzer.py"
click node_stale_detection "https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/incident/stale_detector.py"
click node_incident_store "https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/incident/service.py"
click node_learning_features "https://github.com/neeraj-220622/hackwithhyderabad-agent/tree/main/backend/incident"
click node_llm "https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/agent/llm.py"
click node_memory "https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/memory/hindsight.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_incident_ui,node_views,node_api_client toneBlue
class node_backend_app,node_agent_routes,node_incident_routes,node_health_routes,node_hindsight toneAmber
class node_incident_service,node_normalizer,node_recall_planner,node_diagnosis,node_fix_analysis,node_stale_detection,node_incident_store,node_learning_features,node_groq toneMint
class node_agent,node_llm,node_memory toneRose
class node_engineer toneIndigo
```

## Components

### React interface

- [Application shell](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Incident dashboard](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/frontend/src/components/IncidentDashboard.jsx): `frontend/src/components/IncidentDashboard.jsx`
- [Memory and analysis views](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/frontend/src/components/MemoryInspectorView.jsx): `frontend/src/components/MemoryInspectorView.jsx`
- [API client](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### API and orchestration

- [FastAPI app](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/main.py): `backend/main.py`
- [Agent routes](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/api/agent_routes.py): `backend/api/agent_routes.py`
- [Incident routes](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/api/incident_routes.py): `backend/api/incident_routes.py`
- [Health route](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/api/routes.py): `backend/api/routes.py`

### Incident response

- [Incident orchestrator](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/incident/service.py): `backend/incident/service.py`
- [Alert normalization](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/incident/normalizer.py): `backend/incident/normalizer.py`
- [Recall planning](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/incident/recall_planner.py): `backend/incident/recall_planner.py`
- [Diagnosis](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/incident/diagnosis.py): `backend/incident/diagnosis.py`
- [Fix analysis](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/incident/fix_analyzer.py): `backend/incident/fix_analyzer.py`
- [Stale fix detection](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/incident/stale_detector.py): `backend/incident/stale_detector.py`
- [Session incident store](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/incident/service.py): `backend/incident/service.py`
- [Learning features](https://github.com/neeraj-220622/hackwithhyderabad-agent/tree/main/backend/incident): `backend/incident`

### Agent services

- [Agent core](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/agent/agent.py): `backend/agent/agent.py`
- [LLM service](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/agent/llm.py): `backend/agent/llm.py`
- [Hindsight wrapper](https://github.com/neeraj-220622/hackwithhyderabad-agent/blob/main/backend/memory/hindsight.py): `backend/memory/hindsight.py`

### Other components

- **Engineer**
- **Groq API**
- **Hindsight server**

## Connections

- Engineer → Application shell: uses
- Application shell → Incident dashboard: renders
- Application shell → Memory and analysis views: renders
- Incident dashboard → API client: requests alerts
- Memory and analysis views → API client: requests features
- Application shell → API client: requests chat and memory
- API client → Incident routes: HTTP requests
- API client → Agent routes: HTTP requests
- FastAPI app → Agent routes: mounts
- FastAPI app → Incident routes: mounts
- FastAPI app → Health route: mounts
- Agent routes → Agent core: runs chat
- Agent routes → Hindsight wrapper: lists memories
- Agent core → LLM service: generates replies
- Agent core → Hindsight wrapper: recalls and retains
- LLM service → Groq API: calls provider
- Hindsight wrapper → Hindsight server: recalls and writes
- Incident routes → Incident orchestrator: dispatches operations
- Incident orchestrator → Alert normalization: normalizes alert
- Incident orchestrator → Recall planning: plans recall
- Incident orchestrator → Diagnosis: diagnoses alert
- Incident orchestrator → Fix analysis: analyzes fixes
- Incident orchestrator → Stale fix detection: checks stale fixes
- Incident orchestrator → Session incident store: stores and lists
- Incident orchestrator → Hindsight wrapper: recalls and retains
- Incident orchestrator → LLM service: requests diagnosis
- Incident orchestrator → Learning features: dispatches features
- Learning features → Hindsight wrapper: uses memory
