Welcome to the GSR project repository! This project implements an advanced multi-agent code review system powered by Gemini.
Instead of relying on a single prompt to review code, GSR uses a swarm of specialized subagents to analyze pull requests from different perspectives. This approach yields higher quality, more focused findings.
- Architecture Agent: Focuses on system design, separation of concerns, and adherence to design patterns.
- Logic Agent: Looks for bugs, edge cases, and correctness issues in the code.
- Security Agent: Identifies potential security vulnerabilities (e.g., DoS, injection risks).
- TechDebt Agent: Flags anti-patterns, legacy code usage (e.g.,
indexOfvsincludes), and maintainability issues. - Testing Agent: Ensures adequate test coverage and identifies missing tests for new logic.
- Orchestrator: Splits the incoming PR diff into chunks and distributes them to the subagents in parallel.
- Deduplicator: After all subagents report their findings, a dedicated
DeduplicatorAgent(running ongemini-3.1-pro-previewwith a sequential lock) merges duplicate findings and selects the most actionable suggestions, reducing noise for the developer.
To ensure our agent prompts are effective and not regressing, we use a custom Evaluation Harness located in tools/eval.
- Ablation Testing: The harness can run reviews with specific agents disabled to measure their impact.
- Comparison (Local vs Production): It runs reviews against both the local development server and the deployed production server simultaneously.
- Auto-Evaluation: An independent Gemini instance reviews the findings from both targets and generates a detailed comparison report on accuracy, actionability, and noise.
- Persistence: Results are automatically archived and uploaded to an S3-compatible object storage bucket (Cloudflare R2 in production).
adk/: The core application.backend/: Node.js Express server that handles GitHub API interaction and orchestrates Gemini agents.frontend/: Vanilla JS interface to request reviews and view streaming progress.prompts/: Contains the system prompts for all agents (includingsystem_prompts_v2).
tools/eval/: The evaluation harness used to benchmark performance.
Please see the ADK README for detailed instructions on setting up the environment and running the servers locally.
GSR can also run as a GitHub Action on your own pull requests — see
ACTION.md for setup and configuration (choose between
subagent and basic review modes).