AI-powered Python code review agent built with LangGraph and FastAPI. Analyzes Python code for typing issues, code quality, and security vulnerabilities.
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.
check_if_python → analyze_structure → check_typing → check_quality → check_security → generate_report
├── app/
│ ├── agent/
│ │ ├── graph.py # LangGraph agent definition
│ │ └── tools.py
│ ├── main.py # FastAPI endpoints
│ └── schemas.py # Pydantic models
├── requirements.txt
└── README.md
python -m venv venv
source venv/bin/activate
pip install -r requirements.txtCreate .env file in project root:
GOOGLE_API_KEY=your_key_here
uvicorn app.main:app --reloadAPI docs available at http://127.0.0.1:8000/docs
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"}'- Python only, max 5000 characters
- 5 sequential LLM calls per request — slow on large inputs
- Depends on Gemini API quota
- LLM may hallucinate issues