# microsoft/rd-agent architecture

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

- Interactive diagram: https://gitdiagram.com/microsoft/rd-agent
- Repository: https://github.com/microsoft/rd-agent
- Video tour (about a minute): https://gitdiagram.com/microsoft/rd-agent/video

## Overview

RD-Agent is a framework for autonomous research and development across data science, quantitative finance, Kaggle, LLM fine-tuning, and reinforcement learning. Its user-facing workflow is to launch a scenario, iterate on research proposals and generated experiments, execute and evaluate them, and inspect the run trace. The tree shows distinct scenario and coder modules alongside shared agent, workflow, and logging layers. The sampled source chiefly verifies trace storage and web-server interactions, so most internal workflow wiring is intentionally left unspecified.

Main entry points: [`rdagent/log/server/app.py`](https://github.com/microsoft/rd-agent/blob/main/rdagent/log/server/app.py) (Trace server), [`web/src/App.vue`](https://github.com/microsoft/rd-agent/blob/main/web/src/App.vue) (Web UI), [`rdagent/log/ui/storage.py`](https://github.com/microsoft/rd-agent/blob/main/rdagent/log/ui/storage.py) (Web trace storage), [`rdagent/app/cli.py`](https://github.com/microsoft/rd-agent/blob/main/rdagent/app/cli.py) (CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_cli["CLI<br/>[cli.py]"]
end

subgraph group_domains["Research scenarios"]
  node_ds["Data science"]
  node_quant["Quant research"]
  node_kaggle["Kaggle"]
  node_finetune["LLM fine-tuning"]
  node_rl["RL engineering"]
end

subgraph group_engine["Agent engine"]
  node_loop["Scenario loops"]
  node_proposal["Proposal generation"]
  node_coder["Experiment coding"]
  node_runner["Execution"]
  node_evaluation["Evaluation<br/>[evaluation.py]"]
  node_llm["LLM backend"]
end

subgraph group_observability["Run observability"]
  node_filelogs[("File logs<br/>[storage.py]")]
  node_webstorage["Web trace storage<br/>[storage.py]"]
  node_server["Trace server<br/>[app.py]"]
  node_webui["Web UI<br/>[App.vue]"]
  node_timeline["Run timelines<br/>[app.py]"]
  node_fttimeline["Fine-tune timelines<br/>[app.py]"]
end

node_user(("User"))

node_user -->|"launches"| node_cli
node_webstorage -->|"posts trace data"| node_server
node_webui -->|"requests trace data"| node_server
node_webui -->|"submits responses"| node_server

click node_cli "https://github.com/microsoft/rd-agent/blob/main/rdagent/app/cli.py"
click node_ds "https://github.com/microsoft/rd-agent/tree/main/rdagent/scenarios/data_science"
click node_quant "https://github.com/microsoft/rd-agent/tree/main/rdagent/app/qlib_rd_loop"
click node_kaggle "https://github.com/microsoft/rd-agent/tree/main/rdagent/scenarios/kaggle"
click node_finetune "https://github.com/microsoft/rd-agent/tree/main/rdagent/scenarios/finetune"
click node_rl "https://github.com/microsoft/rd-agent/tree/main/rdagent/scenarios/rl"
click node_loop "https://github.com/microsoft/rd-agent/blob/main/rdagent/core/evolving_framework.py"
click node_proposal "https://github.com/microsoft/rd-agent/tree/main/rdagent/scenarios/data_science/proposal/exp_gen"
click node_coder "https://github.com/microsoft/rd-agent/tree/main/rdagent/components/coder"
click node_runner "https://github.com/microsoft/rd-agent/tree/main/rdagent/components/runner"
click node_evaluation "https://github.com/microsoft/rd-agent/blob/main/rdagent/core/evaluation.py"
click node_llm "https://github.com/microsoft/rd-agent/tree/main/rdagent/oai/backend"
click node_filelogs "https://github.com/microsoft/rd-agent/blob/main/rdagent/log/storage.py"
click node_webstorage "https://github.com/microsoft/rd-agent/blob/main/rdagent/log/ui/storage.py"
click node_server "https://github.com/microsoft/rd-agent/blob/main/rdagent/log/server/app.py"
click node_webui "https://github.com/microsoft/rd-agent/blob/main/web/src/App.vue"
click node_timeline "https://github.com/microsoft/rd-agent/blob/main/rdagent/app/rl/ui/app.py"
click node_fttimeline "https://github.com/microsoft/rd-agent/blob/main/rdagent/app/finetune/llm/ui/app.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_cli,node_user toneBlue
class node_ds,node_quant,node_kaggle,node_finetune,node_rl toneAmber
class node_loop,node_proposal,node_coder,node_runner,node_evaluation,node_llm toneMint
class node_filelogs,node_webstorage,node_server,node_webui,node_timeline,node_fttimeline toneRose
```

## Components

### Application entry

- [CLI](https://github.com/microsoft/rd-agent/blob/main/rdagent/app/cli.py): `rdagent/app/cli.py`

### Research scenarios

- [Data science](https://github.com/microsoft/rd-agent/tree/main/rdagent/scenarios/data_science): `rdagent/scenarios/data_science`
- [Quant research](https://github.com/microsoft/rd-agent/tree/main/rdagent/app/qlib_rd_loop): `rdagent/app/qlib_rd_loop`
- [Kaggle](https://github.com/microsoft/rd-agent/tree/main/rdagent/scenarios/kaggle): `rdagent/scenarios/kaggle`
- [LLM fine-tuning](https://github.com/microsoft/rd-agent/tree/main/rdagent/scenarios/finetune): `rdagent/scenarios/finetune`
- [RL engineering](https://github.com/microsoft/rd-agent/tree/main/rdagent/scenarios/rl): `rdagent/scenarios/rl`

### Agent engine

- [Scenario loops](https://github.com/microsoft/rd-agent/blob/main/rdagent/core/evolving_framework.py): `rdagent/core/evolving_framework.py`
- [Proposal generation](https://github.com/microsoft/rd-agent/tree/main/rdagent/scenarios/data_science/proposal/exp_gen): `rdagent/scenarios/data_science/proposal/exp_gen`
- [Experiment coding](https://github.com/microsoft/rd-agent/tree/main/rdagent/components/coder): `rdagent/components/coder`
- [Execution](https://github.com/microsoft/rd-agent/tree/main/rdagent/components/runner): `rdagent/components/runner`
- [Evaluation](https://github.com/microsoft/rd-agent/blob/main/rdagent/core/evaluation.py): `rdagent/core/evaluation.py`
- [LLM backend](https://github.com/microsoft/rd-agent/tree/main/rdagent/oai/backend): `rdagent/oai/backend`

### Run observability

- [File logs](https://github.com/microsoft/rd-agent/blob/main/rdagent/log/storage.py): `rdagent/log/storage.py`
- [Web trace storage](https://github.com/microsoft/rd-agent/blob/main/rdagent/log/ui/storage.py): `rdagent/log/ui/storage.py`
- [Trace server](https://github.com/microsoft/rd-agent/blob/main/rdagent/log/server/app.py): `rdagent/log/server/app.py`
- [Web UI](https://github.com/microsoft/rd-agent/blob/main/web/src/App.vue): `web/src/App.vue`
- [Run timelines](https://github.com/microsoft/rd-agent/blob/main/rdagent/app/rl/ui/app.py): `rdagent/app/rl/ui/app.py`
- [Fine-tune timelines](https://github.com/microsoft/rd-agent/blob/main/rdagent/app/finetune/llm/ui/app.py): `rdagent/app/finetune/llm/ui/app.py`

### Other components

- **User**

## Connections

- User → CLI: launches
- Web trace storage → Trace server: posts trace data
- Web UI → Trace server: requests trace data
- Web UI → Trace server: submits responses
