# jeevan-9797/recallops architecture

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

- Interactive diagram: https://gitdiagram.com/jeevan-9797/recallops
- Repository: https://github.com/jeevan-9797/recallops

## Overview

RecallOps is an incident-triage copilot: an on-call engineer selects an incident in the dashboard, starts a streamed triage, reviews recalled incidents and tool activity, then receives a recommendation and can provide feedback. The backend coordinates LLM reasoning, organizational and engineer memory, operational data, and optional team collaboration. Separate dashboard views expose incident history, patterns, and benchmark learning metrics. The README documents these capabilities; source excerpts show key API, tool, database, and UI relationships, but not every integration or route implementation.

Main entry points: [`backend/app/api/incidents.py`](https://github.com/jeevan-9797/recallops/blob/main/backend/app/api/incidents.py) (Incident triage API), [`backend/app/api/router.py`](https://github.com/jeevan-9797/recallops/blob/main/backend/app/api/router.py) (API router), [`backend/app/services/tool_handlers.py`](https://github.com/jeevan-9797/recallops/blob/main/backend/app/services/tool_handlers.py) (SRE tool dispatcher), [`backend/app/db/repository.py`](https://github.com/jeevan-9797/recallops/blob/main/backend/app/db/repository.py) (Operational repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Engineer Dashboard"]
  node_web["RecallOps dashboard<br/>[page.tsx]"]
  node_triage_ui["Triage stream UI<br/>[triage.tsx]"]
  node_triage_hook["Triage event state<br/>[useTriage.ts]"]
  node_web_api["API and SSE client<br/>[api.ts]"]
end

subgraph group_api["API Platform"]
  node_api_router["API router<br/>[router.py]"]
  node_incident_api["Incident triage API<br/>[incidents.py]"]
  node_alert_api["Alert API<br/>[alerts.py]"]
  node_metrics_api["Metrics API<br/>[metrics.py]"]
  node_observation_api["Observation API<br/>[observations.py]"]
  node_demo_api["Protected demo API<br/>[demo.py]"]
  node_app_config["Runtime configuration<br/>[config.py]"]
  node_exceptions["Exception sanitization<br/>[exceptions.py]"]
  node_sse["SSE transport<br/>[sse.py]"]
end

subgraph group_intelligence["Triage Intelligence"]
  node_tool_dispatch["SRE tool dispatcher<br/>[tool_handlers.py]"]
  node_groq["LLM agent<br/>[groq_agent.py]"]
  node_hindsight["Dual-memory service"]
  node_band["Band collaboration adapter<br/>[band_adapter.py]"]
  node_prompts["Agent prompts<br/>[system_prompts.py]"]
  node_agent_schemas["Agent tool contracts<br/>[agent_tools.py]"]
end

subgraph group_state["Operational State"]
  node_db_repo["Operational repository<br/>[repository.py]"]
  node_db_models["Application data models<br/>[models.py]"]
  node_db_session["Async DB sessions<br/>[session.py]"]
  node_postgres[("PostgreSQL store<br/>[models.py]")]
  node_db_connection["Database connection<br/>[connection.py]"]
end

subgraph group_evaluation["Learning and Evaluation"]
  node_eval_pipeline["Recall ranking pipeline<br/>[recall_pipeline.py]"]
  node_memory_templates["Memory templates"]
  node_dataset_builder["Incident dataset builder<br/>[dataset_builder.py]"]
  node_root_causes["Root-cause catalog<br/>[root_causes.py]"]
end

node_engineer(("On-call engineer"))
node_hindsight_cloud["Hindsight Cloud"]
node_groq_cloud["Groq inference"]
node_band_service["Band service"]

node_engineer -->|"uses"| node_web
node_web -.->|"opens incident"| node_triage_ui
node_triage_ui -.->|"starts triage"| node_triage_hook
node_triage_hook -->|"streams events"| node_web_api
node_web_api -.->|"requests triage"| node_incident_api
node_api_router -->|"mounts"| node_incident_api
node_api_router -->|"mounts"| node_alert_api
node_api_router -->|"mounts"| node_metrics_api
node_api_router -->|"mounts"| node_observation_api
node_api_router -->|"mounts"| node_demo_api
node_incident_api -->|"streams events"| node_sse
node_incident_api -->|"runs reasoning"| node_groq
node_incident_api -->|"executes tools"| node_tool_dispatch
node_incident_api -->|"uses memory"| node_hindsight
node_incident_api -->|"coordinates"| node_band
node_incident_api -->|"reads and writes"| node_db_repo
node_incident_api -->|"sanitizes errors"| node_exceptions
node_tool_dispatch -->|"recalls memories"| node_hindsight
node_tool_dispatch -->|"queries operations"| node_db_repo
node_tool_dispatch -->|"posts updates"| node_band
node_tool_dispatch -->|"validates tools"| node_agent_schemas
node_groq -.->|"infers"| node_groq_cloud
node_hindsight -.->|"recalls and retains"| node_hindsight_cloud
node_band -.->|"posts updates"| node_band_service
node_db_repo -.->|"queries"| node_db_models
node_db_session -->|"maps schema"| node_db_models
node_db_connection -->|"connects"| node_postgres
node_alert_api -->|"accesses data"| node_db_repo
node_eval_pipeline -->|"uses templates"| node_memory_templates
node_dataset_builder -->|"uses causes"| node_root_causes
node_dataset_builder -.->|"seeds data"| node_postgres
node_metrics_api -.->|"reports results"| node_eval_pipeline
node_incident_api -.->|"uses prompts"| node_prompts
node_incident_api -.->|"uses settings"| node_app_config

click node_web "https://github.com/jeevan-9797/recallops/blob/main/recallops-web/app/incidents/%5Bid%5D/page.tsx"
click node_triage_ui "https://github.com/jeevan-9797/recallops/blob/main/recallops-web/components/triage.tsx"
click node_triage_hook "https://github.com/jeevan-9797/recallops/blob/main/recallops-web/lib/useTriage.ts"
click node_web_api "https://github.com/jeevan-9797/recallops/blob/main/recallops-web/lib/api.ts"
click node_api_router "https://github.com/jeevan-9797/recallops/blob/main/backend/app/api/router.py"
click node_incident_api "https://github.com/jeevan-9797/recallops/blob/main/backend/app/api/incidents.py"
click node_alert_api "https://github.com/jeevan-9797/recallops/blob/main/backend/app/api/alerts.py"
click node_metrics_api "https://github.com/jeevan-9797/recallops/blob/main/backend/app/api/metrics.py"
click node_observation_api "https://github.com/jeevan-9797/recallops/blob/main/backend/app/api/observations.py"
click node_demo_api "https://github.com/jeevan-9797/recallops/blob/main/backend/app/api/demo.py"
click node_app_config "https://github.com/jeevan-9797/recallops/blob/main/backend/app/config.py"
click node_exceptions "https://github.com/jeevan-9797/recallops/blob/main/backend/app/core/exceptions.py"
click node_sse "https://github.com/jeevan-9797/recallops/blob/main/backend/app/core/sse.py"
click node_tool_dispatch "https://github.com/jeevan-9797/recallops/blob/main/backend/app/services/tool_handlers.py"
click node_groq "https://github.com/jeevan-9797/recallops/blob/main/backend/app/services/groq_agent.py"
click node_hindsight "https://github.com/jeevan-9797/recallops/blob/main/backend/app/services/hindsight_service.py"
click node_band "https://github.com/jeevan-9797/recallops/blob/main/backend/app/services/band_adapter.py"
click node_prompts "https://github.com/jeevan-9797/recallops/blob/main/backend/app/prompts/system_prompts.py"
click node_agent_schemas "https://github.com/jeevan-9797/recallops/blob/main/backend/app/schemas/agent_tools.py"
click node_db_repo "https://github.com/jeevan-9797/recallops/blob/main/backend/app/db/repository.py"
click node_db_models "https://github.com/jeevan-9797/recallops/blob/main/backend/app/db/models.py"
click node_db_session "https://github.com/jeevan-9797/recallops/blob/main/backend/app/db/session.py"
click node_postgres "https://github.com/jeevan-9797/recallops/blob/main/database/models.py"
click node_db_connection "https://github.com/jeevan-9797/recallops/blob/main/database/connection.py"
click node_eval_pipeline "https://github.com/jeevan-9797/recallops/blob/main/eval/recall_pipeline.py"
click node_memory_templates "https://github.com/jeevan-9797/recallops/blob/main/eval/memory_templates.py"
click node_dataset_builder "https://github.com/jeevan-9797/recallops/blob/main/data/generators/dataset_builder.py"
click node_root_causes "https://github.com/jeevan-9797/recallops/blob/main/data/generators/root_causes.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_web,node_triage_ui,node_triage_hook,node_web_api toneBlue
class node_api_router,node_incident_api,node_alert_api,node_metrics_api,node_observation_api,node_demo_api,node_app_config,node_exceptions,node_sse toneAmber
class node_tool_dispatch,node_groq,node_hindsight,node_band,node_prompts,node_agent_schemas toneMint
class node_db_repo,node_db_models,node_db_session,node_postgres,node_db_connection toneRose
class node_eval_pipeline,node_memory_templates,node_dataset_builder,node_root_causes,node_engineer,node_hindsight_cloud,node_groq_cloud,node_band_service toneIndigo
```

## Components

### Engineer Dashboard

- [RecallOps dashboard](https://github.com/jeevan-9797/recallops/blob/main/recallops-web/app/incidents/%5Bid%5D/page.tsx): `recallops-web/app/incidents/[id]/page.tsx`
- [Triage stream UI](https://github.com/jeevan-9797/recallops/blob/main/recallops-web/components/triage.tsx): `recallops-web/components/triage.tsx`
- [Triage event state](https://github.com/jeevan-9797/recallops/blob/main/recallops-web/lib/useTriage.ts): `recallops-web/lib/useTriage.ts`
- [API and SSE client](https://github.com/jeevan-9797/recallops/blob/main/recallops-web/lib/api.ts): `recallops-web/lib/api.ts`

### API Platform

- [API router](https://github.com/jeevan-9797/recallops/blob/main/backend/app/api/router.py): `backend/app/api/router.py`
- [Incident triage API](https://github.com/jeevan-9797/recallops/blob/main/backend/app/api/incidents.py): `backend/app/api/incidents.py`
- [Alert API](https://github.com/jeevan-9797/recallops/blob/main/backend/app/api/alerts.py): `backend/app/api/alerts.py`
- [Metrics API](https://github.com/jeevan-9797/recallops/blob/main/backend/app/api/metrics.py): `backend/app/api/metrics.py`
- [Observation API](https://github.com/jeevan-9797/recallops/blob/main/backend/app/api/observations.py): `backend/app/api/observations.py`
- [Protected demo API](https://github.com/jeevan-9797/recallops/blob/main/backend/app/api/demo.py): `backend/app/api/demo.py`
- [Runtime configuration](https://github.com/jeevan-9797/recallops/blob/main/backend/app/config.py): `backend/app/config.py`
- [Exception sanitization](https://github.com/jeevan-9797/recallops/blob/main/backend/app/core/exceptions.py): `backend/app/core/exceptions.py`
- [SSE transport](https://github.com/jeevan-9797/recallops/blob/main/backend/app/core/sse.py): `backend/app/core/sse.py`

### Triage Intelligence

- [SRE tool dispatcher](https://github.com/jeevan-9797/recallops/blob/main/backend/app/services/tool_handlers.py): `backend/app/services/tool_handlers.py`
- [LLM agent](https://github.com/jeevan-9797/recallops/blob/main/backend/app/services/groq_agent.py): `backend/app/services/groq_agent.py`
- [Dual-memory service](https://github.com/jeevan-9797/recallops/blob/main/backend/app/services/hindsight_service.py): `backend/app/services/hindsight_service.py`
- [Band collaboration adapter](https://github.com/jeevan-9797/recallops/blob/main/backend/app/services/band_adapter.py): `backend/app/services/band_adapter.py`
- [Agent prompts](https://github.com/jeevan-9797/recallops/blob/main/backend/app/prompts/system_prompts.py): `backend/app/prompts/system_prompts.py`
- [Agent tool contracts](https://github.com/jeevan-9797/recallops/blob/main/backend/app/schemas/agent_tools.py): `backend/app/schemas/agent_tools.py`

### Operational State

- [Operational repository](https://github.com/jeevan-9797/recallops/blob/main/backend/app/db/repository.py): `backend/app/db/repository.py`
- [Application data models](https://github.com/jeevan-9797/recallops/blob/main/backend/app/db/models.py): `backend/app/db/models.py`
- [Async DB sessions](https://github.com/jeevan-9797/recallops/blob/main/backend/app/db/session.py): `backend/app/db/session.py`
- [PostgreSQL store](https://github.com/jeevan-9797/recallops/blob/main/database/models.py): `database/models.py`
- [Database connection](https://github.com/jeevan-9797/recallops/blob/main/database/connection.py): `database/connection.py`

### Learning and Evaluation

- [Recall ranking pipeline](https://github.com/jeevan-9797/recallops/blob/main/eval/recall_pipeline.py): `eval/recall_pipeline.py`
- [Memory templates](https://github.com/jeevan-9797/recallops/blob/main/eval/memory_templates.py): `eval/memory_templates.py`
- [Incident dataset builder](https://github.com/jeevan-9797/recallops/blob/main/data/generators/dataset_builder.py): `data/generators/dataset_builder.py`
- [Root-cause catalog](https://github.com/jeevan-9797/recallops/blob/main/data/generators/root_causes.py): `data/generators/root_causes.py`

### Other components

- **On-call engineer**
- **Hindsight Cloud**
- **Groq inference**
- **Band service**

## Connections

- On-call engineer → RecallOps dashboard: uses (evidence: `README.md`)
- RecallOps dashboard → Triage stream UI: opens incident
- Triage stream UI → Triage event state: starts triage
- Triage event state → API and SSE client: streams events (evidence: `recallops-web/lib/useTriage.ts`)
- API and SSE client → Incident triage API: requests triage
- API router → Incident triage API: mounts (evidence: `backend/app/api/router.py`)
- API router → Alert API: mounts (evidence: `backend/app/api/router.py`)
- API router → Metrics API: mounts (evidence: `backend/app/api/router.py`)
- API router → Observation API: mounts (evidence: `backend/app/api/router.py`)
- API router → Protected demo API: mounts (evidence: `backend/app/api/router.py`)
- Incident triage API → SSE transport: streams events (evidence: `backend/app/api/incidents.py`)
- Incident triage API → LLM agent: runs reasoning (evidence: `backend/app/api/incidents.py`)
- Incident triage API → SRE tool dispatcher: executes tools (evidence: `backend/app/api/incidents.py`)
- Incident triage API → Dual-memory service: uses memory (evidence: `backend/app/api/incidents.py`)
- Incident triage API → Band collaboration adapter: coordinates (evidence: `backend/app/api/incidents.py`)
- Incident triage API → Operational repository: reads and writes (evidence: `backend/app/api/incidents.py`)
- Incident triage API → Exception sanitization: sanitizes errors (evidence: `backend/app/api/incidents.py`)
- SRE tool dispatcher → Dual-memory service: recalls memories (evidence: `backend/app/services/tool_handlers.py`)
- SRE tool dispatcher → Operational repository: queries operations (evidence: `backend/app/services/tool_handlers.py`)
- SRE tool dispatcher → Band collaboration adapter: posts updates (evidence: `backend/app/services/tool_handlers.py`)
- SRE tool dispatcher → Agent tool contracts: validates tools (evidence: `backend/app/services/tool_handlers.py`)
- LLM agent → Groq inference: infers
- Dual-memory service → Hindsight Cloud: recalls and retains
- Band collaboration adapter → Band service: posts updates
- Operational repository → Application data models: queries (evidence: `backend/app/db/repository.py`)
- Async DB sessions → Application data models: maps schema (evidence: `backend/app/db/session.py`)
- Database connection → PostgreSQL store: connects (evidence: `database/connection.py`)
- Alert API → Operational repository: accesses data (evidence: `backend/app/api/alerts.py`)
- Recall ranking pipeline → Memory templates: uses templates (evidence: `eval/recall_pipeline.py`)
- Incident dataset builder → Root-cause catalog: uses causes
- Incident dataset builder → PostgreSQL store: seeds data
- Metrics API → Recall ranking pipeline: reports results
- Incident triage API → Agent prompts: uses prompts
- Incident triage API → Runtime configuration: uses settings (evidence: `backend/app/api/incidents.py`)
