# abhiram0411/review-desk architecture

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

- Interactive diagram: https://gitdiagram.com/abhiram0411/review-desk
- Repository: https://github.com/abhiram0411/review-desk

## Overview

The Review Desk accepts a diff or public GitHub PR, generates inline review comments using team memory, and records Accept/Reject feedback to shape later reviews. Its live API also serves learned conventions, decision history, demo PRs, and replay metrics to the frontend. A separate replay evaluates memory-on versus memory-off behavior against saved Flask PRs. Relationships involving the frontend and unsampled API details are based on README documentation; the graph does not infer unshown internal calls.

Main entry points: [`main.py`](https://github.com/abhiram0411/review-desk/blob/main/main.py) (FastAPI API), [`replay_real.py`](https://github.com/abhiram0411/review-desk/blob/main/replay_real.py) (Replay Engine), [`frontend/index.html`](https://github.com/abhiram0411/review-desk/blob/main/frontend/index.html) (Web UI), [`data/prs`](https://github.com/abhiram0411/review-desk/tree/main/data/prs) (Saved PRs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Live Review App"]
  node_frontend["Web UI<br/>[index.html]"]
  node_api["FastAPI API<br/>[main.py]"]
  node_review_flow["Review Flow<br/>[main.py]"]
  node_comment_state["Comment State<br/>[main.py]"]
  node_github_fetch["GitHub PR Fetch<br/>[main.py]"]
end

subgraph group_memory["Team Memory"]
  node_hindsight[("Hindsight Memory")]
  node_feedback["Feedback Retention<br/>[main.py]"]
  node_category_rules["Category Rules<br/>[main.py]"]
  node_decision_history[("Decision History<br/>[main.py]")]
  node_conventions["Conventions<br/>[main.py]"]
end

subgraph group_replay["Replay Evaluation"]
  node_replay_engine["Replay Engine<br/>[replay_real.py]"]
  node_replay_reviewer["Replay Reviewer<br/>[replay_real.py]"]
  node_replay_memory["Replay Memory<br/>[replay_real.py]"]
  node_replay_metrics["Replay Metrics<br/>[replay_real.py]"]
end

subgraph group_assets["Review Data"]
  node_pr_catalog["Saved PRs"]
  node_metrics_file["Metrics File<br/>[metrics.json]"]
end

node_reviewer(("Reviewer"))
node_groq{{"Groq Model"}}
node_github{{"GitHub API"}}

node_reviewer -->|"uses"| node_frontend
node_frontend -->|"calls API"| node_api
node_api -->|"routes review"| node_review_flow
node_review_flow -->|"recalls notes"| node_hindsight
node_review_flow -->|"applies rules"| node_category_rules
node_review_flow -->|"generates comments"| node_groq
node_review_flow -->|"stores comments"| node_comment_state
node_frontend -->|"submits PR link"| node_github_fetch
node_github_fetch -->|"fetches PR"| node_github
node_api -->|"routes feedback"| node_feedback
node_feedback -->|"retains decision"| node_hindsight
node_feedback -->|"records decision"| node_decision_history
node_category_rules -->|"reads decisions"| node_decision_history
node_api -->|"serves rules"| node_conventions
node_api -->|"serves history"| node_decision_history
node_api -->|"loads demo PRs"| node_pr_catalog
node_api -->|"reads metrics"| node_metrics_file
node_replay_engine -->|"loads PRs"| node_pr_catalog
node_replay_engine -->|"runs reviews"| node_replay_reviewer
node_replay_reviewer -->|"generates comments"| node_groq
node_replay_engine -->|"recalls and retains"| node_replay_memory
node_replay_memory -->|"uses memory"| node_hindsight
node_replay_engine -->|"summarizes results"| node_replay_metrics
node_replay_metrics -->|"writes results"| node_metrics_file

click node_frontend "https://github.com/abhiram0411/review-desk/blob/main/frontend/index.html"
click node_api "https://github.com/abhiram0411/review-desk/blob/main/main.py"
click node_review_flow "https://github.com/abhiram0411/review-desk/blob/main/main.py"
click node_comment_state "https://github.com/abhiram0411/review-desk/blob/main/main.py"
click node_github_fetch "https://github.com/abhiram0411/review-desk/blob/main/main.py"
click node_feedback "https://github.com/abhiram0411/review-desk/blob/main/main.py"
click node_category_rules "https://github.com/abhiram0411/review-desk/blob/main/main.py"
click node_decision_history "https://github.com/abhiram0411/review-desk/blob/main/main.py"
click node_conventions "https://github.com/abhiram0411/review-desk/blob/main/main.py"
click node_replay_engine "https://github.com/abhiram0411/review-desk/blob/main/replay_real.py"
click node_replay_reviewer "https://github.com/abhiram0411/review-desk/blob/main/replay_real.py"
click node_replay_memory "https://github.com/abhiram0411/review-desk/blob/main/replay_real.py"
click node_replay_metrics "https://github.com/abhiram0411/review-desk/blob/main/replay_real.py"
click node_pr_catalog "https://github.com/abhiram0411/review-desk/tree/main/data/prs"
click node_metrics_file "https://github.com/abhiram0411/review-desk/blob/main/data/metrics.json"

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_frontend,node_api,node_review_flow,node_comment_state,node_github_fetch,node_reviewer toneBlue
class node_hindsight,node_feedback,node_category_rules,node_decision_history,node_conventions toneAmber
class node_replay_engine,node_replay_reviewer,node_replay_memory,node_replay_metrics,node_github toneMint
class node_pr_catalog,node_metrics_file toneRose
class node_groq toneIndigo
```

## Components

### Live Review App

- [Web UI](https://github.com/abhiram0411/review-desk/blob/main/frontend/index.html): `frontend/index.html`
- [FastAPI API](https://github.com/abhiram0411/review-desk/blob/main/main.py): `main.py`
- [Review Flow](https://github.com/abhiram0411/review-desk/blob/main/main.py): `main.py`
- [Comment State](https://github.com/abhiram0411/review-desk/blob/main/main.py): `main.py`
- [GitHub PR Fetch](https://github.com/abhiram0411/review-desk/blob/main/main.py): `main.py`

### Team Memory

- **Hindsight Memory**
- [Feedback Retention](https://github.com/abhiram0411/review-desk/blob/main/main.py): `main.py`
- [Category Rules](https://github.com/abhiram0411/review-desk/blob/main/main.py): `main.py`
- [Decision History](https://github.com/abhiram0411/review-desk/blob/main/main.py): `main.py`
- [Conventions](https://github.com/abhiram0411/review-desk/blob/main/main.py): `main.py`

### Replay Evaluation

- [Replay Engine](https://github.com/abhiram0411/review-desk/blob/main/replay_real.py): `replay_real.py`
- [Replay Reviewer](https://github.com/abhiram0411/review-desk/blob/main/replay_real.py): `replay_real.py`
- [Replay Memory](https://github.com/abhiram0411/review-desk/blob/main/replay_real.py): `replay_real.py`
- [Replay Metrics](https://github.com/abhiram0411/review-desk/blob/main/replay_real.py): `replay_real.py`

### Review Data

- [Saved PRs](https://github.com/abhiram0411/review-desk/tree/main/data/prs): `data/prs`
- [Metrics File](https://github.com/abhiram0411/review-desk/blob/main/data/metrics.json): `data/metrics.json`

### Other components

- **Reviewer**
- **Groq Model**
- **GitHub API**

## Connections

- Reviewer → Web UI: uses (evidence: `README.md`)
- Web UI → FastAPI API: calls API (evidence: `README.md`)
- FastAPI API → Review Flow: routes review (evidence: `main.py`)
- Review Flow → Hindsight Memory: recalls notes (evidence: `main.py`)
- Review Flow → Category Rules: applies rules (evidence: `main.py`)
- Review Flow → Groq Model: generates comments (evidence: `README.md`)
- Review Flow → Comment State: stores comments (evidence: `main.py`)
- Web UI → GitHub PR Fetch: submits PR link (evidence: `README.md`)
- GitHub PR Fetch → GitHub API: fetches PR (evidence: `main.py`)
- FastAPI API → Feedback Retention: routes feedback (evidence: `main.py`)
- Feedback Retention → Hindsight Memory: retains decision (evidence: `README.md`)
- Feedback Retention → Decision History: records decision (evidence: `main.py`)
- Category Rules → Decision History: reads decisions (evidence: `main.py`)
- FastAPI API → Conventions: serves rules (evidence: `main.py`)
- FastAPI API → Decision History: serves history (evidence: `main.py`)
- FastAPI API → Saved PRs: loads demo PRs (evidence: `main.py`)
- FastAPI API → Metrics File: reads metrics (evidence: `main.py`)
- Replay Engine → Saved PRs: loads PRs (evidence: `replay_real.py`)
- Replay Engine → Replay Reviewer: runs reviews (evidence: `replay_real.py`)
- Replay Reviewer → Groq Model: generates comments (evidence: `replay_real.py`)
- Replay Engine → Replay Memory: recalls and retains (evidence: `replay_real.py`)
- Replay Memory → Hindsight Memory: uses memory (evidence: `replay_real.py`)
- Replay Engine → Replay Metrics: summarizes results (evidence: `replay_real.py`)
- Replay Metrics → Metrics File: writes results (evidence: `replay_real.py`)
