Skip to content

Sentinel-PR/Sentinel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sentinel: The AI Pull Request Reviewer

This link shows a comment made to a PR by our bot: Sentinel-PR/sentinel-sandbox#4 (review)

🤖 An AI-powered GitHub PR review bot using LangGraph multi-agent workflows

Sentinel automatically reviews GitHub pull requests by analyzing code changes and posting structured feedback. It behaves like a senior reviewer, focusing on correctness, security, and maintainability.

🏗️ Architecture

GitHub Webhook → API Service → Redis Queue → Worker → LangGraph → GitHub Review
                     ↓              ↓           ↓
                PostgreSQL ←───────────────────┘

Services:

  • API Service (FastAPI) - Receives webhooks, verifies signatures, enqueues jobs
  • Worker Service - Consumes jobs, runs AI review workflow, posts reviews
  • PostgreSQL - Job tracking, idempotency, audit trail
  • Redis - Job queue, locks, SHA coalescing

🚀 Quick Start

Prerequisites

  • Docker & Docker Compose
  • Python 3.11+
  • GitHub App credentials
  • OpenAI API key

Setup

  1. Clone and configure:

    git clone https://github.com/your-org/sentinel.git
    cd sentinel
    cp .env.example .env
    # Edit .env with your credentials
  2. Start services:

    docker compose up -d
  3. Verify:

    curl http://localhost:8000/health

Local Development

# Install dependencies
pip install -e ".[dev]"

# Run API service
uvicorn api.main:app --reload

# Run worker (separate terminal)
python -m worker.main

# Run tests
pytest

📁 Project Structure

sentinel/
├── api/                    # FastAPI webhook service
│   ├── routes/             # Endpoint handlers
│   ├── services/           # Business logic
│   └── models/             # Pydantic schemas
├── worker/                 # Background worker
│   ├── github/             # GitHub API client
│   ├── workflow/           # LangGraph review engine
│   └── output/             # Review publishing
├── shared/                 # Shared utilities
│   ├── db/                 # Database models & session
│   └── queue/              # Redis client
└── tests/                  # Test suite

🧠 LangGraph Workflow

Parse Diff → Classify PR → Fetch Context
                              ↓
            ┌─────────────────┼─────────────────┐
            ↓                 ↓                 ↓
   Correctness Agent   Security Agent   Maintainability Agent
            ↓                 ↓                 ↓
            └─────────────────┼─────────────────┘
                              ↓
                         Aggregator → Guardrails → Post Review

📋 Configuration

Key environment variables (see .env.example):

Variable Description
GITHUB_APP_ID GitHub App ID
GITHUB_WEBHOOK_SECRET Webhook signature secret
OPENAI_API_KEY OpenAI API key for LLM
DATABASE_URL PostgreSQL connection string
REDIS_URL Redis connection string

📖 Documentation

📜 License

MIT License - see LICENSE

About

Github PR Reviewer

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors