# mdrcs/agenticai-sre architecture

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

- Interactive diagram: https://gitdiagram.com/mdrcs/agenticai-sre
- Repository: https://github.com/mdrcs/agenticai-sre

## Overview

AgenticAI-SRE combines autonomous incident investigation with canary-release decisions, alongside a Flask health endpoint that exposes request-status metrics. The incident workflow triages Prometheus data and passes it to root-cause analysis; the release workflow applies a canary, probes health, and chooses whether to retain or remove it. Phoenix traces agent activity, while Ollama supplies the LLM. The release source names manifest paths that do not match the checked-in Kub8 filenames, so the manifest relationship is shown at the directory level. Connections are limited to those supported by the excerpts or README.

Main entry points: [`agentic_sre.py`](https://github.com/mdrcs/agenticai-sre/blob/main/agentic_sre.py) (Incident Runner), [`agentic_release.py`](https://github.com/mdrcs/agenticai-sre/blob/main/agentic_release.py) (Release Manager), [`app.py`](https://github.com/mdrcs/agenticai-sre/blob/main/app.py) (Health Endpoint), [`Kub8`](https://github.com/mdrcs/agenticai-sre/tree/main/Kub8) (Kubernetes Manifests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_service["Health Service"]
  node_health["Health Endpoint<br/>[app.py]"]
  node_metrics[("Request Metrics<br/>[app.py]")]
end

subgraph group_incident["Incident Response"]
  node_incident_runner["Incident Runner<br/>[agentic_sre.py]"]
  node_triage["Metric Triage<br/>[agentic_sre.py]"]
  node_prom_tool["Prometheus Query Tool<br/>[agentic_sre.py]"]
  node_rca["Root Cause Analysis<br/>[agentic_sre.py]"]
end

subgraph group_release["Canary Release"]
  node_release_runner["Rollout Runner<br/>[agentic_release.py]"]
  node_release_agent["Release Manager<br/>[agentic_release.py]"]
  node_manifest_tool["Manifest Tool<br/>[agentic_release.py]"]
  node_probe_tool["Health Probe Tool<br/>[agentic_release.py]"]
  node_manifests["Kubernetes Manifests"]
end

subgraph group_observability["Agent Observability"]
  node_phoenix["Phoenix Tracing"]
end

node_user(("Incident Alert"))
node_prometheus["Prometheus"]
node_kubernetes["Kubernetes Cluster"]
node_ollama["Ollama LLM"]

node_user -->|"provides alert"| node_incident_runner
node_incident_runner -->|"starts workflow"| node_triage
node_triage -->|"queries metrics"| node_prom_tool
node_prom_tool -->|"sends PromQL"| node_prometheus
node_prometheus -.->|"reads counters"| node_metrics
node_triage -->|"provides context"| node_rca
node_incident_runner -->|"configures model"| node_ollama
node_release_runner -->|"starts rollout"| node_release_agent
node_release_agent -->|"configures model"| node_ollama
node_release_agent -->|"uses tool"| node_manifest_tool
node_release_agent -->|"uses tool"| node_probe_tool
node_manifest_tool -->|"applies or deletes"| node_manifests
node_manifest_tool -->|"runs kubectl"| node_kubernetes
node_probe_tool -->|"probes endpoint"| node_health
node_health -->|"increments counter"| node_metrics
node_incident_runner -->|"registers traces"| node_phoenix
node_release_runner -->|"registers traces"| node_phoenix

click node_health "https://github.com/mdrcs/agenticai-sre/blob/main/app.py"
click node_metrics "https://github.com/mdrcs/agenticai-sre/blob/main/app.py"
click node_incident_runner "https://github.com/mdrcs/agenticai-sre/blob/main/agentic_sre.py"
click node_triage "https://github.com/mdrcs/agenticai-sre/blob/main/agentic_sre.py"
click node_prom_tool "https://github.com/mdrcs/agenticai-sre/blob/main/agentic_sre.py"
click node_rca "https://github.com/mdrcs/agenticai-sre/blob/main/agentic_sre.py"
click node_release_runner "https://github.com/mdrcs/agenticai-sre/blob/main/agentic_release.py"
click node_release_agent "https://github.com/mdrcs/agenticai-sre/blob/main/agentic_release.py"
click node_manifest_tool "https://github.com/mdrcs/agenticai-sre/blob/main/agentic_release.py"
click node_probe_tool "https://github.com/mdrcs/agenticai-sre/blob/main/agentic_release.py"
click node_manifests "https://github.com/mdrcs/agenticai-sre/tree/main/Kub8"

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_health,node_metrics toneBlue
class node_incident_runner,node_triage,node_prom_tool,node_rca toneAmber
class node_release_runner,node_release_agent,node_manifest_tool,node_probe_tool,node_manifests toneMint
class node_phoenix toneRose
class node_user,node_prometheus,node_kubernetes,node_ollama toneIndigo
```

## Components

### Health Service

- [Health Endpoint](https://github.com/mdrcs/agenticai-sre/blob/main/app.py): `app.py`
- [Request Metrics](https://github.com/mdrcs/agenticai-sre/blob/main/app.py): `app.py`

### Incident Response

- [Incident Runner](https://github.com/mdrcs/agenticai-sre/blob/main/agentic_sre.py): `agentic_sre.py`
- [Metric Triage](https://github.com/mdrcs/agenticai-sre/blob/main/agentic_sre.py): `agentic_sre.py`
- [Prometheus Query Tool](https://github.com/mdrcs/agenticai-sre/blob/main/agentic_sre.py): `agentic_sre.py`
- [Root Cause Analysis](https://github.com/mdrcs/agenticai-sre/blob/main/agentic_sre.py): `agentic_sre.py`

### Canary Release

- [Rollout Runner](https://github.com/mdrcs/agenticai-sre/blob/main/agentic_release.py): `agentic_release.py`
- [Release Manager](https://github.com/mdrcs/agenticai-sre/blob/main/agentic_release.py): `agentic_release.py`
- [Manifest Tool](https://github.com/mdrcs/agenticai-sre/blob/main/agentic_release.py): `agentic_release.py`
- [Health Probe Tool](https://github.com/mdrcs/agenticai-sre/blob/main/agentic_release.py): `agentic_release.py`
- [Kubernetes Manifests](https://github.com/mdrcs/agenticai-sre/tree/main/Kub8): `Kub8`

### Agent Observability

- **Phoenix Tracing**

### Other components

- **Incident Alert**
- **Prometheus**
- **Kubernetes Cluster**
- **Ollama LLM**

## Connections

- Incident Alert → Incident Runner: provides alert (evidence: `agentic_sre.py`)
- Incident Runner → Metric Triage: starts workflow (evidence: `agentic_sre.py`)
- Metric Triage → Prometheus Query Tool: queries metrics (evidence: `agentic_sre.py`)
- Prometheus Query Tool → Prometheus: sends PromQL (evidence: `agentic_sre.py`)
- Prometheus → Request Metrics: reads counters (evidence: `README.md`)
- Metric Triage → Root Cause Analysis: provides context (evidence: `agentic_sre.py`)
- Incident Runner → Ollama LLM: configures model (evidence: `agentic_sre.py`)
- Rollout Runner → Release Manager: starts rollout (evidence: `agentic_release.py`)
- Release Manager → Ollama LLM: configures model (evidence: `agentic_release.py`)
- Release Manager → Manifest Tool: uses tool (evidence: `agentic_release.py`)
- Release Manager → Health Probe Tool: uses tool (evidence: `agentic_release.py`)
- Manifest Tool → Kubernetes Manifests: applies or deletes (evidence: `agentic_release.py`)
- Manifest Tool → Kubernetes Cluster: runs kubectl (evidence: `agentic_release.py`)
- Health Probe Tool → Health Endpoint: probes endpoint (evidence: `agentic_release.py`)
- Health Endpoint → Request Metrics: increments counter (evidence: `app.py`)
- Incident Runner → Phoenix Tracing: registers traces (evidence: `agentic_sre.py`)
- Rollout Runner → Phoenix Tracing: registers traces (evidence: `agentic_release.py`)
