This PR Review Agent automates the process of reviewing GitHub pull requests using agentic workflows and LLMs. It integrates with GitHub via Composio, analyzes code changes for security, scalability, and logic, and posts human-like review comments directly to PRs. Demo video - https://www.youtube.com/watch?v=Z9NItNAfl00
- Webhook Integration: Listens for GitHub PR events and triggers automated review workflows.
- Agentic Analysis: Uses LangGraph to orchestrate multiple agents for security, scalability, and logic analysis.
- LLM-Powered Comments: Generates meaningful, context-aware review comments using advanced language models.
- Automated Review Posting: Posts and submits review comments to GitHub PRs using Composio toolkit.
- Trigger Management: Easily set up PR event triggers for any repository.
- Authentication Flow: Supports OAuth authentication for secure GitHub access.
- Authentication: Authenticate your GitHub account via the
/auth-urlroute. - Trigger Setup: Use
/create-triggerto set up PR event triggers for your repo. - Webhook Handling: The
/webhookroute receives PR events, extracts patch data, and runs agentic analysis. - Review Generation: Agents analyze the patch for security, scalability, and logic, then generate a summary comment.
- Review Submission: The agent posts and submits the review comment to the PR, making it visible to contributors.
GET /auth-url— Get the authentication URL for GitHub OAuth.POST /create-trigger— Set up a PR event trigger for your repository.POST /webhook— Handle incoming PR events and automate review.GET /health— Health check endpoint.
- FastAPI — API server and routing
- LangGraph — Agentic workflow orchestration
- Composio — GitHub API integration
- Pydantic — Data validation
- Python — Core language
- Clone the repository and install dependencies:
git clone <repo-url> cd <project-folder> pip install -r requirements.txt
- Start the FastAPI server:
uvicorn main:app --reload
- Authenticate your GitHub account via
/auth-url. - Set up a trigger for your repo using
/create-trigger. - Configure your GitHub webhook to point to
/webhook.
- Developer opens a PR in the repo.
- GitHub sends a webhook event to
/webhook. - The agent analyzes the patch and posts a review comment.
- The review is submitted and visible on the PR page.
MIT