# yadavallicharishma3-art/vidhura architecture

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

- Interactive diagram: https://gitdiagram.com/yadavallicharishma3-art/vidhura
- Repository: https://github.com/yadavallicharishma3-art/vidhura

## Overview

VIDHURA is an incident-response cockpit: an SRE submits a simulated incident, the backend recalls prior experience, generates evidence-first investigation guidance, and lets the engineer save a confirmed outcome for future recall. The graph separates the UI/API, orchestration, memory, and reasoning responsibilities. The README documents major capabilities such as memory browsing, dashboard/status, and seeding; some UI and route details are represented at subsystem level because their implementation was not fully sampled.

Main entry points: [`backend/main.py`](https://github.com/yadavallicharishma3-art/vidhura/blob/main/backend/main.py) (FastAPI routes), [`backend/hindsight_service.py`](https://github.com/yadavallicharishma3-art/vidhura/blob/main/backend/hindsight_service.py) (Memory adapter), [`backend/agent.py`](https://github.com/yadavallicharishma3-art/vidhura/blob/main/backend/agent.py) (Incident agent), [`scripts/seed_memories.py`](https://github.com/yadavallicharishma3-art/vidhura/blob/main/scripts/seed_memories.py) (Memory seeding)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Incident experience"]
  node_cockpit["Incident cockpit<br/>[App.tsx]"]
  node_frontend_entry["React entry<br/>[main.tsx]"]
  node_incident_data["Curated scenarios<br/>[incidents.json]"]
end

subgraph group_backend["Backend workflow"]
  node_api["FastAPI routes<br/>[main.py]"]
  node_models["Request models<br/>[models.py]"]
  node_agent["Incident agent<br/>[agent.py]"]
  node_incident_service["Incident records"]
  node_config["Provider configuration<br/>[config.py]"]
end

subgraph group_memory["Memory services"]
  node_seed["Memory seeding<br/>[seed_memories.py]"]
  node_memory_service["Memory adapter"]
  node_hindsight[("Hindsight service")]
  node_demo_memory[("Demo memory store")]
end

subgraph group_reasoning["Reasoning providers"]
  node_llm_service["Investigation reasoning<br/>[llm_service.py]"]
  node_groq{{"Groq GPT-OSS"}}
end

node_engineer(("SRE engineer"))

node_engineer -->|"submits incident"| node_cockpit
node_frontend_entry -->|"renders"| node_cockpit
node_cockpit -->|"calls API"| node_api
node_api -->|"validates input"| node_models
node_api -->|"runs investigation"| node_agent
node_agent -->|"creates and updates"| node_incident_service
node_agent -->|"recalls experience"| node_memory_service
node_agent -->|"requests guidance"| node_llm_service
node_llm_service -->|"requests reasoning"| node_groq
node_api -->|"stores feedback"| node_memory_service
node_engineer -->|"confirms outcome"| node_api
node_memory_service -->|"recalls and retains"| node_hindsight
node_memory_service -->|"reads and writes"| node_demo_memory
node_memory_service -->|"reads settings"| node_config
node_llm_service -->|"reads settings"| node_config
node_incident_service -->|"uses data paths"| node_config
node_api -->|"lists memory and status"| node_memory_service
node_api -->|"starts seeding"| node_seed
node_seed -->|"reads scenarios"| node_incident_data
node_seed -->|"retains scenarios"| node_memory_service
node_api -->|"lists and fetches incidents"| node_incident_service

click node_cockpit "https://github.com/yadavallicharishma3-art/vidhura/blob/main/frontend/src/App.tsx"
click node_frontend_entry "https://github.com/yadavallicharishma3-art/vidhura/blob/main/frontend/src/main.tsx"
click node_api "https://github.com/yadavallicharishma3-art/vidhura/blob/main/backend/main.py"
click node_models "https://github.com/yadavallicharishma3-art/vidhura/blob/main/backend/models.py"
click node_agent "https://github.com/yadavallicharishma3-art/vidhura/blob/main/backend/agent.py"
click node_incident_service "https://github.com/yadavallicharishma3-art/vidhura/blob/main/backend/incident_service.py"
click node_incident_data "https://github.com/yadavallicharishma3-art/vidhura/blob/main/data/incidents.json"
click node_seed "https://github.com/yadavallicharishma3-art/vidhura/blob/main/scripts/seed_memories.py"
click node_memory_service "https://github.com/yadavallicharishma3-art/vidhura/blob/main/backend/hindsight_service.py"
click node_demo_memory "https://github.com/yadavallicharishma3-art/vidhura/blob/main/backend/hindsight_service.py"
click node_llm_service "https://github.com/yadavallicharishma3-art/vidhura/blob/main/backend/llm_service.py"
click node_config "https://github.com/yadavallicharishma3-art/vidhura/blob/main/backend/config.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_cockpit,node_frontend_entry,node_incident_data toneBlue
class node_api,node_models,node_agent,node_incident_service,node_config toneAmber
class node_seed,node_memory_service,node_hindsight,node_demo_memory toneMint
class node_llm_service,node_groq toneRose
class node_engineer toneIndigo
```

## Components

### Incident experience

- [Incident cockpit](https://github.com/yadavallicharishma3-art/vidhura/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [React entry](https://github.com/yadavallicharishma3-art/vidhura/blob/main/frontend/src/main.tsx): `frontend/src/main.tsx`
- [Curated scenarios](https://github.com/yadavallicharishma3-art/vidhura/blob/main/data/incidents.json): `data/incidents.json`

### Backend workflow

- [FastAPI routes](https://github.com/yadavallicharishma3-art/vidhura/blob/main/backend/main.py): `backend/main.py`
- [Request models](https://github.com/yadavallicharishma3-art/vidhura/blob/main/backend/models.py): `backend/models.py`
- [Incident agent](https://github.com/yadavallicharishma3-art/vidhura/blob/main/backend/agent.py): `backend/agent.py`
- [Incident records](https://github.com/yadavallicharishma3-art/vidhura/blob/main/backend/incident_service.py): `backend/incident_service.py`
- [Provider configuration](https://github.com/yadavallicharishma3-art/vidhura/blob/main/backend/config.py): `backend/config.py`

### Memory services

- [Memory seeding](https://github.com/yadavallicharishma3-art/vidhura/blob/main/scripts/seed_memories.py): `scripts/seed_memories.py`
- [Memory adapter](https://github.com/yadavallicharishma3-art/vidhura/blob/main/backend/hindsight_service.py): `backend/hindsight_service.py`
- **Hindsight service**
- [Demo memory store](https://github.com/yadavallicharishma3-art/vidhura/blob/main/backend/hindsight_service.py): `backend/hindsight_service.py`

### Reasoning providers

- [Investigation reasoning](https://github.com/yadavallicharishma3-art/vidhura/blob/main/backend/llm_service.py): `backend/llm_service.py`
- **Groq GPT-OSS**

### Other components

- **SRE engineer**

## Connections

- SRE engineer → Incident cockpit: submits incident (evidence: `README.md`)
- React entry → Incident cockpit: renders (evidence: `frontend/src/main.tsx`)
- Incident cockpit → FastAPI routes: calls API (evidence: `frontend/src/App.tsx`)
- FastAPI routes → Request models: validates input (evidence: `backend/main.py`)
- FastAPI routes → Incident agent: runs investigation (evidence: `backend/main.py`)
- Incident agent → Incident records: creates and updates (evidence: `backend/agent.py`)
- Incident agent → Memory adapter: recalls experience (evidence: `backend/agent.py`)
- Incident agent → Investigation reasoning: requests guidance (evidence: `backend/agent.py`)
- Investigation reasoning → Groq GPT-OSS: requests reasoning (evidence: `backend/llm_service.py`)
- FastAPI routes → Memory adapter: stores feedback (evidence: `backend/main.py`)
- SRE engineer → FastAPI routes: confirms outcome (evidence: `README.md`)
- Memory adapter → Hindsight service: recalls and retains (evidence: `backend/hindsight_service.py`)
- Memory adapter → Demo memory store: reads and writes (evidence: `backend/hindsight_service.py`)
- Memory adapter → Provider configuration: reads settings (evidence: `backend/hindsight_service.py`)
- Investigation reasoning → Provider configuration: reads settings (evidence: `backend/llm_service.py`)
- Incident records → Provider configuration: uses data paths (evidence: `backend/incident_service.py`)
- FastAPI routes → Memory adapter: lists memory and status (evidence: `backend/main.py`)
- FastAPI routes → Memory seeding: starts seeding (evidence: `backend/main.py`)
- Memory seeding → Curated scenarios: reads scenarios (evidence: `scripts/seed_memories.py`)
- Memory seeding → Memory adapter: retains scenarios (evidence: `scripts/seed_memories.py`)
- FastAPI routes → Incident records: lists and fetches incidents (evidence: `backend/main.py`)
