diff --git a/README.md b/README.md index 9e2e192..15cbaa2 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,29 @@ # README.md # LangGraph Code Review Agent -## Description +This repository implements a **LangGraph** agent that takes a Python function as input and produces a code review. The review is evaluated by a critic node that scores it on four criteria: -This repository contains a **LangGraph** implementation that performs automated code reviews for a given Python function. The agent: +1. **PEP8 compliance** +2. **Type hints** +3. **Edge case handling** +4. **Naming conventions** -1. Generates an initial draft review. -2. Critiques the draft using four criteria (PEP8, type hints, edge cases, naming). -3. If the review is not satisfactory, rewrites the weak part up to a maximum number of rounds. +If the critic returns **`needs_revision`** the rewrite node improves the weakest part of the review. The process repeats up to ``max_rounds`` times. -The demo function `sort_numbers` is used in the CLI example. +The implementation uses only the technologies specified in the assignment: ``langgraph`` and ``langchain-ollama`` (or ``langchain-openai`` if you prefer). No vector database is used. -## How to run +## Installation ```bash -# Install dependencies pip install -r requirements.txt +``` -# Run the demo +## Demo + +Run the demo with: + +```bash python main.py ``` -The script will print the final state of the review process. - -## Requirements - -- Python 3.10+ -- LangGraph -- LangChain OpenAI -- python-dotenv (for optional API key handling) - -## License - -MIT +It will review the example function ``sort_numbers`` and print the draft review, scores, and verdict.