Sentry README

README проекта с github.com/nuglifeleoji/Sentry. Одним файлом markdown: README.md.

Sentry Logo

An external runtime failure management layer for LLM agents.

Detect execution failures, guide recovery, and learn reusable lessons from verified recoveries.
Sentry runs alongside your agent loop without replacing the agent, environment, or evaluator.

Quick Start  |  Paper (arXiv)  |  License

Python 3.10+ MIT License arXiv

What is Sentry?

Sentry is an external runtime failure management layer for LLM agents. It helps agents fix invalid actions and recover when they get stuck in loops, drift from the task, or make unsupported assumptions. Unlike typical runtime monitors with fixed advice, Sentry learns and evolves from recoveries that work. By detecting failures, guiding recovery, and checking that the repair worked, Sentry helps agents become more reliable across tasks without cluttering their context.

Sentry's demo

Sentry demo

Key Results

Quick Start

Installation

Sentry requires Python 3.10 or later.

git clone https://github.com/nuglifeleoji/Sentry.git
cd Sentry
python -m venv .venv
source .venv/bin/activate
python -m pip install -e .
sentry-validate configs/paper.yaml

Integrate Sentry into Your Agent Loop

Configure a model provider, then submit each completed agent-environment cycle to Sentry:

from Sentry import SentryRunner, agent_step_from_parts

runner = SentryRunner.from_yaml("configs/providers/openai_compatible.yaml")
runner.start_task(
    objective=task_objective,
    action_schema=environment_action_schema,
)

try:
    step = agent_step_from_parts(
        step_id=0,
        reasoning=reasoning,
        raw_action=raw_action,
        tool_name=tool_name,
        tool_args=tool_args,
        observation=observation,
        parsed_ok=True,
        schema_valid=True,
        accepted_by_environment=True,
    )

    repair = runner.step(step, terminal=False)
    if repair is not None:
        agent_messages.append(repair.prompt_text)
finally:
    runner.finalize()

Your application remains responsible for generating, validating, and executing actions. See the integration guide for the full lifecycle and validity rules.

Run the AppWorld Benchmark

The reference benchmark in benchmarks/appworld/ uses the official AppWorld environment and evaluator. Run it from the repository checkout:

python3.11 -m venv .venv-appworld
source .venv-appworld/bin/activate
python -m pip install -e '.[appworld]'
appworld install
export APPWORLD_ROOT="$PWD/outputs/appworld-root"
appworld download data --root "$APPWORLD_ROOT"
export OPENROUTER_API_KEY="your-api-key"
python -m benchmarks.appworld.run --config configs/providers/openrouter.yaml

See the AppWorld guide for environment setup, credentials, and run limits.

How It Works

Sentry framework: failure detection, repair, verification, and playbook learning

  1. Failure Detection: Sentry monitors recent agent steps for invalid actions and behavioral failures.
  2. Hard Repair: Sentry asks the agent to retry invalid actions in the required format.
  3. Soft Repair: Progress and reasoning failures receive targeted guidance from relevant playbook lessons.
  4. Recovery Verification: Sentry checks whether the agent recovers over the following steps.
  5. Online Playbook Learning: Verified soft recoveries become reusable lessons for similar failures across tasks.

Further Findings

Release

This repository currently contains the project overview and paper. We are finalizing our code and documentation and plan to release the full version in 2-3 weeks.

Sentry (nuglifeleoji/Sentry)

Ищем в базе…

1.6K ·GitHub
Что это такое?Sentry — внешний слой для управления сбоями во время работы LLM-агентов. Он обнаруживает ошибки выполнения, помогает восстанавливаться после них и извлекает повторно используемые уроки из подтверждённых восстановлений, работая параллельно с циклом агента.
Это самостоятельный агент или слой, который я подключаю к своему агенту?Это слой, который интегрируется в уже существующий цикл агента. Sentry не заменяет агента, среду или оценщика — он только отслеживает сбои и вмешивается в них.
Как подключить Sentry к своему агенту?Настройте провайдера модели, затем отправляйте в Sentry каждый завершённый цикл «агент — среда», чтобы он мог отслеживать сбои. Ваше приложение по-прежнему генерирует, проверяет и выполняет действия.
Какая версия Python нужна?Для Sentry требуется Python 3.10 или новее.
Уже есть полный код?Пока нет. В репозитории сейчас только обзор проекта и статья; авторы говорят, что полный код и документация ещё дорабатываются.
Кто будет использовать Sentry?Разработчики, которые создают или оценивают LLM-агентов для задач вроде навигации по веб-сайтам, автоматизации приложений или бенчмарков по разработке ПО и хотят получить готовый слой восстановления после сбоев, а не писать его с нуля.
На каких бенчмарках тестировался Sentry?Его оценивали на WebShop, AppWorld, SWE-bench Lite и Mind2Web Replay; средний прирост составил 37% по сравнению с самым сильным базовым методом вмешательства во время работы.
Насколько Sentry увеличивает затраты на запуск агента?Sentry использует примерно в 1,54 раза больше токенов, чем базовый агент, тогда как другие методы вмешательства во время работы — до 2,44 раза. При этом он экономит 31,7 с на задачу в SWE-bench Lite и 45,6 с в AppWorld.
Насколько хорошо Sentry на самом деле исправляет сбои?В описанных экспериментах он восстанавливается после 81,7% из 939 обнаруженных сбоев.
Как Sentry решает, как помочь застрявшему агенту?Он работает в пять этапов: обнаруживает сбои, требует жёсткого повтора при некорректных действиях, даёт мягкие подсказки из уроков-справочника при ошибках рассуждения, проверяет, что восстановление сработало, и сохраняет подтверждённые исправления как повторно используемые уроки для будущих задач.
Какие есть похожие проекты?context-language-models, DeLM, awesome-rsi, Internal-Safety-Collapse, Iris, RSIGame, rrsi, Deepgraph
Автор
nuglifeleoji
Размер
16.2 MB
Звёзды
1.6K
Обновлён
КоммитOct 11
Возраст
1 мес
Коммиты · 90 дней