# balechen/mr-dre architecture

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

- Interactive diagram: https://gitdiagram.com/balechen/mr-dre
- Repository: https://github.com/balechen/mr-dre

## Overview

Mr Dre evaluates deep-research reports and simulates iterative revision: a dataset question is sent to a research agent, its report can be evaluated, feedback is generated and used for a later turn, and reports can be scored across checklist, citation, and presentation dimensions. The graph includes the documented generation and evaluation branches plus sampled revision, feedback, and citation-crawling internals. Some orchestration source was not sampled, so uncertain call wiring is omitted.

Main entry points: [`call_dra.py`](https://github.com/balechen/mr-dre/blob/main/call_dra.py) (Generation Orchestrator), [`evaluate_report.py`](https://github.com/balechen/mr-dre/blob/main/evaluate_report.py) (Evaluation Orchestrator), [`engine/reviser_agent/main.py`](https://github.com/balechen/mr-dre/blob/main/engine/reviser_agent/main.py) (Revision Agent), [`engine/oai.py`](https://github.com/balechen/mr-dre/blob/main/engine/oai.py) (OpenAI Research Agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Generation and Revision"]
  node_datasets["Benchmark Datasets"]
  node_runner["Generation Orchestrator<br/>[call_dra.py]"]
  node_feedback["Feedback Synthesis<br/>[feedback.py]"]
  node_revision["Turn Preparation<br/>[call_dra.py]"]
end

subgraph group_engines["Research Engines"]
  node_reviser["Revision Agent<br/>[main.py]"]
  node_tools["Web Search Tool<br/>[tools.py]"]
  node_oai["OpenAI Research Agent<br/>[oai.py]"]
  node_perplexity["Perplexity Research Agent<br/>[perplexity.py]"]
end

subgraph group_evaluation["Report Evaluation"]
  node_report_eval["Evaluation Orchestrator<br/>[evaluate_report.py]"]
  node_checklist["Checklist Scoring<br/>[checklist_eval.py]"]
  node_citation["Citation Scoring<br/>[citation_eval.py]"]
  node_rubric["Rubric Scoring<br/>[rubric_eval.py]"]
end

subgraph group_support["Evaluation Support"]
  node_prompts["Evaluation Prompts<br/>[eval_prompts.py]"]
  node_crawler["URL Crawler<br/>[jina.py]"]
  node_crawl_cache[("Crawler Cache<br/>[cache.py]")]
  node_api_cache[("API Cache<br/>[cache.py]")]
end

node_researcher(("Researcher"))
node_vllm(("vLLM Service"))
node_serper(("Serper Search"))
node_openai_api(("OpenAI API"))
node_perplexity_api(("Perplexity API"))
node_jina(("Jina Reader API"))

node_researcher -->|"requests report"| node_runner
node_datasets -->|"supplies questions"| node_runner
node_runner -->|"dispatches generation"| node_oai
node_runner -->|"dispatches generation"| node_perplexity
node_runner -->|"dispatches revision"| node_reviser
node_reviser -->|"requests completion"| node_vllm
node_reviser -->|"executes tools"| node_tools
node_tools -->|"searches web"| node_serper
node_oai -->|"creates and polls"| node_openai_api
node_perplexity -->|"submits and polls"| node_perplexity_api
node_runner -->|"generates feedback"| node_feedback
node_feedback -->|"provides feedback"| node_revision
node_revision -->|"prepares next turn"| node_runner
node_runner -->|"evaluates prior report"| node_report_eval
node_researcher -->|"submits report"| node_report_eval
node_datasets -->|"supplies criteria"| node_report_eval
node_report_eval -->|"runs checklist mode"| node_checklist
node_report_eval -->|"runs citation mode"| node_citation
node_report_eval -->|"runs rubric mode"| node_rubric
node_checklist -->|"uses criteria prompts"| node_prompts
node_citation -->|"uses claim prompts"| node_prompts
node_citation -->|"fetches cited URLs"| node_crawler
node_crawler -->|"reads and writes"| node_crawl_cache
node_crawler -->|"fetches webpage"| node_jina
node_oai -.->|"caches API calls"| node_api_cache

click node_datasets "https://github.com/balechen/mr-dre/tree/main/data"
click node_runner "https://github.com/balechen/mr-dre/blob/main/call_dra.py"
click node_feedback "https://github.com/balechen/mr-dre/blob/main/feedback.py"
click node_revision "https://github.com/balechen/mr-dre/blob/main/call_dra.py"
click node_reviser "https://github.com/balechen/mr-dre/blob/main/engine/reviser_agent/main.py"
click node_tools "https://github.com/balechen/mr-dre/blob/main/engine/reviser_agent/tools.py"
click node_oai "https://github.com/balechen/mr-dre/blob/main/engine/oai.py"
click node_perplexity "https://github.com/balechen/mr-dre/blob/main/engine/perplexity.py"
click node_report_eval "https://github.com/balechen/mr-dre/blob/main/evaluate_report.py"
click node_checklist "https://github.com/balechen/mr-dre/blob/main/dr_eval/checklist_eval.py"
click node_citation "https://github.com/balechen/mr-dre/blob/main/dr_eval/citation_eval.py"
click node_rubric "https://github.com/balechen/mr-dre/blob/main/dr_eval/rubric_eval.py"
click node_prompts "https://github.com/balechen/mr-dre/blob/main/dr_eval/eval_prompts.py"
click node_crawler "https://github.com/balechen/mr-dre/blob/main/dr_eval/crawler/jina.py"
click node_crawl_cache "https://github.com/balechen/mr-dre/blob/main/dr_eval/crawler/cache.py"
click node_api_cache "https://github.com/balechen/mr-dre/blob/main/engine/cache.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_runner,node_feedback,node_revision toneBlue
class node_reviser,node_tools,node_oai,node_perplexity toneAmber
class node_report_eval,node_checklist,node_citation,node_rubric,node_openai_api,node_perplexity_api,node_jina toneMint
class node_prompts,node_crawler,node_crawl_cache,node_api_cache toneRose
class node_researcher,node_vllm,node_serper toneIndigo
```

## Components

### Generation and Revision

- [Benchmark Datasets](https://github.com/balechen/mr-dre/tree/main/data): `data`
- [Generation Orchestrator](https://github.com/balechen/mr-dre/blob/main/call_dra.py): `call_dra.py`
- [Feedback Synthesis](https://github.com/balechen/mr-dre/blob/main/feedback.py): `feedback.py`
- [Turn Preparation](https://github.com/balechen/mr-dre/blob/main/call_dra.py): `call_dra.py`

### Research Engines

- [Revision Agent](https://github.com/balechen/mr-dre/blob/main/engine/reviser_agent/main.py): `engine/reviser_agent/main.py`
- [Web Search Tool](https://github.com/balechen/mr-dre/blob/main/engine/reviser_agent/tools.py): `engine/reviser_agent/tools.py`
- [OpenAI Research Agent](https://github.com/balechen/mr-dre/blob/main/engine/oai.py): `engine/oai.py`
- [Perplexity Research Agent](https://github.com/balechen/mr-dre/blob/main/engine/perplexity.py): `engine/perplexity.py`

### Report Evaluation

- [Evaluation Orchestrator](https://github.com/balechen/mr-dre/blob/main/evaluate_report.py): `evaluate_report.py`
- [Checklist Scoring](https://github.com/balechen/mr-dre/blob/main/dr_eval/checklist_eval.py): `dr_eval/checklist_eval.py`
- [Citation Scoring](https://github.com/balechen/mr-dre/blob/main/dr_eval/citation_eval.py): `dr_eval/citation_eval.py`
- [Rubric Scoring](https://github.com/balechen/mr-dre/blob/main/dr_eval/rubric_eval.py): `dr_eval/rubric_eval.py`

### Evaluation Support

- [Evaluation Prompts](https://github.com/balechen/mr-dre/blob/main/dr_eval/eval_prompts.py): `dr_eval/eval_prompts.py`
- [URL Crawler](https://github.com/balechen/mr-dre/blob/main/dr_eval/crawler/jina.py): `dr_eval/crawler/jina.py`
- [Crawler Cache](https://github.com/balechen/mr-dre/blob/main/dr_eval/crawler/cache.py): `dr_eval/crawler/cache.py`
- [API Cache](https://github.com/balechen/mr-dre/blob/main/engine/cache.py): `engine/cache.py`

### Other components

- **Researcher**
- **vLLM Service**
- **Serper Search**
- **OpenAI API**
- **Perplexity API**
- **Jina Reader API**

## Connections

- Researcher → Generation Orchestrator: requests report
- Benchmark Datasets → Generation Orchestrator: supplies questions
- Generation Orchestrator → OpenAI Research Agent: dispatches generation
- Generation Orchestrator → Perplexity Research Agent: dispatches generation
- Generation Orchestrator → Revision Agent: dispatches revision
- Revision Agent → vLLM Service: requests completion
- Revision Agent → Web Search Tool: executes tools
- Web Search Tool → Serper Search: searches web
- OpenAI Research Agent → OpenAI API: creates and polls
- Perplexity Research Agent → Perplexity API: submits and polls
- Generation Orchestrator → Feedback Synthesis: generates feedback
- Feedback Synthesis → Turn Preparation: provides feedback
- Turn Preparation → Generation Orchestrator: prepares next turn
- Generation Orchestrator → Evaluation Orchestrator: evaluates prior report
- Researcher → Evaluation Orchestrator: submits report
- Benchmark Datasets → Evaluation Orchestrator: supplies criteria
- Evaluation Orchestrator → Checklist Scoring: runs checklist mode
- Evaluation Orchestrator → Citation Scoring: runs citation mode
- Evaluation Orchestrator → Rubric Scoring: runs rubric mode
- Checklist Scoring → Evaluation Prompts: uses criteria prompts
- Citation Scoring → Evaluation Prompts: uses claim prompts
- Citation Scoring → URL Crawler: fetches cited URLs
- URL Crawler → Crawler Cache: reads and writes
- URL Crawler → Jina Reader API: fetches webpage
- OpenAI Research Agent → API Cache: caches API calls
