add README.md
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user