# rm-ramasamy/sre_agent_intermediate architecture

> Architecture diagram of the GitHub repository rm-ramasamy/sre_agent_intermediate, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rm-ramasamy/sre_agent_intermediate
- Repository: https://github.com/rm-ramasamy/sre_agent_intermediate

## Overview

SRE Agent Intermediate is a full-stack incident-response platform. Target workloads produce failures and observability signals; edge MCP servers expose infrastructure, logs, metrics, code history, and runbooks; the agent investigates alerts and follow-up questions; the control plane manages identity and persisted incident state; and the dashboard lets operators inspect and steer investigations. The README documents the overall request/evidence flow. Several internal runtime and API links are supported by the source index; unsampled modules are represented at their exact tree paths, without inferring unshown calls.

Main entry points: [`sre_agent/agent_runtime.py`](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/agent_runtime.py) (Agent API and runtime), [`sre_agent/agent_runtime_tasks.py`](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/agent_runtime_tasks.py) (Investigation tasks), [`backend/routers/auth.py`](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/backend/routers/auth.py) (Auth routes), [`backend/crud.py`](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/backend/crud.py) (Persistence operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workload["Demo workload"]
  node_loadgen["Traffic generator<br/>[load_gen.py]"]
  node_targetservices["Demo services"]
end

subgraph group_evidence["Evidence integrations"]
  node_prometheus["Prometheus tools<br/>[server.py]"]
  node_loki["Loki tools<br/>[server.py]"]
  node_kubernetes["Kubernetes tools<br/>[server.py]"]
  node_github["GitHub tools<br/>[server.py]"]
  node_runbooks["Runbook tools<br/>[server.py]"]
end

subgraph group_runtime["Agent runtime"]
  node_runtime["Agent API and runtime<br/>[agent_runtime.py]"]
  node_agenttasks["Investigation tasks"]
  node_multigraph["Specialist agent graph"]
  node_supervisor["Investigation supervisor<br/>[supervisor.py]"]
  node_agentstate["Agent state<br/>[agent_state.py]"]
  node_llm["LLM providers<br/>[llm_utils.py]"]
  node_memory[("Incident memory<br/>[memory_store.py]")]
  node_redisstate[("Live execution state")]
  node_callbacks["Live log callbacks<br/>[callbacks.py]"]
end

subgraph group_control["Control plane"]
  node_mission["Mission control API<br/>[mission_control.py]"]
  node_timeline["Incident timeline"]
  node_v1api["Versioned API routes"]
  node_authrouter["Auth routes<br/>[auth.py]"]
  node_authdeps["Request authentication<br/>[auth_deps.py]"]
  node_auth["Token security<br/>[auth.py]"]
  node_crud["Persistence operations<br/>[crud.py]"]
  node_models["Platform data models<br/>[models.py]"]
  node_schemas["API schemas<br/>[schemas.py]"]
  node_database[("PostgreSQL access<br/>[database.py]")]
end

subgraph group_operator["Operator dashboard"]
  node_dashboard["Operator dashboard"]
  node_incidentui["Incident command center"]
  node_authui["Dashboard authentication<br/>[auth-context.tsx]"]
end

node_operatoractor(("SRE operator"))
node_targetactor(("Demo workload"))
node_postgres[("PostgreSQL")]
node_redis[("Redis")]
node_qdrant[("Qdrant")]

node_targetactor -->|"drives traffic"| node_loadgen
node_loadgen -.->|"exercises services"| node_targetservices
node_targetservices -->|"emits signals"| node_prometheus
node_targetservices -->|"emits logs"| node_loki
node_prometheus -->|"provides evidence"| node_runtime
node_loki -->|"provides evidence"| node_runtime
node_kubernetes -->|"provides evidence"| node_runtime
node_github -->|"provides evidence"| node_runtime
node_runbooks -->|"provides evidence"| node_runtime
node_operatoractor -->|"uses"| node_dashboard
node_dashboard -->|"requests API"| node_v1api
node_authui -.->|"authenticates"| node_authrouter
node_incidentui -.->|"sends follow-up"| node_mission
node_runtime -->|"mounts routes"| node_v1api
node_runtime -->|"mounts router"| node_authrouter
node_mission -->|"starts investigation"| node_runtime
node_runtime -->|"orchestrates agents"| node_multigraph
node_runtime -->|"uses state"| node_agentstate
node_runtime -->|"runs background tasks"| node_agenttasks
node_agenttasks -->|"stores findings"| node_memory
node_runtime -->|"stores live state"| node_redisstate
node_runtime -->|"registers callbacks"| node_callbacks
node_callbacks -->|"writes logs"| node_redisstate
node_mission -->|"loads context"| node_timeline
node_mission -->|"dispatches follow-up"| node_agenttasks
node_authrouter -->|"checks identity"| node_authdeps
node_authrouter -->|"reads and creates users"| node_crud
node_authrouter -->|"verifies and signs"| node_auth
node_authdeps -->|"decodes token"| node_auth
node_authdeps -->|"loads user"| node_crud
node_crud -->|"queries records"| node_models
node_crud -->|"uses schemas"| node_schemas
node_authrouter -->|"opens session"| node_database
node_crud -.->|"persists records"| node_database
node_database -->|"connects"| node_postgres
node_agenttasks -->|"updates incidents and jobs"| node_database
node_agenttasks -->|"updates records"| node_models
node_runtime -.->|"selects model"| node_llm
node_runtime -->|"coordinates investigation"| node_supervisor
node_agenttasks -.->|"uses state store"| node_redis
node_agenttasks -.->|"stores incident memory"| node_qdrant

click node_loadgen "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/Target_Client/load-generator/load_gen.py"
click node_targetservices "https://github.com/rm-ramasamy/sre_agent_intermediate/tree/main/Target_Client/services"
click node_prometheus "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/edge_mcp_servers/mcp_servers/prometheus_real/server.py"
click node_loki "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/edge_mcp_servers/mcp_servers/loki_real/server.py"
click node_kubernetes "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/edge_mcp_servers/mcp_servers/k8s_real/server.py"
click node_github "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/edge_mcp_servers/mcp_servers/github_real/server.py"
click node_runbooks "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/edge_mcp_servers/mcp_servers/runbooks_local/server.py"
click node_runtime "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/agent_runtime.py"
click node_agenttasks "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/agent_runtime_tasks.py"
click node_multigraph "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/multi_agent_langgraph.py"
click node_supervisor "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/supervisor.py"
click node_agentstate "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/agent_state.py"
click node_llm "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/llm_utils.py"
click node_memory "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/memory_store.py"
click node_redisstate "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/redis_state_store.py"
click node_callbacks "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/callbacks.py"
click node_mission "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/api/v1/mission_control.py"
click node_timeline "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/incident_timeline.py"
click node_v1api "https://github.com/rm-ramasamy/sre_agent_intermediate/tree/main/sre_agent/api/v1"
click node_authrouter "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/backend/routers/auth.py"
click node_authdeps "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/api/v1/auth_deps.py"
click node_auth "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/backend/auth.py"
click node_crud "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/backend/crud.py"
click node_models "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/backend/models.py"
click node_schemas "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/backend/schemas.py"
click node_database "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/backend/database.py"
click node_dashboard "https://github.com/rm-ramasamy/sre_agent_intermediate/tree/main/dashboard/app/(dashboard)"
click node_incidentui "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/dashboard/components/dashboard/IncidentCommandCenter.tsx"
click node_authui "https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/dashboard/lib/auth-context.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_loadgen,node_targetservices toneBlue
class node_prometheus,node_loki,node_kubernetes,node_github,node_runbooks,node_postgres,node_redis,node_qdrant toneAmber
class node_runtime,node_agenttasks,node_multigraph,node_supervisor,node_agentstate,node_llm,node_memory,node_redisstate,node_callbacks toneMint
class node_mission,node_timeline,node_v1api,node_authrouter,node_authdeps,node_auth,node_crud,node_models,node_schemas,node_database toneRose
class node_dashboard,node_incidentui,node_authui,node_operatoractor,node_targetactor toneIndigo
```

## Components

### Demo workload

- [Traffic generator](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/Target_Client/load-generator/load_gen.py): `Target_Client/load-generator/load_gen.py`
- [Demo services](https://github.com/rm-ramasamy/sre_agent_intermediate/tree/main/Target_Client/services): `Target_Client/services`

### Evidence integrations

- [Prometheus tools](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/edge_mcp_servers/mcp_servers/prometheus_real/server.py): `edge_mcp_servers/mcp_servers/prometheus_real/server.py`
- [Loki tools](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/edge_mcp_servers/mcp_servers/loki_real/server.py): `edge_mcp_servers/mcp_servers/loki_real/server.py`
- [Kubernetes tools](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/edge_mcp_servers/mcp_servers/k8s_real/server.py): `edge_mcp_servers/mcp_servers/k8s_real/server.py`
- [GitHub tools](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/edge_mcp_servers/mcp_servers/github_real/server.py): `edge_mcp_servers/mcp_servers/github_real/server.py`
- [Runbook tools](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/edge_mcp_servers/mcp_servers/runbooks_local/server.py): `edge_mcp_servers/mcp_servers/runbooks_local/server.py`

### Agent runtime

- [Agent API and runtime](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/agent_runtime.py): `sre_agent/agent_runtime.py`
- [Investigation tasks](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/agent_runtime_tasks.py): `sre_agent/agent_runtime_tasks.py`
- [Specialist agent graph](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/multi_agent_langgraph.py): `sre_agent/multi_agent_langgraph.py`
- [Investigation supervisor](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/supervisor.py): `sre_agent/supervisor.py`
- [Agent state](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/agent_state.py): `sre_agent/agent_state.py`
- [LLM providers](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/llm_utils.py): `sre_agent/llm_utils.py`
- [Incident memory](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/memory_store.py): `sre_agent/memory_store.py`
- [Live execution state](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/redis_state_store.py): `sre_agent/redis_state_store.py`
- [Live log callbacks](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/callbacks.py): `sre_agent/callbacks.py`

### Control plane

- [Mission control API](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/api/v1/mission_control.py): `sre_agent/api/v1/mission_control.py`
- [Incident timeline](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/incident_timeline.py): `sre_agent/incident_timeline.py`
- [Versioned API routes](https://github.com/rm-ramasamy/sre_agent_intermediate/tree/main/sre_agent/api/v1): `sre_agent/api/v1`
- [Auth routes](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/backend/routers/auth.py): `backend/routers/auth.py`
- [Request authentication](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/sre_agent/api/v1/auth_deps.py): `sre_agent/api/v1/auth_deps.py`
- [Token security](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/backend/auth.py): `backend/auth.py`
- [Persistence operations](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/backend/crud.py): `backend/crud.py`
- [Platform data models](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/backend/models.py): `backend/models.py`
- [API schemas](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/backend/schemas.py): `backend/schemas.py`
- [PostgreSQL access](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/backend/database.py): `backend/database.py`

### Operator dashboard

- [Operator dashboard](https://github.com/rm-ramasamy/sre_agent_intermediate/tree/main/dashboard/app/(dashboard)): `dashboard/app/(dashboard)`
- [Incident command center](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/dashboard/components/dashboard/IncidentCommandCenter.tsx): `dashboard/components/dashboard/IncidentCommandCenter.tsx`
- [Dashboard authentication](https://github.com/rm-ramasamy/sre_agent_intermediate/blob/main/dashboard/lib/auth-context.tsx): `dashboard/lib/auth-context.tsx`

### Other components

- **SRE operator**
- **Demo workload**
- **PostgreSQL**
- **Redis**
- **Qdrant**

## Connections

- Demo workload → Traffic generator: drives traffic (evidence: `README.md`)
- Traffic generator → Demo services: exercises services
- Demo services → Prometheus tools: emits signals (evidence: `README.md`)
- Demo services → Loki tools: emits logs (evidence: `README.md`)
- Prometheus tools → Agent API and runtime: provides evidence (evidence: `README.md`)
- Loki tools → Agent API and runtime: provides evidence (evidence: `README.md`)
- Kubernetes tools → Agent API and runtime: provides evidence (evidence: `README.md`)
- GitHub tools → Agent API and runtime: provides evidence (evidence: `README.md`)
- Runbook tools → Agent API and runtime: provides evidence (evidence: `README.md`)
- SRE operator → Operator dashboard: uses (evidence: `README.md`)
- Operator dashboard → Versioned API routes: requests API (evidence: `README.md`)
- Dashboard authentication → Auth routes: authenticates
- Incident command center → Mission control API: sends follow-up
- Agent API and runtime → Versioned API routes: mounts routes (evidence: `sre_agent/agent_runtime.py`)
- Agent API and runtime → Auth routes: mounts router (evidence: `sre_agent/agent_runtime.py`)
- Mission control API → Agent API and runtime: starts investigation (evidence: `sre_agent/api/v1/mission_control.py`)
- Agent API and runtime → Specialist agent graph: orchestrates agents (evidence: `sre_agent/agent_runtime.py`)
- Agent API and runtime → Agent state: uses state (evidence: `sre_agent/agent_runtime.py`)
- Agent API and runtime → Investigation tasks: runs background tasks (evidence: `sre_agent/agent_runtime.py`)
- Investigation tasks → Incident memory: stores findings (evidence: `sre_agent/agent_runtime_tasks.py`)
- Agent API and runtime → Live execution state: stores live state (evidence: `sre_agent/agent_runtime.py`)
- Agent API and runtime → Live log callbacks: registers callbacks (evidence: `sre_agent/agent_runtime.py`)
- Live log callbacks → Live execution state: writes logs (evidence: `sre_agent/callbacks.py`)
- Mission control API → Incident timeline: loads context (evidence: `sre_agent/api/v1/mission_control.py`)
- Mission control API → Investigation tasks: dispatches follow-up (evidence: `sre_agent/api/v1/mission_control.py`)
- Auth routes → Request authentication: checks identity (evidence: `backend/routers/auth.py`)
- Auth routes → Persistence operations: reads and creates users (evidence: `backend/routers/auth.py`)
- Auth routes → Token security: verifies and signs (evidence: `backend/routers/auth.py`)
- Request authentication → Token security: decodes token (evidence: `sre_agent/api/v1/auth_deps.py`)
- Request authentication → Persistence operations: loads user (evidence: `sre_agent/api/v1/auth_deps.py`)
- Persistence operations → Platform data models: queries records (evidence: `backend/crud.py`)
- Persistence operations → API schemas: uses schemas (evidence: `backend/crud.py`)
- Auth routes → PostgreSQL access: opens session (evidence: `backend/routers/auth.py`)
- Persistence operations → PostgreSQL access: persists records
- PostgreSQL access → PostgreSQL: connects (evidence: `backend/database.py`)
- Investigation tasks → PostgreSQL access: updates incidents and jobs (evidence: `sre_agent/agent_runtime_tasks.py`)
- Investigation tasks → Platform data models: updates records (evidence: `sre_agent/agent_runtime_tasks.py`)
- Agent API and runtime → LLM providers: selects model (evidence: `sre_agent/agent_runtime.py`)
- Agent API and runtime → Investigation supervisor: coordinates investigation (evidence: `README.md`)
- Investigation tasks → Redis: uses state store
- Investigation tasks → Qdrant: stores incident memory
