An intelligent code review agent powered by LLM reasoning models that automatically analyzes pull requests, detects bugs, security vulnerabilities, and suggests improvements with contextual explanations.
┌─────────────────────────────────────────────────┐
│ AI Code Review Bot │
├─────────────────────────────────────────────────┤
│ │
│ ┌───────────┐ ┌───────────┐ ┌───────────┐ │
│ │ Diff │ │ Context │ │ Pattern │ │
│ │ Parser │ │ Builder │ │ Detector │ │
│ └─────┬─────┘ └─────┬─────┘ └─────┬─────┘ │
│ │ │ │ │
│ └───────────────┼───────────────┘ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ LLM Reasoning │ │
│ │ Engine │ │
│ └────────┬────────┘ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ Review Reporter │ │
│ └─────────────────┘ │
│ │
└─────────────────────────────────────────────────┘
- Multi-language support: Python, JavaScript, TypeScript, Go, Rust, Java
- Security scanning: Detects SQL injection, XSS, hardcoded secrets, insecure dependencies
- Bug detection: Null pointer dereferences, race conditions, memory leaks, off-by-one errors
- Performance analysis: N+1 queries, unnecessary allocations, blocking I/O in async contexts
- Style enforcement: Configurable coding standards with auto-fix suggestions
- Context-aware reviews: Understands project conventions by analyzing existing codebase patterns
- Webhook Listener — Receives PR/MR events from GitHub/GitLab
- Diff Parser — Extracts changed files, hunks, and surrounding context
- Context Builder — Gathers related files, imports, type definitions for full understanding
- LLM Analysis — Sends structured prompts to reasoning model for deep code analysis
- Pattern Detector — Cross-references LLM findings with known vulnerability patterns
- Review Reporter — Posts inline comments on the PR with severity levels and fix suggestions
pip install -r requirements.txt
cp .env.example .env
# Configure your API keys and webhook secret
python -m bot.main# config.yaml
review:
severity_threshold: "warning" # info, warning, error, critical
max_files_per_review: 50
languages:
- python
- javascript
- typescript
security:
scan_dependencies: true
check_secrets: true
owasp_top_10: true
llm:
model: "mimo-v2.5-reasoning"
temperature: 0.1
max_tokens: 4096
chain_of_thought: true# Run as webhook server
python -m bot.main --port 8080
# Review a specific PR manually
python -m bot.review --repo owner/repo --pr 42
# Scan local directory
python -m bot.scan ./src --format markdown- Average PR review: ~3,000-8,000 tokens (input) + ~1,500 tokens (output)
- Large PR (50+ files): ~25,000 tokens (input) + ~5,000 tokens (output)
- Daily usage across 20 PRs: ~200,000 tokens
- Monthly projected: ~4M tokens
MIT