Skip to main content

AI-powered PR reviewer with blast radius detection

Project description

RabbitAI Banner

RabbitAI โ€” AI Code Reviewer

Open-source AI code reviewer that auto-reviews GitHub PRs with zero cost and full self-hosting.

PyPI MIT License Python 3.11 LangGraph Gemini GitHub Stars

---

What is RabbitAI?

RabbitAI is an open-source AI code reviewer. Drop one workflow file into any repo and it reviews every PR automatically catching bugs, security issues, and performance problems โ€” and posts a structured comment directly on the PR.

Unlike other code reviewers, RabbitAI:

  • Builds a knowledge graph of your codebase to detect blast radius of changes
  • Uses mem0 persistent memory to get smarter with every PR it reviews
  • Supports Gemini and OpenAI for both LLM and embeddings fully config-driven
  • Supports ChromaDB, Pinecone, and Qdrant as vector stores
  • Runs as a GitHub Action, MCP server inside Claude/Cursor, or local CLI
  • Runs completely free using Gemini free tier + local ChromaDB

Demo

RabbitAI Code Review  ยท  7/10

[BUG]
auth.ts line 23: user.id can be undefined if session expires before check

[SECURITY]
db.ts line 45: query is not parameterized SQL injection risk

[PERFORMANCE]
dashboard.tsx line 89: value recalculated on every render, consider useMemo

[GOOD]
Error boundaries correctly implemented throughout
TypeScript types well-defined across all components

Note: db.ts has 12 dependents this change is marked HIGH BLAST RADIUS

---
๐Ÿ‡ RabbitAI ยท AI-powered code review ยท MIT License

How It Works

PR opened
โ†’ Fetch diff + metadata via GitHub API
โ†’ Build NetworkX file dependency graph (blast radius detection)
โ†’ Classify change type (bug fix / feature / refactor / security)
โ†’ Chunk diff โ†’ embed โ†’ store in vector DB
โ†’ Load repo memory from mem0 (past learnings)
โ†’ Retrieve relevant chunks via semantic search
โ†’ LLM reviews with full context + memory + graph insights
โ†’ Post structured comment on PR
โ†’ Save new learnings to mem0

Quick Start

Option 1 โ€” GitHub Action (recommended)

Add .github/workflows/review.yml to your repo:

name: RabbitAI Code Review

on:
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  review:
    runs-on: ubuntu-latest

    permissions:
      pull-requests: write
      contents: read

    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"

      - name: Install RabbitAI
        run: pip install rabbitai-reviewer

      - name: Run RabbitAI
        env:
          GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
          GITHUB_REPOSITORY: ${{ github.repository }}
          PR_NUMBER: ${{ github.event.pull_request.number }}
          VECTOR_STORE_PROVIDER: ${{ vars.VECTOR_STORE_PROVIDER }}
          EMBEDDING_PROVIDER: ${{ vars.EMBEDDING_PROVIDER }}
          EMBEDDING_MODEL: ${{ vars.EMBEDDING_MODEL }}
          LLM_PROVIDER: ${{ vars.LLM_PROVIDER }}
          LLM_MODEL: ${{ vars.LLM_MODEL }}
          REVIEW_LANGUAGE: ${{ vars.REVIEW_LANGUAGE }}
        run: |
          python -c "
          import os
          from rabbitai.agent import run
          result = run(os.environ['GITHUB_REPOSITORY'], int(os.environ['PR_NUMBER']))
          print(result.comment_url if result.posted else result.reason)
          "

Add GEMINI_API_KEY to your repo secrets get one free at aistudio.google.com.

GITHUB_TOKEN is injected automatically. Open a PR done.


Option 2 โ€” Local CLI

git clone https://github.com/nikhilsaiankilla/rabbitai
cd rabbitai
pip install rabbitai-reviewer
cp config.example.yaml config.yaml
# fill in your config.yaml
# test.py
from rabbitai.agent import run

result = run(repo_name="your-username/your-repo", pr_number=1)
print(result)
python test.py

Stack

Layer Default Alternatives
LLM Gemini 2.0 Flash (free) GPT-4.1-mini
Embeddings Gemini embedding-001 (free) text-embedding-3-small
Vector store ChromaDB (local, free) Pinecone, Qdrant
Memory mem0 (local, free) โ€”
Dependency graph NetworkX (free) โ€”
Workflow LangGraph (free) โ€”
Total $0/month

Configuration

Copy config.example.yaml to config.yaml and fill in your values.

github_token: "" # local dev only Actions injects GITHUB_TOKEN automatically
gemini_api_key: "" # free at aistudio.google.com

embedding:
  provider: "gemini" # gemini | openai
  model: "" # leave empty for provider default
  api_key: "" # openai only

