add README.md

This commit is contained in:
2026-05-28 16:09:54 +00:00
parent 6d0ab31b4a
commit 011786d0de
+27
View File
@@ -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