From 011786d0de80a25ba8a36dbd050f585cd52c17e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=BE=D0=BC=D0=B0=D0=BD=20=D0=9A=D1=83=D1=80=D0=BB?= =?UTF-8?q?=D1=8B=D0=B3=D0=B8=D0=BD?= Date: Thu, 28 May 2026 16:09:54 +0000 Subject: [PATCH] add README.md --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..3ac2bb3 --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +# Экзамен: Самокорректирующийся агент + +LangGraph-агент с циклом `execute_task → verify_result (LLM-as-judge) → retry`. + +## Запуск + +```bash +pip install -r requirements.txt +cp .env.example .env # JOURNAL_MCP_PAT или JOURNAL_TOKEN +python main.py +python main.py "Вычисли 2+2" +``` + +## Граф + +```text +START → execute_task → verify_result + ↑ failed & attempts < max ← handle_error + success / max_attempts → END +``` + +## Компоненты + +- `AgentState`: task, result, attempts, status, error, max_attempts +- `unreliable_tool`: ~30% `ValueError` для демонстрации retry +- `verify_result`: LLM отвечает `success` / `failed` +- `InMemorySaver` для checkpointing