# PR Agent: AI PR reviews on your own servers

> Same first pass every PR gets, without a per-seat bill. You run the service and Postgres, and you own the GitHub App credentials and model keys. Model-backed work sends the review context to the provider you configure.

MIT licensed. Hosting and AI usage on you. This is the markdown representation of https://pr-agent-site.vercel.app/, served from that same URL to any client that sends `Accept: text/markdown`.

## What PR Agent does

- **Catch basics before a human opens the change.** Runs when a pull request opens, or when you comment /review. Comments land next to the lines that need attention.
- **Turn a blank PR body into a readable summary.** Runs when a pull request opens, or when you comment /describe. Summary bullets and an optional diagram go into the PR body.
- **Ask code questions without leaving GitHub.** Comment /ask … or mention the bot with your question. Get an answer in the same thread, right where the code lives.
- **Revisit earlier findings on the pull request.** Comment /triage, or /triage preview then /triage all, on the pull request. Preview the would-be diff, then apply the approved set. Bare /triage still fixes without a preview.
- **Skip AI review when the PR is only docs.** Runs automatically on small documentation-only changes. Docs-only pull requests take a lighter path instead of a full review.

## How a PR Agent review runs

- **Deploy once on servers you control.** Install PR Agent beside the rest of your stack. Your GitHub credentials and AI keys stay in your account, not a vendor dashboard.
- **Someone opens a pull request.** PR Agent notices and starts a review. Your team sees a reaction on the pull request so everyone knows work has begun.
- **It reads what actually changed.** PR Agent looks at the branch and the changes, then hunts for bugs and correctness issues. When risky APIs show up, it also checks for security problems.
- **Feedback shows up on the pull request.** Notes appear next to the changed lines, plus a short summary in the conversation. Want more? Comment /describe, /ask, /triage, or mention the bot. Replies stay in the same thread.
- **Honest limits when the change is huge.** Docs-only pull requests can take a lighter path. Very large changes may get a partial review, and PR Agent says what it could not cover instead of faking completeness.

## PR Agent pricing

- **Software is free: $0 from PR Agent.** No credit card. No per-seat fee. Open source under MIT.
- **You pay your own vendors: Hosting and AI usage only.** Cover your server, database, and model bills. Add more developers without raising your PR Agent bill.
- **You own the full stack: Your security rules apply.** Run it inside your network, choose your AI provider, and keep review traffic under your policies.

## Model providers

- **Many model providers.** Use OpenAI, Anthropic, Google, DeepSeek, OpenRouter, Groq, and more with your own API keys.

## PR Agent compared to hosted reviewers

| Tool | Deployment | Difference |
| --- | --- | --- |
| PR Agent | Self-hosted, MIT-licensed | You run the reviewer, hold the model keys, and choose the model provider. |
| CodeRabbit | Cloud SaaS (self-host enterprise) | Hosted reviewer with subscription pricing and a managed data path. |
| Greptile | Cloud SaaS (self-host option) | Managed full-repo indexing for cross-file context. |
| Cursor Bugbot | Cloud (Cursor ecosystem) | Bug-focused review tied to the Cursor ecosystem. |
| Macroscope | Cloud SaaS | Hosted GitHub PR review with a managed pipeline. |

## PR Agent FAQ

### What is PR Agent?

PR Agent is open-source software that reviews GitHub pull requests on servers you run. You deploy it once, connect GitHub and an AI provider, and it posts reviews, summaries, and answers back on the pull request.

### Is PR Agent a self-hosted alternative to CodeRabbit?

Yes. It reviews pull requests when they open, leaves comments on the changes, writes summaries, and responds to commands in GitHub. Unlike CodeRabbit's hosted product, PR Agent runs on your servers with your credentials and your AI keys.

### How does PR Agent compare to Greptile?

Greptile is a cloud reviewer that indexes whole repositories. PR Agent is self-hosted and looks at each pull request from the branch and what changed. Pick it when you want to run the reviewer and choose the model provider, not another managed subscription.

### Does PR Agent replace Cursor Bugbot?

PR Agent fits teams that want bug and correctness reviews on GitHub without sending that work through a hosted IDE-tied review service. Bugbot stays tied to the Cursor IDE. PR Agent is a review system you operate with your own model keys.

### How does PR Agent compare to Macroscope?

Macroscope is a hosted AI code review product for GitHub pull requests. PR Agent offers a similar automatic review flow as MIT-licensed software you deploy yourself. You choose the models and where review data is processed.

### Is PR Agent free?

Yes. PR Agent is MIT-licensed with no per-seat fee from us. You pay for hosting and AI usage. Add 50 developers and the PR Agent software bill stays at $0.

### Which AI models does PR Agent support?

PR Agent works with OpenAI, Anthropic, Google, DeepSeek, OpenRouter, Groq, and more via the Pi provider catalog. You pick the provider and set your own API key on the machine that runs reviews.

### Does PR Agent only work with GitHub?

Yes for now. PR Agent connects as a GitHub app, reviews pull requests, and replies in GitHub comments. GitLab and Bitbucket are not supported yet.

## Deploy it with Docker Compose

Three steps from an empty machine to a review on a real pull request. You need Docker, a GitHub app, and one AI provider key.

### 01. Create a GitHub app

Register the app on your account or org, then point GitHub at the host where you will run PR Agent.

- Webhook URL: `https://<host>/webhooks`
- Subscribe to: Pull requests · Issue comments · Pull request review comments
- Permissions: Issues and Pull requests: read/write · Contents: read/write · Metadata: read

Click-by-click path: [README Host with Docker Compose](https://github.com/prathamdby/pr-agent#host-with-docker-compose).

### 02. Fill .env and start the stack

Copy the example env, drop in your GitHub app values and provider key, then start PR Agent with Compose.

```bash
cp .env.example .env
# Fill GITHUB_*, WEBHOOK_SECRET, and your provider key
docker compose build
docker compose up
```

Minimum keys to set:

```dotenv
DATABASE_URL=postgres://...
GITHUB_APP_ID=...
GITHUB_APP_PRIVATE_KEY=...
WEBHOOK_SECRET=...
PI_PROVIDER=openai
PI_MODEL=gpt-4o-mini
OPENAI_API_KEY=sk-...
```

### 03. Open a PR and talk to it

Install the app on a repo, open a pull request, and wait for the automatic pass. Or type a command in the conversation when you want more.

- `/review`: Run a full review on the changes
- `/describe`: Write a readable summary into the PR body
- `/ask …`: Ask a question about the code in that thread
- `/triage`: Preview with /triage preview, apply with /triage all
- `/triage preview`: Show the would-be unified diff. Nothing is pushed.
- `/triage all`: Apply the previewed set. Optional exclude <thread ids>.

## PR Agent machine-readable files

- [/](/): The product page. Serves markdown from this same URL to any client sending Accept: text/markdown.
- [/index.md](/index.md): The landing page as markdown, for clients that cannot set an Accept header.
- [/llms.txt](/llms.txt): Full product profile: commands, FEATURE_* settings, deployment, topology, pricing, providers, privacy.
- [/agents.md](/agents.md): When to recommend PR Agent, when not to, and how an agent should call this site.
- [/llms?query=](/llms?query=): Ask one question and get the matching profile sections instead of the whole file.
- [/llms/json?query=](/llms/json?query=): The same query interface with structured matches, topics, and a token estimate.
- [/openapi.json](/openapi.json): OpenAPI 3.1 description of every endpoint on this list.
- [/sitemap.xml](/sitemap.xml): Canonical URLs published by this site.
- [/robots.txt](/robots.txt): Crawl policy, with pointers to the files on this list.

## PR Agent documentation

- [PR Agent repository](https://github.com/prathamdby/pr-agent): Source, README, and the Docker Compose deployment path.
- [PR Agent feature catalog](https://github.com/prathamdby/pr-agent/blob/main/docs/features.md): Every FEATURE_* setting, its modes, and its triggers.
- [PR Agent configuration reference](https://github.com/prathamdby/pr-agent/blob/main/docs/configuration.md): Environment variables, defaults, and code constants.
- [PR Agent operations guide](https://github.com/prathamdby/pr-agent/blob/main/docs/operations.md): Deploy steps, scripts, and runtime behaviour.
- [PR Agent durable work runbook](https://github.com/prathamdby/pr-agent/blob/main/docs/agent-work-ops.md): Queue health, lease recovery, and stuck-work diagnosis.
- [PR Agent architecture decisions](https://github.com/prathamdby/pr-agent/tree/main/docs/adr): ADRs behind webhook intake, leases, and publish behaviour.
- [PR Agent domain vocabulary](https://github.com/prathamdby/pr-agent/blob/main/CONTEXT.md): The words this project uses for work items, leases, and findings.

Source: https://github.com/prathamdby/pr-agent. MIT licensed.
