From ec67a0636196258ea767458c89828037b8cbca07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=AD=D0=BC=D0=B8=D0=BB=D1=8C=20=D0=90=D0=BC=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Thu, 11 Jun 2026 16:07:04 +0000 Subject: [PATCH] add README.md --- README.md | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 961b5d1..3a13357 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,33 @@ -# task-6a22c713fd30e81cf315ea04 +# LangGraph Code Review Agent +This repository implements a LangGraph agent that performs a code review on a Python function. The graph consists of three nodes: + +1. **draft_review** – generates an initial review. +2. **reflect** – a critic that scores the review on four criteria (PEP8, type hints, edge cases, naming) and decides whether a rewrite is required. +3. **rewrite** – rewrites the weakest part of the review. + +The graph runs for a maximum of `max_rounds` (default 2). The demo can be executed with `python -m main`. + +## Requirements + +```text +langgraph>=0.2.0 +langchain-openai>=0.2.0 +python-dotenv>=1.0.0 +``` + +## Usage + +```bash +# Install dependencies +pip install -r requirements.txt + +# Run the demo +python -m main +``` + +The demo uses a simple `sort_numbers` function. The output shows the final review, the scores for each criterion, the verdict, and the number of rounds performed. + +## Environment Variables + +The agent uses OpenAI. Set the `OPENAI_API_KEY` environment variable before running.