# iamdineshreddy/adaptive-multi-agent-pr-review architecture

> Architecture diagram of the GitHub repository iamdineshreddy/adaptive-multi-agent-pr-review, 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/iamdineshreddy/adaptive-multi-agent-pr-review
- Repository: https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review

## Overview

This is an asynchronous GitHub pull-request review system whose central contribution is selecting useful findings, not merely detecting possible issues. The main workflow runs from verified webhook ingestion through priority scheduling, multi-agent analysis, finding consolidation, and ARUM selection; developer feedback informs repository memory and later reviews. The graph preserves the dashboard and experiment harness as separate product capabilities. Some links rely on README architecture statements because the corresponding implementation files were not sampled.

Main entry points: [`backend/app/orchestrator/service.py`](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/orchestrator/service.py) (Review orchestrator), [`backend/app/orchestrator/persistence.py`](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/orchestrator/persistence.py) (Review persistence), [`backend/app/adaptive`](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/tree/main/backend/app/adaptive) (ARUM selection), [`backend/app/experiments/runner.py`](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/experiments/runner.py) (Experiment runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Webhook and queue"]
  node_webhook["Webhook handling<br/>[router.py]"]
  node_ingest["PR ingestion<br/>[ingest.py]"]
  node_queue["Priority queue<br/>[tasks.py]"]
  node_db[("Review store<br/>[__init__.py]")]
end

subgraph group_review["Review execution"]
  node_orchestrator["Review orchestrator<br/>[service.py]"]
  node_agents["Review agents"]
  node_github_api["GitHub client<br/>[client.py]"]
  node_consolidation["Finding consolidation"]
  node_iteration["Iterative review<br/>[iteration.py]"]
  node_persistence[("Review persistence<br/>[persistence.py]")]
end

subgraph group_learning["Selection and learning"]
  node_arum["ARUM selection"]
  node_features["Scoring features<br/>[features.py]"]
  node_memory[("Repository memory<br/>[memory.py]")]
  node_weights["Learned weights<br/>[weights.py]"]
  node_rag["Historical RAG<br/>[rag.py]"]
  node_feedback["Developer feedback<br/>[feedback.py]"]
end

subgraph group_interface["Product interface"]
  node_dashboard["Review dashboard<br/>[App.tsx]"]
  node_api_client["Dashboard API client<br/>[api.ts]"]
  node_api_routes["Backend API routes<br/>[router.py]"]
  node_dashboard_data["Dashboard data<br/>[dashboard.py]"]
  node_metrics["Observability<br/>[prometheus.py]"]
end

subgraph group_research["Experiment harness"]
  node_experiment_data["Experiment corpus<br/>[corpus.py]"]
  node_experiment_modes["Experiment modes<br/>[modes.py]"]
  node_experiment_runner["Experiment runner<br/>[runner.py]"]
end

node_github(("GitHub PR"))

node_github -->|"sends events"| node_webhook
node_webhook -->|"validates and ingests"| node_ingest
node_ingest -->|"persists review"| node_db
node_webhook -->|"dispatches review"| node_queue
node_queue -->|"dispatches review"| node_orchestrator
node_orchestrator -->|"runs agents"| node_agents
node_orchestrator -->|"consolidates findings"| node_consolidation
node_orchestrator -->|"scores candidates"| node_arum
node_arum -->|"extracts features"| node_features
node_arum -->|"loads weights"| node_weights
node_orchestrator -->|"refreshes memory"| node_memory
node_orchestrator -->|"retrieves context"| node_rag
node_orchestrator -->|"records outcomes"| node_persistence
node_orchestrator -->|"plans re-review"| node_iteration
node_orchestrator -.->|"fetches PR context"| node_github_api
node_feedback -.->|"records feedback"| node_persistence
node_persistence -->|"stores review memory"| node_memory
node_dashboard -->|"loads views"| node_api_client
node_api_client -.->|"requests data"| node_api_routes
node_api_routes -->|"routes dashboard requests"| node_dashboard_data
node_dashboard_data -->|"reads review data"| node_persistence
node_metrics -.->|"exports review metrics"| node_persistence
node_experiment_data -.->|"supplies corpus"| node_experiment_modes
node_experiment_runner -->|"loads corpus"| node_experiment_data
node_experiment_runner -->|"runs modes"| node_experiment_modes
node_experiment_runner -->|"evaluates selection"| node_arum

click node_webhook "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/webhooks/router.py"
click node_ingest "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/webhooks/ingest.py"
click node_queue "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/queue/tasks.py"
click node_db "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/database/__init__.py"
click node_orchestrator "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/orchestrator/service.py"
click node_agents "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/tree/main/backend/app/agents"
click node_github_api "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/github/client.py"
click node_consolidation "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/tree/main/backend/app/consolidation"
click node_iteration "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/orchestrator/iteration.py"
click node_persistence "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/orchestrator/persistence.py"
click node_arum "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/tree/main/backend/app/adaptive"
click node_features "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/adaptive/features.py"
click node_memory "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/adaptive/memory.py"
click node_weights "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/adaptive/weights.py"
click node_rag "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/adaptive/rag.py"
click node_feedback "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/api/feedback.py"
click node_dashboard "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/frontend/src/App.tsx"
click node_api_client "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/frontend/src/services/api.ts"
click node_api_routes "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/api/router.py"
click node_dashboard_data "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/api/dashboard.py"
click node_metrics "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/monitoring/prometheus.py"
click node_experiment_data "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/experiments/corpus.py"
click node_experiment_modes "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/experiments/modes.py"
click node_experiment_runner "https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/experiments/runner.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_webhook,node_ingest,node_queue,node_db toneBlue
class node_orchestrator,node_agents,node_github_api,node_consolidation,node_iteration,node_persistence toneAmber
class node_arum,node_features,node_memory,node_weights,node_rag,node_feedback toneMint
class node_dashboard,node_api_client,node_api_routes,node_dashboard_data,node_metrics toneRose
class node_experiment_data,node_experiment_modes,node_experiment_runner,node_github toneIndigo
```

## Components

### Webhook and queue

- [Webhook handling](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/webhooks/router.py): `backend/app/webhooks/router.py`
- [PR ingestion](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/webhooks/ingest.py): `backend/app/webhooks/ingest.py`
- [Priority queue](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/queue/tasks.py): `backend/app/queue/tasks.py`
- [Review store](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/database/__init__.py): `backend/app/database/__init__.py`

### Review execution

- [Review orchestrator](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/orchestrator/service.py): `backend/app/orchestrator/service.py`
- [Review agents](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/tree/main/backend/app/agents): `backend/app/agents`
- [GitHub client](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/github/client.py): `backend/app/github/client.py`
- [Finding consolidation](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/tree/main/backend/app/consolidation): `backend/app/consolidation`
- [Iterative review](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/orchestrator/iteration.py): `backend/app/orchestrator/iteration.py`
- [Review persistence](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/orchestrator/persistence.py): `backend/app/orchestrator/persistence.py`

### Selection and learning

- [ARUM selection](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/tree/main/backend/app/adaptive): `backend/app/adaptive`
- [Scoring features](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/adaptive/features.py): `backend/app/adaptive/features.py`
- [Repository memory](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/adaptive/memory.py): `backend/app/adaptive/memory.py`
- [Learned weights](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/adaptive/weights.py): `backend/app/adaptive/weights.py`
- [Historical RAG](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/adaptive/rag.py): `backend/app/adaptive/rag.py`
- [Developer feedback](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/api/feedback.py): `backend/app/api/feedback.py`

### Product interface

- [Review dashboard](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Dashboard API client](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`
- [Backend API routes](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/api/router.py): `backend/app/api/router.py`
- [Dashboard data](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/api/dashboard.py): `backend/app/api/dashboard.py`
- [Observability](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/monitoring/prometheus.py): `backend/app/monitoring/prometheus.py`

### Experiment harness

- [Experiment corpus](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/experiments/corpus.py): `backend/app/experiments/corpus.py`
- [Experiment modes](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/experiments/modes.py): `backend/app/experiments/modes.py`
- [Experiment runner](https://github.com/iamdineshreddy/adaptive-multi-agent-pr-review/blob/main/backend/app/experiments/runner.py): `backend/app/experiments/runner.py`

### Other components

- **GitHub PR**

## Connections

- GitHub PR → Webhook handling: sends events
- Webhook handling → PR ingestion: validates and ingests (evidence: `backend/app/webhooks/router.py`)
- PR ingestion → Review store: persists review (evidence: `backend/app/webhooks/ingest.py`)
- Webhook handling → Priority queue: dispatches review (evidence: `backend/app/webhooks/router.py`)
- Priority queue → Review orchestrator: dispatches review (evidence: `backend/app/queue/tasks.py`)
- Review orchestrator → Review agents: runs agents (evidence: `backend/app/orchestrator/service.py`)
- Review orchestrator → Finding consolidation: consolidates findings (evidence: `backend/app/orchestrator/service.py`)
- Review orchestrator → ARUM selection: scores candidates (evidence: `backend/app/orchestrator/service.py`)
- ARUM selection → Scoring features: extracts features (evidence: `backend/app/orchestrator/service.py`)
- ARUM selection → Learned weights: loads weights (evidence: `backend/app/orchestrator/service.py`)
- Review orchestrator → Repository memory: refreshes memory (evidence: `backend/app/orchestrator/service.py`)
- Review orchestrator → Historical RAG: retrieves context (evidence: `backend/app/orchestrator/service.py`)
- Review orchestrator → Review persistence: records outcomes (evidence: `backend/app/orchestrator/service.py`)
- Review orchestrator → Iterative review: plans re-review (evidence: `backend/app/orchestrator/service.py`)
- Review orchestrator → GitHub client: fetches PR context
- Developer feedback → Review persistence: records feedback
- Review persistence → Repository memory: stores review memory (evidence: `backend/app/orchestrator/persistence.py`)
- Review dashboard → Dashboard API client: loads views (evidence: `frontend/src/App.tsx`)
- Dashboard API client → Backend API routes: requests data (evidence: `frontend/src/services/api.ts`)
- Backend API routes → Dashboard data: routes dashboard requests (evidence: `backend/app/api/router.py`)
- Dashboard data → Review persistence: reads review data (evidence: `backend/app/api/dashboard.py`)
- Observability → Review persistence: exports review metrics (evidence: `backend/app/monitoring/worker_exporter.py`)
- Experiment corpus → Experiment modes: supplies corpus (evidence: `backend/app/experiments/runner.py`)
- Experiment runner → Experiment corpus: loads corpus (evidence: `backend/app/experiments/runner.py`)
- Experiment runner → Experiment modes: runs modes (evidence: `backend/app/experiments/runner.py`)
- Experiment runner → ARUM selection: evaluates selection (evidence: `backend/app/experiments/runner.py`)
