011786d0de80a25ba8a36dbd050f585cd52c17e4
Экзамен: Самокорректирующийся агент
LangGraph-агент с циклом execute_task → verify_result (LLM-as-judge) → retry.
Запуск
pip install -r requirements.txt
cp .env.example .env # JOURNAL_MCP_PAT или JOURNAL_TOKEN
python main.py
python main.py "Вычисли 2+2"
Граф
START → execute_task → verify_result
↑ failed & attempts < max ← handle_error
success / max_attempts → END
Компоненты
AgentState: task, result, attempts, status, error, max_attemptsunreliable_tool: ~30%ValueErrorдля демонстрации retryverify_result: LLM отвечаетsuccess/failedInMemorySaverдля checkpointing
Description
Languages
Python
100%