# vaishnavthorwat/autonomous-pr-review-agent architecture

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

- Interactive diagram: https://gitdiagram.com/vaishnavthorwat/autonomous-pr-review-agent
- Repository: https://github.com/vaishnavthorwat/autonomous-pr-review-agent

## Overview

The product reviews submitted code changes through parallel quality and security analyses, then produces a tech-lead decision. Users can start the workflow through the Streamlit interface or CLI. The README documents the three-stage review and OWASP research; source excerpts show both entry points assembling CrewAI agents and tasks. The sampled code does not expose every runtime detail, so the graph omits unverified call relationships.

Main entry points: [`app.py`](https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/app.py) (UI review run), [`main.py`](https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/main.py) (CLI review run), [`tasks.py`](https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/tasks.py) (Review decision), [`tools.py`](https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/tools.py) (OWASP search tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry points"]
  node_streamlit_ui["Streamlit UI<br/>[app.py]"]
  node_cli["CLI<br/>[main.py]"]
  node_ui_pipeline["UI review run<br/>[app.py]"]
  node_cli_pipeline["CLI review run<br/>[main.py]"]
end

subgraph group_review["Review workflow"]
  node_quality_task["Quality analysis<br/>[tasks.py]"]
  node_security_task["Security review<br/>[tasks.py]"]
  node_decision_task["Review decision<br/>[tasks.py]"]
  node_senior["Senior developer<br/>[agents.py]"]
  node_security["Security engineer<br/>[agents.py]"]
  node_tech_lead["Tech lead<br/>[agents.py]"]
  node_review_report["Review outputs"]
end

subgraph group_integrations["External services"]
  node_owasp_tools["OWASP search tools<br/>[tools.py]"]
  node_search_service["Serper search"]
  node_web_sources["OWASP web sources"]
  node_gemini["Gemini LLM"]
end

node_developer(("Developer"))
node_change_file["Code changes"]

node_developer -->|"submits changes"| node_streamlit_ui
node_developer -->|"starts review"| node_cli
node_change_file -->|"loads changes"| node_cli
node_streamlit_ui -->|"starts review"| node_ui_pipeline
node_cli -->|"builds and runs"| node_cli_pipeline
node_ui_pipeline -->|"creates tools"| node_owasp_tools
node_ui_pipeline -->|"creates agent"| node_senior
node_ui_pipeline -->|"creates agent"| node_security
node_ui_pipeline -->|"creates agent"| node_tech_lead
node_ui_pipeline -->|"creates task"| node_quality_task
node_ui_pipeline -->|"creates task"| node_security_task
node_ui_pipeline -->|"creates task"| node_decision_task
node_cli_pipeline -->|"creates tools"| node_owasp_tools
node_cli_pipeline -->|"creates agent"| node_senior
node_cli_pipeline -->|"creates agent"| node_security
node_cli_pipeline -->|"creates agent"| node_tech_lead
node_cli_pipeline -->|"creates task"| node_quality_task
node_cli_pipeline -->|"creates task"| node_security_task
node_cli_pipeline -->|"creates task"| node_decision_task
node_quality_task -->|"assigned to"| node_senior
node_security_task -->|"assigned to"| node_security
node_decision_task -->|"assigned to"| node_tech_lead
node_decision_task -->|"uses context"| node_quality_task
node_decision_task -->|"uses context"| node_security_task
node_security -->|"uses tools"| node_owasp_tools
node_owasp_tools -.->|"searches guidance"| node_search_service
node_owasp_tools -.->|"scrapes guidance"| node_web_sources
node_ui_pipeline -->|"configures model"| node_gemini
node_cli_pipeline -->|"configures model"| node_gemini
node_ui_pipeline -->|"renders results"| node_review_report
node_cli_pipeline -->|"prints and saves"| node_review_report

click node_streamlit_ui "https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/app.py"
click node_cli "https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/main.py"
click node_ui_pipeline "https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/app.py"
click node_cli_pipeline "https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/main.py"
click node_quality_task "https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/tasks.py"
click node_security_task "https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/tasks.py"
click node_decision_task "https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/tasks.py"
click node_senior "https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/agents.py"
click node_security "https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/agents.py"
click node_tech_lead "https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/agents.py"
click node_owasp_tools "https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/tools.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_streamlit_ui,node_cli,node_ui_pipeline,node_cli_pipeline toneBlue
class node_quality_task,node_security_task,node_decision_task,node_senior,node_security,node_tech_lead,node_review_report toneAmber
class node_owasp_tools,node_search_service,node_web_sources,node_gemini toneMint
class node_developer,node_change_file toneIndigo
```

## Components

### Entry points

- [Streamlit UI](https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/app.py): `app.py`
- [CLI](https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/main.py): `main.py`
- [UI review run](https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/app.py): `app.py`
- [CLI review run](https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/main.py): `main.py`

### Review workflow

- [Quality analysis](https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/tasks.py): `tasks.py`
- [Security review](https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/tasks.py): `tasks.py`
- [Review decision](https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/tasks.py): `tasks.py`
- [Senior developer](https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/agents.py): `agents.py`
- [Security engineer](https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/agents.py): `agents.py`
- [Tech lead](https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/agents.py): `agents.py`
- **Review outputs**

### External services

- [OWASP search tools](https://github.com/vaishnavthorwat/autonomous-pr-review-agent/blob/main/tools.py): `tools.py`
- **Serper search**
- **OWASP web sources**
- **Gemini LLM**

### Other components

- **Developer**
- **Code changes**

## Connections

- Developer → Streamlit UI: submits changes (evidence: `README.md`)
- Developer → CLI: starts review (evidence: `README.md`)
- Code changes → CLI: loads changes (evidence: `main.py`)
- Streamlit UI → UI review run: starts review (evidence: `app.py`)
- CLI → CLI review run: builds and runs (evidence: `main.py`)
- UI review run → OWASP search tools: creates tools (evidence: `app.py`)
- UI review run → Senior developer: creates agent (evidence: `app.py`)
- UI review run → Security engineer: creates agent (evidence: `app.py`)
- UI review run → Tech lead: creates agent (evidence: `app.py`)
- UI review run → Quality analysis: creates task (evidence: `app.py`)
- UI review run → Security review: creates task (evidence: `app.py`)
- UI review run → Review decision: creates task (evidence: `app.py`)
- CLI review run → OWASP search tools: creates tools (evidence: `main.py`)
- CLI review run → Senior developer: creates agent (evidence: `main.py`)
- CLI review run → Security engineer: creates agent (evidence: `main.py`)
- CLI review run → Tech lead: creates agent (evidence: `main.py`)
- CLI review run → Quality analysis: creates task (evidence: `main.py`)
- CLI review run → Security review: creates task (evidence: `main.py`)
- CLI review run → Review decision: creates task (evidence: `main.py`)
- Quality analysis → Senior developer: assigned to (evidence: `tasks.py`)
- Security review → Security engineer: assigned to (evidence: `tasks.py`)
- Review decision → Tech lead: assigned to (evidence: `tasks.py`)
- Review decision → Quality analysis: uses context (evidence: `tasks.py`)
- Review decision → Security review: uses context (evidence: `tasks.py`)
- Security engineer → OWASP search tools: uses tools (evidence: `agents.py`)
- OWASP search tools → Serper search: searches guidance
- OWASP search tools → OWASP web sources: scrapes guidance
- UI review run → Gemini LLM: configures model (evidence: `app.py`)
- CLI review run → Gemini LLM: configures model (evidence: `main.py`)
- UI review run → Review outputs: renders results (evidence: `app.py`)
- CLI review run → Review outputs: prints and saves (evidence: `main.py`)
