The Problem
Every code review starts from scratch. A developer makes the same SQL injection mistake twice — the reviewer has no memory of the first time.
What if your code reviewer actually remembered?
What I Built
A Code Review Agent that:
- Reviews GitHub PRs automatically
- Remembers each developer's past mistakes
- Gets more personalized with every review
- Routes simple PRs to fast models, complex PRs to powerful ones
How It Works
Review #1 — Alex submits a PR with a SQL injection bug. Agent reviews it and saves: "Alex tends to write unsafe SQL queries."
Review #2 — Alex submits another PR. Agent recalls the history and immediately flags SQL patterns — personalized feedback.
Tech Stack
- Groq — Free LLM API (llama-3.1-8b + llama-3.3-70b)
- Python — Core language
- PyGithub — Fetch real GitHub PRs
- Rich — Beautiful terminal output
Key Code — Memory System
def save_developer_memory(developer, review_summary):
if developer not in developer_memory:
developer_memory[developer] = []
developer_memory[developer].append(review_summary)
def recall_developer_history(developer):
memories = developer_memory[developer]
return "\n".join([f"- {m}" for m in memories])
Smart Model Routing
Simple PRs (under 100 lines) → fast cheap model
Complex PRs → powerful model
Saves cost without losing quality.
GitHub Repo
https://github.com/sharadha26052006-eng/code-review-agent
What I Learned
Memory transforms a generic AI tool into a personalized assistant. Even a simple dictionary-based memory makes a huge difference in output quality.
Top comments (0)