Skip to content

hydrauluu/code-review-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Review Agent

AI-powered Python code review agent built with LangGraph and FastAPI. Analyzes Python code for typing issues, code quality, and security vulnerabilities.

What it does

Accepts Python code via REST API and returns a structured review report with:

  • issues — typing, quality, security, structure with severity levels
  • Suggestions — concrete improvements
  • Summary — overall assessment

Non-Python code is rejected automatically.

Agent flow

check_if_python → analyze_structure → check_typing → check_quality → check_security → generate_report

Project structure

├── app/
│   ├── agent/
│   │   ├── graph.py      # LangGraph agent definition
│   │   └── tools.py
│   ├── main.py           # FastAPI endpoints
│   └── schemas.py        # Pydantic models
├── requirements.txt
└── README.md

Setup

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Create .env file in project root:

GOOGLE_API_KEY=your_key_here

Run

uvicorn app.main:app --reload

API docs available at http://127.0.0.1:8000/docs

Usage

curl -X POST http://127.0.0.1:8000/review \
  -H "Content-Type: application/json" \
  -d '{"code": "def add(a, b):\n    return a + b"}'

Limitations

  • Python only, max 5000 characters
  • 5 sequential LLM calls per request — slow on large inputs
  • Depends on Gemini API quota
  • LLM may hallucinate issues

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages