Perseus
Build with Gemini XPRIZE — Autonomous Code Review

5 Agents. One Pipeline. Zero Manual Review.

PR Pilot autonomously reviews pull requests using a 5-agent pipeline: Reviewer reviews, Fixer patches, Tester validates, Verifier gates, Escalator decides. Built for the Build with Gemini XPRIZE.

AGENT 1
Reviewer
Code Analysis
AGENT 2
Fixer
Patch Generation
AGENT 3
Tester
Test Writing
AGENT 4
Verifier
Quality Gate
AGENT 5
Escalator
Decision Maker
Pipeline Latency
~94s
Full 5-agent pipeline: Reviewer (14s) + Fixer (29s) + Tester (16s) + Verifier (17s) + Escalator (18s). Measured Jun 12.
Cost Per Review
~$0.04/pr
Gemini 2.5 Flash API pricing. Review scales linearly — 100 PRs for under $4. Real measurement from live runs.
Auto-Approve Rate
L1→L3
Graduated autonomy: comment on issues, request changes, or fully auto-approve clean PRs. Safety-gated.
Compliance
100%
Gemini API ✓, Google Cloud Run ✓, Stripe ✓. XPRIZE rules met with documentation to match.
§ 01

Pipeline Architecture

Each agent specializes in one phase of review. Context flows through the chain — the Fixer sees what the Reviewer found, the Verifier checks the Fixer's patches, and the Escalator makes the final call.

TRIGGER
Webhook
AGENT 1
Reviewer
AGENT 2
Fixer
AGENT 3
Tester
AGENT 4
Verifier
AGENT 5
Escalator

FastAPI webhook → AgentChain orchestration → Gemini API → GitHub comment/post

Scalable

Cloud Run Deploy

Deploy on Google Cloud Run with zero-downtime, auto-scaling, and request concurrency. One gcloud run deploy command.

Auditable

Full Audit Trail

Every agent's reasoning, every fix generated, every decision logged to data/reviews/. Structured JSON for compliance and transparency.

§ 02

Graduated Autonomy

PR Pilot doesn't just approve or reject. It operates at three graduated levels — each escalating only when confidence demands it. This is the safety gate that separates autonomous review from automated rubber-stamping.

L1

Comment

Issues found, fixes attached as review comments. The PR author sees what to change and why. No merge blocked. Low confidence findings.

Reviewer: "line 42: unsafe shell exec"
Fixer: "Use subprocess.run with list args"
Escalator: COMMENT
L2

Request Changes

Medium-confidence issues that should block merge until addressed. Fixes provided inline. PR blocked until author responds.

Reviewer: "missing input validation"
Fixer: "Add pydantic model for request body"
Verifier: "Patch compiles, needs tests"
Escalator: REQUEST_CHANGES
L3

Verified Auto-Approve

All agents agree: the PR is clean, fixes are verified, tests pass. PR Pilot auto-approves and merges. No human in the loop.

Reviewer: "No issues found"
Tester: "Coverage maintained at 87%"
Verifier: "All gates passed"
Escalator: VERIFIED_AUTO_APPROVE
§ 03

XPRIZE Compliance

Built for the Build with Gemini XPRIZE. Every requirement is met with documentation to match.

Requirement Implementation
Gemini API All 5 agents use Gemini 2.5 Flash via google-generativeai. Structured output support. Exponential retry.
Google Cloud Deploy Cloud Run (serverless), Cloud Build (CI/CD), Artifact Registry (containers). cloudbuild.yaml included.
Stripe Integration Stripe Checkout for premium features. Usage-based billing via Stripe Metered billing API. Webhook handling.
Code Quality Type hints throughout. Structured logging (structlog). 85%+ test coverage. Pre-commit hooks.
Open Source MIT licensed. Public repo with contribution guide, issue templates, and pull request template.
§ 04

Quickstart Setup

1. Deploy to Cloud Run
gcloud run deploy pr-pilot \
  --source . \
  --region us-central1 \
  --allow-unauthenticated \
  --set-env-vars \
    GEMINI_API_KEY=...,\
    GITHUB_APP_ID=...
2. Install GitHub App
# Visit the GitHub App install page:
# https://github.com/apps/pr-pilot

# Select repos, configure webhook:
# → https://pr-pilot-xxx-uc.a.run.app/webhook
3. Open a PR — PR Pilot reviews it
$ git checkout -b feat/new-feature
$ # ... make changes ...
$ git push && gh pr create

# Seconds later:
# @pr-pilot-bot commented: "Reviewed. 2 suggestions. 0 issues."
PR Pilot on GitHub →