# greptimeteam/agent-rca-bench architecture

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

- Interactive diagram: https://gitdiagram.com/greptimeteam/agent-rca-bench
- Repository: https://github.com/greptimeteam/agent-rca-bench

## Overview

Agent RCA Bench is a benchmark for measuring how observability interfaces affect an LLM agent’s root-cause analysis. Its principal workflow selects and prepares incident cases, runs agents against split-native, raw GreptimeDB, or Semantic Graph interfaces, then evaluates diagnoses and produces comparative reports. The README also identifies Discovery and Graph retrieval as distinct measurement layers alongside end-to-end RCA. Source excerpts show query and ingestion behavior; other links rely on the README or SOURCE INDEX references, so unsampled implementation details are not inferred.

Main entry points: [`src/agent_rca_bench/formal_suite.py`](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/formal_suite.py) (Formal suite runner), [`src/agent_rca_bench/agent.py`](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/agent.py) (RCA agent), [`src/agent_rca_bench/greptimedb/client.py`](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/greptimedb/client.py) (GreptimeDB client), [`src/agent_rca_bench/split_ingest.py`](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/split_ingest.py) (Telemetry ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cases["Cases and telemetry"]
  node_openrca2["OpenRCA2 cases<br/>[openrca2.py]"]
  node_rca100["RCA-100 cases<br/>[rca100.py]"]
  node_transfer_cases["Transfer cohort cases"]
  node_ingest["Telemetry ingestion<br/>[split_ingest.py]"]
  node_otlp["OTLP writers<br/>[otlp.py]"]
  node_prom_write["Prometheus writer<br/>[prometheus.py]"]
  node_loki_write["Loki writer<br/>[loki.py]"]
end

subgraph group_interfaces["Agent interfaces"]
  node_agent["RCA agent<br/>[agent.py]"]
  node_db["GreptimeDB client<br/>[client.py]"]
  node_gateway["Visibility query gateway<br/>[visibility.py]"]
  node_split_query["Split-pillar queries<br/>[split_query.py]"]
end

subgraph group_measurement["Measurement and scoring"]
  node_cli["CLI commands<br/>[cli.py]"]
  node_suite["Formal suite runner<br/>[formal_suite.py]"]
  node_contracts["Case and result contracts<br/>[contracts.py]"]
  node_discovery["Discovery benchmark<br/>[discovery.py]"]
  node_graph_bench["Graph retrieval benchmark<br/>[graph_benchmark.py]"]
  node_evaluation["Diagnosis evaluation<br/>[evaluation.py]"]
  node_transfer_score["Transfer scoring<br/>[transfer_scorer.py]"]
end

subgraph group_publication["Reports and protocol"]
  node_protocol["Transfer protocol"]
  node_suite_protocol["Suite protocol"]
  node_report["Report generation<br/>[report.py]"]
  node_formal_report["Formal report<br/>[formal_report.py]"]
end

node_user(("Benchmark operator"))

node_user -->|"runs commands"| node_cli
node_cli -->|"dispatches runs"| node_suite
node_suite -->|"runs agent"| node_agent
node_suite -->|"loads cases"| node_openrca2
node_suite -->|"loads cases"| node_rca100
node_suite -->|"runs layer"| node_discovery
node_suite -->|"runs layer"| node_graph_bench
node_openrca2 -->|"replays telemetry"| node_ingest
node_ingest -->|"writes telemetry"| node_otlp
node_ingest -->|"writes metrics"| node_prom_write
node_otlp -->|"writes data"| node_db
node_prom_write -->|"writes series"| node_db
node_loki_write -->|"pushes logs"| node_db
node_agent -->|"queries SQL"| node_gateway
node_agent -->|"queries pillars"| node_split_query
node_gateway -->|"queries data"| node_db
node_agent -->|"uses result types"| node_contracts
node_suite -->|"uses case types"| node_contracts
node_suite -->|"evaluates runs"| node_evaluation
node_transfer_cases -->|"adapts cases"| node_openrca2
node_transfer_score -->|"uses evaluations"| node_evaluation
node_suite -->|"validates protocol"| node_suite_protocol
node_suite -->|"uses transfer protocol"| node_protocol
node_formal_report -->|"reads protocol"| node_suite_protocol
node_formal_report -->|"builds reports"| node_report
node_suite -->|"emits results"| node_report

click node_cli "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/cli.py"
click node_suite "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/formal_suite.py"
click node_agent "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/agent.py"
click node_contracts "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/contracts.py"
click node_openrca2 "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/datasets/openrca2.py"
click node_rca100 "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/datasets/rca100.py"
click node_transfer_cases "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/datasets/openrca2_transfer.py"
click node_ingest "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/split_ingest.py"
click node_otlp "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/protocols/otlp.py"
click node_prom_write "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/protocols/prometheus.py"
click node_loki_write "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/protocols/loki.py"
click node_db "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/greptimedb/client.py"
click node_gateway "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/greptimedb/visibility.py"
click node_split_query "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/split_query.py"
click node_discovery "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/discovery.py"
click node_graph_bench "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/graph_benchmark.py"
click node_evaluation "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/evaluation.py"
click node_transfer_score "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/transfer_scorer.py"
click node_protocol "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/transfer_protocol.py"
click node_suite_protocol "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/formal_suite_protocol.py"
click node_report "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/report.py"
click node_formal_report "https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/formal_report.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_openrca2,node_rca100,node_transfer_cases,node_ingest,node_otlp,node_prom_write,node_loki_write toneBlue
class node_agent,node_db,node_gateway,node_split_query toneAmber
class node_cli,node_suite,node_contracts,node_discovery,node_graph_bench,node_evaluation,node_transfer_score toneMint
class node_protocol,node_suite_protocol,node_report,node_formal_report toneRose
class node_user toneIndigo
```

## Components

### Cases and telemetry

- [OpenRCA2 cases](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/datasets/openrca2.py): `src/agent_rca_bench/datasets/openrca2.py`
- [RCA-100 cases](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/datasets/rca100.py): `src/agent_rca_bench/datasets/rca100.py`
- [Transfer cohort cases](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/datasets/openrca2_transfer.py): `src/agent_rca_bench/datasets/openrca2_transfer.py`
- [Telemetry ingestion](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/split_ingest.py): `src/agent_rca_bench/split_ingest.py`
- [OTLP writers](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/protocols/otlp.py): `src/agent_rca_bench/protocols/otlp.py`
- [Prometheus writer](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/protocols/prometheus.py): `src/agent_rca_bench/protocols/prometheus.py`
- [Loki writer](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/protocols/loki.py): `src/agent_rca_bench/protocols/loki.py`

### Agent interfaces

- [RCA agent](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/agent.py): `src/agent_rca_bench/agent.py`
- [GreptimeDB client](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/greptimedb/client.py): `src/agent_rca_bench/greptimedb/client.py`
- [Visibility query gateway](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/greptimedb/visibility.py): `src/agent_rca_bench/greptimedb/visibility.py`
- [Split-pillar queries](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/split_query.py): `src/agent_rca_bench/split_query.py`

### Measurement and scoring

- [CLI commands](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/cli.py): `src/agent_rca_bench/cli.py`
- [Formal suite runner](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/formal_suite.py): `src/agent_rca_bench/formal_suite.py`
- [Case and result contracts](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/contracts.py): `src/agent_rca_bench/contracts.py`
- [Discovery benchmark](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/discovery.py): `src/agent_rca_bench/discovery.py`
- [Graph retrieval benchmark](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/graph_benchmark.py): `src/agent_rca_bench/graph_benchmark.py`
- [Diagnosis evaluation](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/evaluation.py): `src/agent_rca_bench/evaluation.py`
- [Transfer scoring](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/transfer_scorer.py): `src/agent_rca_bench/transfer_scorer.py`

### Reports and protocol

- [Transfer protocol](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/transfer_protocol.py): `src/agent_rca_bench/transfer_protocol.py`
- [Suite protocol](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/formal_suite_protocol.py): `src/agent_rca_bench/formal_suite_protocol.py`
- [Report generation](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/report.py): `src/agent_rca_bench/report.py`
- [Formal report](https://github.com/greptimeteam/agent-rca-bench/blob/main/src/agent_rca_bench/formal_report.py): `src/agent_rca_bench/formal_report.py`

### Other components

- **Benchmark operator**

## Connections

- Benchmark operator → CLI commands: runs commands (evidence: `README.md`)
- CLI commands → Formal suite runner: dispatches runs (evidence: `src/agent_rca_bench/cli.py`)
- Formal suite runner → RCA agent: runs agent (evidence: `src/agent_rca_bench/formal_suite.py`)
- Formal suite runner → OpenRCA2 cases: loads cases (evidence: `src/agent_rca_bench/formal_suite.py`)
- Formal suite runner → RCA-100 cases: loads cases (evidence: `src/agent_rca_bench/formal_suite.py`)
- Formal suite runner → Discovery benchmark: runs layer (evidence: `src/agent_rca_bench/formal_suite.py`)
- Formal suite runner → Graph retrieval benchmark: runs layer (evidence: `src/agent_rca_bench/formal_suite.py`)
- OpenRCA2 cases → Telemetry ingestion: replays telemetry (evidence: `src/agent_rca_bench/split_ingest.py`)
- Telemetry ingestion → OTLP writers: writes telemetry (evidence: `src/agent_rca_bench/split_ingest.py`)
- Telemetry ingestion → Prometheus writer: writes metrics (evidence: `src/agent_rca_bench/split_ingest.py`)
- OTLP writers → GreptimeDB client: writes data (evidence: `src/agent_rca_bench/protocols/otlp.py`)
- Prometheus writer → GreptimeDB client: writes series (evidence: `src/agent_rca_bench/protocols/prometheus.py`)
- Loki writer → GreptimeDB client: pushes logs (evidence: `src/agent_rca_bench/protocols/loki.py`)
- RCA agent → Visibility query gateway: queries SQL (evidence: `src/agent_rca_bench/agent.py`)
- RCA agent → Split-pillar queries: queries pillars (evidence: `src/agent_rca_bench/agent.py`)
- Visibility query gateway → GreptimeDB client: queries data (evidence: `src/agent_rca_bench/greptimedb/visibility.py`)
- RCA agent → Case and result contracts: uses result types (evidence: `src/agent_rca_bench/agent.py`)
- Formal suite runner → Case and result contracts: uses case types (evidence: `src/agent_rca_bench/formal_suite.py`)
- Formal suite runner → Diagnosis evaluation: evaluates runs (evidence: `src/agent_rca_bench/formal_suite.py`)
- Transfer cohort cases → OpenRCA2 cases: adapts cases (evidence: `src/agent_rca_bench/datasets/openrca2_transfer.py`)
- Transfer scoring → Diagnosis evaluation: uses evaluations (evidence: `src/agent_rca_bench/transfer_scorer.py`)
- Formal suite runner → Suite protocol: validates protocol (evidence: `src/agent_rca_bench/formal_suite_protocol.py`)
- Formal suite runner → Transfer protocol: uses transfer protocol (evidence: `src/agent_rca_bench/formal_suite.py`)
- Formal report → Suite protocol: reads protocol (evidence: `src/agent_rca_bench/formal_report.py`)
- Formal report → Report generation: builds reports (evidence: `src/agent_rca_bench/formal_report.py`)
- Formal suite runner → Report generation: emits results (evidence: `src/agent_rca_bench/formal_suite.py`)