llm:
  provider: "gemini" # gemini | openai
  model: "" # leave empty for provider default
  api_key: "" # openai only

vector_store:
  provider: "chromadb" # chromadb | pinecone | qdrant
  path: "./chroma_db" # for chromadb only
  collection: "pr-chunks"

memory:
  enabled: true
  repo_context: |
    Describe your repo so RabbitAI understands it from day one.

review:
  language: "typescript"
  focus:
    - bugs
    - security
    - performance
  min_risk_score: 0 # 0 = always post
  post_score: true

All values can be overridden with environment variables. See the full docs for provider setup, dimension reference, and all config options.


Project Structure

rabbitai/
โ”œโ”€โ”€ .github/
โ”‚   โ””โ”€โ”€ workflows/
โ”‚       โ”œโ”€โ”€ review.yml        โ† self-review on every PR
โ”‚       โ””โ”€โ”€ publish.yml       โ† auto publish to PyPI on merge to main
โ”œโ”€โ”€ rabbitai/
โ”‚   โ”œโ”€โ”€ nodes/
โ”‚   โ”‚   โ”œโ”€โ”€ fetcher.py        โ† fetch PR diff + metadata
โ”‚   โ”‚   โ”œโ”€โ”€ graph_builder.py  โ† NetworkX dependency graph + blast radius
โ”‚   โ”‚   โ”œโ”€โ”€ classifier.py     โ† change type detection
โ”‚   โ”‚   โ”œโ”€โ”€ embedder.py       โ† embeddings + vector DB storage
โ”‚   โ”‚   โ”œโ”€โ”€ retriever.py      โ† semantic search over stored chunks
โ”‚   โ”‚   โ”œโ”€โ”€ reviewer.py       โ† LLM review generation
โ”‚   โ”‚   โ””โ”€โ”€ poster.py         โ† GitHub PR comment poster
โ”‚   โ”œโ”€โ”€ memory/
โ”‚   โ”‚   โ””โ”€โ”€ repo_memory.py    โ† mem0 persistent memory
โ”‚   โ”œโ”€โ”€ mcp/
โ”‚   โ”‚   โ””โ”€โ”€ server.py         โ† MCP server for Claude/Cursor
โ”‚   โ”œโ”€โ”€ utils/
โ”‚   โ”‚   โ”œโ”€โ”€ config.py         โ† config loader + env var overrides
โ”‚   โ”‚   โ””โ”€โ”€ prompts.py        โ† review prompt templates
โ”‚   โ””โ”€โ”€ agent.py              โ† LangGraph 9-node workflow entry point
โ”œโ”€โ”€ config.example.yaml
โ”œโ”€โ”€ pyproject.toml
โ””โ”€โ”€ requirements.txt

Roadmap

  • 9-node LangGraph workflow
  • NetworkX knowledge graph + blast radius detection
  • ChromaDB, Pinecone, and Qdrant support
  • Gemini and OpenAI for LLM and embeddings
  • mem0 persistent memory
  • MCP server for Claude/Cursor
  • Published to PyPI โ€” pip install rabbitai-reviewer
  • Auto publish to PyPI on merge to main
  • GitLab and Bitbucket support
  • Web dashboard for review history
  • Slack and Discord notifications
  • Fine-tuned prompts per language

Contributing

PRs welcome. RabbitAI reviews its own PRs.

  1. Fork the repo
  2. Create your branch git checkout -b feat/your-feature
  3. Commit git commit -m 'feat: your feature'
  4. Push and open a PR

License

MIT use it, fork it, self-host it, build on it.


Built by Nikhil Sai ยท @itzznikhilsai

If this helped you, star the repo โญ and share it on X.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rabbitai_reviewer-0.1.5.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rabbitai_reviewer-0.1.5-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

Details for the file rabbitai_reviewer-0.1.5.tar.gz.

File metadata

  • Download URL: rabbitai_reviewer-0.1.5.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for rabbitai_reviewer-0.1.5.tar.gz
Algorithm Hash digest
SHA256 ba1137ddc584ee50ac2d69a878087b28440f16edd775f025e97a4e60fa931bf3
MD5 ed259d71c5681690e1e40496b85abcb3
BLAKE2b-256 2c246ca0c93643b4537171d7e7913d52348bf9a1e62bd59ad67de7c47c0467bf

See more details on using hashes here.

File details

Details for the file rabbitai_reviewer-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for rabbitai_reviewer-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6c1b505ee2d82024eb353da2d1a1e98f9f4a7d5f6b12497cfe52a00e13b4a812
MD5 e5b9e275e68599dc45497bc68d240126
BLAKE2b-256 2cb240a6779622bd848a39d923531962f3c4951b814130d8e7607920146d91b8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page