# phamquiluan/rcaeval architecture

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

- Interactive diagram: https://gitdiagram.com/phamquiluan/rcaeval
- Repository: https://github.com/phamquiluan/rcaeval

## Overview

RCAEval is a microservice root-cause-analysis benchmark: telemetry cases are prepared, analyzed by RCA baselines, and ranked predictions are evaluated against annotations. It also provides telemetry conversion, blind-task and LLM-agent evaluation, and multi-source capabilities. The graph preserves these documented branches and the main package’s causal discovery, graph, and ranking layers. Some runtime wiring is unsampled, so uncertain links are omitted or marked dashed rather than inferred from co-location or imports.

Main entry points: [`main.py`](https://github.com/phamquiluan/rcaeval/blob/main/main.py) (Benchmark runner), [`RCAEval/classes/graph.py`](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/classes/graph.py) (Causal graph model), [`RCAEval/convert/__main__.py`](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/convert/__main__.py) (Conversion CLI), [`RCAEval/agent/runner.py`](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/agent/runner.py) (Agent execution)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_benchmark["Benchmark workflow"]
  node_datasets[("Annotated datasets")]
  node_evaluation["Benchmark runner<br/>[main.py]"]
  node_scoring["Prediction scoring<br/>[predictions.py]"]
end

subgraph group_telemetry["Telemetry preparation"]
  node_time_series["Time-series I/O<br/>[time_series.py]"]
  node_convert_cli["Conversion CLI<br/>[__main__.py]"]
  node_convert_common["Case conversion<br/>[common.py]"]
  node_prometheus["Prometheus metrics<br/>[prometheus.py]"]
  node_otlp["OTLP traces<br/>[otlp.py]"]
  node_logs_convert["Log conversion<br/>[logs.py]"]
  node_derive["Derived signals<br/>[derive.py]"]
  node_log_parser["Log templates<br/>[logtemplate.py]"]
  node_eventadl["EventADL extraction"]
end

subgraph group_analysis["RCA analysis"]
  node_case_data["Case data model<br/>[data.py]"]
  node_graph_model["Causal graph model<br/>[graph.py]"]
  node_cmlp["cMLP discovery<br/>[cmlp.py]"]
  node_dag_gnn["DAG-GNN discovery<br/>[dag_gnn.py]"]
  node_granger["Granger discovery<br/>[granger.py]"]
  node_notears["NOTEARS discovery<br/>[notears.py]"]
  node_pcmci["PCMCI discovery<br/>[pcmci.py]"]
  node_fci["FCI discovery<br/>[fci.py]"]
  node_causal_graph["CausalLearn graph<br/>[GraphClass.py]"]
  node_fci_engine["FCI engine<br/>[FCI.py]"]
  node_fas["Adjacency search<br/>[Fas.py]"]
  node_ranking["Root-cause ranking<br/>[random_walk.py]"]
  node_visualization["Graph visualization<br/>[visualization.py]"]
end

subgraph group_agents["Agent evaluation"]
  node_agent_export["Blind task export<br/>[export.py]"]
  node_agent_runner["Agent execution<br/>[runner.py]"]
  node_agent_tools["Telemetry tools<br/>[toolkit.py]"]
  node_mcp["MCP server<br/>[mcp_server.py]"]
  node_predictions["Prediction scoring<br/>[predictions.py]"]
end

node_user(("Benchmark user"))
node_external_telemetry(("Telemetry sources"))
node_llm(("LLM or CLI agent"))

node_user -->|"runs benchmark"| node_evaluation
node_datasets -->|"provides cases"| node_evaluation
node_evaluation -.->|"loads series"| node_time_series
node_evaluation -.->|"prepares cases"| node_case_data
node_evaluation -.->|"uses graphs"| node_graph_model
node_evaluation -.->|"ranks causes"| node_ranking
node_evaluation -.->|"scores results"| node_scoring
node_external_telemetry -->|"supplies exports"| node_convert_cli
node_convert_cli -.->|"converts metrics"| node_prometheus
node_convert_cli -.->|"converts traces"| node_otlp
node_convert_cli -.->|"converts logs"| node_logs_convert
node_convert_cli -.->|"derives signals"| node_derive
node_prometheus -.->|"writes case data"| node_convert_common
node_otlp -.->|"writes case data"| node_convert_common
node_logs_convert -.->|"writes case data"| node_convert_common
node_convert_cli -.->|"parses logs"| node_log_parser
node_evaluation -.->|"handles EventADL"| node_eventadl
node_cmlp -.->|"produces graph"| node_graph_model
node_dag_gnn -.->|"produces graph"| node_graph_model
node_granger -.->|"produces graph"| node_graph_model
node_notears -.->|"produces graph"| node_graph_model
node_pcmci -.->|"produces graph"| node_graph_model
node_fci -.->|"uses engine"| node_fci_engine
node_fci_engine -->|"searches adjacency"| node_fas
node_fci_engine -.->|"constructs graph"| node_causal_graph
node_graph_model -->|"guides ranking"| node_ranking
node_graph_model -->|"renders graph"| node_visualization
node_user -->|"exports tasks"| node_agent_export
node_agent_export -->|"provides blind tasks"| node_llm
node_llm -->|"submits predictions"| node_agent_runner
node_agent_runner -.->|"queries telemetry"| node_agent_tools
node_agent_runner -->|"uses MCP"| node_mcp
node_agent_tools -.->|"reads metrics"| node_time_series
node_agent_tools -.->|"queries logs"| node_log_parser
node_agent_runner -->|"scores predictions"| node_predictions

click node_evaluation "https://github.com/phamquiluan/rcaeval/blob/main/main.py"
click node_scoring "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/agent/predictions.py"
click node_case_data "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/classes/data.py"
click node_time_series "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/io/time_series.py"
click node_convert_cli "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/convert/__main__.py"
click node_convert_common "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/convert/common.py"
click node_prometheus "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/convert/prometheus.py"
click node_otlp "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/convert/otlp.py"
click node_logs_convert "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/convert/logs.py"
click node_derive "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/convert/derive.py"
click node_log_parser "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/logparser/logtemplate.py"
click node_eventadl "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/eventadl/extract_resources.py"
click node_graph_model "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/classes/graph.py"
click node_cmlp "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/graph_construction/cmlp.py"
click node_dag_gnn "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/graph_construction/dag_gnn.py"
click node_granger "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/graph_construction/granger.py"
click node_notears "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/graph_construction/notears.py"
click node_pcmci "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/graph_construction/pcmci.py"
click node_fci "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/graph_construction/fci.py"
click node_causal_graph "https://github.com/phamquiluan/rcaeval/blob/main/lib/causallearn/graph/GraphClass.py"
click node_fci_engine "https://github.com/phamquiluan/rcaeval/blob/main/lib/causallearn/search/ConstraintBased/FCI.py"
click node_fas "https://github.com/phamquiluan/rcaeval/blob/main/lib/causallearn/utils/Fas.py"
click node_ranking "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/graph_heads/random_walk.py"
click node_visualization "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/utility/visualization.py"
click node_agent_export "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/agent/export.py"
click node_agent_runner "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/agent/runner.py"
click node_agent_tools "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/agent/toolkit.py"
click node_mcp "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/agent/mcp_server.py"
click node_predictions "https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/agent/predictions.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_datasets,node_evaluation,node_scoring,node_user toneBlue
class node_time_series,node_convert_cli,node_convert_common,node_prometheus,node_otlp,node_logs_convert,node_derive,node_log_parser,node_eventadl toneAmber
class node_case_data,node_graph_model,node_cmlp,node_dag_gnn,node_granger,node_notears,node_pcmci,node_fci,node_causal_graph,node_fci_engine,node_fas,node_ranking,node_visualization toneMint
class node_agent_export,node_agent_runner,node_agent_tools,node_mcp,node_predictions toneRose
class node_external_telemetry,node_llm toneIndigo
```

## Components

### Benchmark workflow

- **Annotated datasets**
- [Benchmark runner](https://github.com/phamquiluan/rcaeval/blob/main/main.py): `main.py`
- [Prediction scoring](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/agent/predictions.py): `RCAEval/agent/predictions.py`

### Telemetry preparation

- [Time-series I/O](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/io/time_series.py): `RCAEval/io/time_series.py`
- [Conversion CLI](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/convert/__main__.py): `RCAEval/convert/__main__.py`
- [Case conversion](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/convert/common.py): `RCAEval/convert/common.py`
- [Prometheus metrics](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/convert/prometheus.py): `RCAEval/convert/prometheus.py`
- [OTLP traces](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/convert/otlp.py): `RCAEval/convert/otlp.py`
- [Log conversion](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/convert/logs.py): `RCAEval/convert/logs.py`
- [Derived signals](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/convert/derive.py): `RCAEval/convert/derive.py`
- [Log templates](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/logparser/logtemplate.py): `RCAEval/logparser/logtemplate.py`
- [EventADL extraction](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/eventadl/extract_resources.py): `RCAEval/eventadl/extract_resources.py`

### RCA analysis

- [Case data model](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/classes/data.py): `RCAEval/classes/data.py`
- [Causal graph model](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/classes/graph.py): `RCAEval/classes/graph.py`
- [cMLP discovery](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/graph_construction/cmlp.py): `RCAEval/graph_construction/cmlp.py`
- [DAG-GNN discovery](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/graph_construction/dag_gnn.py): `RCAEval/graph_construction/dag_gnn.py`
- [Granger discovery](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/graph_construction/granger.py): `RCAEval/graph_construction/granger.py`
- [NOTEARS discovery](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/graph_construction/notears.py): `RCAEval/graph_construction/notears.py`
- [PCMCI discovery](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/graph_construction/pcmci.py): `RCAEval/graph_construction/pcmci.py`
- [FCI discovery](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/graph_construction/fci.py): `RCAEval/graph_construction/fci.py`
- [CausalLearn graph](https://github.com/phamquiluan/rcaeval/blob/main/lib/causallearn/graph/GraphClass.py): `lib/causallearn/graph/GraphClass.py`
- [FCI engine](https://github.com/phamquiluan/rcaeval/blob/main/lib/causallearn/search/ConstraintBased/FCI.py): `lib/causallearn/search/ConstraintBased/FCI.py`
- [Adjacency search](https://github.com/phamquiluan/rcaeval/blob/main/lib/causallearn/utils/Fas.py): `lib/causallearn/utils/Fas.py`
- [Root-cause ranking](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/graph_heads/random_walk.py): `RCAEval/graph_heads/random_walk.py`
- [Graph visualization](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/utility/visualization.py): `RCAEval/utility/visualization.py`

### Agent evaluation

- [Blind task export](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/agent/export.py): `RCAEval/agent/export.py`
- [Agent execution](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/agent/runner.py): `RCAEval/agent/runner.py`
- [Telemetry tools](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/agent/toolkit.py): `RCAEval/agent/toolkit.py`
- [MCP server](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/agent/mcp_server.py): `RCAEval/agent/mcp_server.py`
- [Prediction scoring](https://github.com/phamquiluan/rcaeval/blob/main/RCAEval/agent/predictions.py): `RCAEval/agent/predictions.py`

### Other components

- **Benchmark user**
- **Telemetry sources**
- **LLM or CLI agent**

## Connections

- Benchmark user → Benchmark runner: runs benchmark (evidence: `README.md`)
- Annotated datasets → Benchmark runner: provides cases (evidence: `README.md`)
- Benchmark runner → Time-series I/O: loads series (evidence: `main.py`)
- Benchmark runner → Case data model: prepares cases
- Benchmark runner → Causal graph model: uses graphs (evidence: `main.py`)
- Benchmark runner → Root-cause ranking: ranks causes
- Benchmark runner → Prediction scoring: scores results
- Telemetry sources → Conversion CLI: supplies exports (evidence: `README.md`)
- Conversion CLI → Prometheus metrics: converts metrics (evidence: `RCAEval/convert/__main__.py`)
- Conversion CLI → OTLP traces: converts traces (evidence: `RCAEval/convert/__main__.py`)
- Conversion CLI → Log conversion: converts logs (evidence: `RCAEval/convert/__main__.py`)
- Conversion CLI → Derived signals: derives signals (evidence: `RCAEval/convert/__main__.py`)
- Prometheus metrics → Case conversion: writes case data (evidence: `RCAEval/convert/prometheus.py`)
- OTLP traces → Case conversion: writes case data (evidence: `RCAEval/convert/otlp.py`)
- Log conversion → Case conversion: writes case data (evidence: `RCAEval/convert/logs.py`)
- Conversion CLI → Log templates: parses logs
- Benchmark runner → EventADL extraction: handles EventADL
- cMLP discovery → Causal graph model: produces graph
- DAG-GNN discovery → Causal graph model: produces graph
- Granger discovery → Causal graph model: produces graph
- NOTEARS discovery → Causal graph model: produces graph
- PCMCI discovery → Causal graph model: produces graph
- FCI discovery → FCI engine: uses engine
- FCI engine → Adjacency search: searches adjacency (evidence: `lib/causallearn/search/ConstraintBased/FCI.py`)
- FCI engine → CausalLearn graph: constructs graph
- Causal graph model → Root-cause ranking: guides ranking (evidence: `RCAEval/graph_heads/random_walk.py`)
- Causal graph model → Graph visualization: renders graph (evidence: `RCAEval/utility/visualization.py`)
- Benchmark user → Blind task export: exports tasks (evidence: `README.md`)
- Blind task export → LLM or CLI agent: provides blind tasks (evidence: `README.md`)
- LLM or CLI agent → Agent execution: submits predictions (evidence: `README.md`)
- Agent execution → Telemetry tools: queries telemetry
- Agent execution → MCP server: uses MCP (evidence: `README.md`)
- Telemetry tools → Time-series I/O: reads metrics
- Telemetry tools → Log templates: queries logs
- Agent execution → Prediction scoring: scores predictions (evidence: `README.md`)
