Skip to main content

Portable error analysis, tracing, and recovery framework for agentic AI systems. Import as `agentdebug`.

Project description

AgentDebugX

AgentDebugX is an open-source framework for tracing, diagnosing, and recovering from failures in agentic AI systems. It is packaged as agentdebug so existing agent stacks can add structured debugging with a small import:

from agentdebug import AgentDebug, EventType, SQLiteTraceStore

debugger = AgentDebug(store=SQLiteTraceStore(".agentdebug/errors.sqlite"))

with debugger.trace(goal="Book a refundable flight", framework="my-agent") as trace:
    trace.record(EventType.PLAN, agent_name="planner", output="Search flights first")
    trace.record(
        EventType.TOOL_RESULT,
        agent_name="browser",
        error="Timeout while loading checkout page",
        step_index=3,
    )
    report = trace.analyze()

print(report.summary)

Vision

Most observability tools show what an agent did. AgentDebugX aims to explain why it failed, who or which module caused the issue, when the first critical error occurred, and what should be changed next.

The long-term scope is:

  • A portable trajectory IR for single-agent, multi-agent, tool-use, UI, and multimodal runs.
  • An agentic error database for storing traces, diagnostic reports, taxonomy labels, artifacts, and recovery outcomes.
  • Automated failure localization across step, module, agent, and run levels.
  • Automated taxonomy generation that clusters new failures and proposes new labels when existing taxonomies are insufficient.
  • Recovery suggestions that can be used by humans, CI workflows, or self-healing agents.
  • UI and notebook experiences for timeline debugging, attribution, replay, and dataset curation.

Current Status

This repository now contains the first framework skeleton:

  • agentdebug.models: normalized event, artifact, trajectory, taxonomy, and diagnostic report schemas.
  • agentdebug.recorder: high-level AgentDebug and TraceSession APIs.
  • agentdebug.analyzers: deterministic baseline analyzer for immediate local feedback.
  • agentdebug.taxonomy: seed taxonomy inspired by AgentDebug, MAST, Who&When, AgentRx, AgentSight, and multimodal extensions.
  • agentdebug.storage: JSONL and SQLite trace stores.
  • agentdebug.instrumentation: lightweight function/tool tracing helper.
  • agentdebug.cli: initial agentdebug analyze command.

Many advanced modules are intentionally not implemented yet. The design docs spell out the proposed path before we lock into heavy abstractions.

Install

# From PyPI (distribution name `agentdebugx`; the short import is `agentdebug`)
pip install agentdebugx

# With the optional local dashboard
pip install 'agentdebugx[ui]'

# With LangChain/LangGraph callback adapter
pip install 'agentdebugx[langgraph]'

# With OpenTelemetry GenAI export shim
pip install 'agentdebugx[otel]'

# With Hugging Face Datasets backend for the Error Hub
pip install 'agentdebugx[hub-hf]'

# With OpenHands EventStream bridge
pip install 'agentdebugx[openhands]'

# Everything
pip install 'agentdebugx[all]'

From source:

pip install -e .         # or: poetry install

The PyPI distribution name is agentdebugx because PyPI's name policy (PEP 503 normalization) collides agentdebug with the existing agent-debug package. The Python import is always import agentdebug.

Quick Start

from agentdebug import AgentDebug, EventType
from agentdebug.models import model_to_json

debugger = AgentDebug()
trajectory = debugger.start_trace(
    goal="Find a paper and summarize the method",
    framework="custom-react-agent",
)

debugger.record_event(
    trajectory,
    EventType.LLM_CALL,
    agent_name="researcher",
    module="planning",
    step_index=1,
    input="Find the latest AgentDebug paper",
)
debugger.record_event(
    trajectory,
    EventType.TOOL_RESULT,
    agent_name="search",
    module="action",
    step_index=2,
    error="JSON schema validation failed: missing parameter query",
)
debugger.finish_trace(trajectory, success=False)

report = debugger.analyze(trajectory)
print(model_to_json(report, indent=2))

CLI:

# Run the rule-based analyzer (works offline, no LLM)
agentdebug analyze examples/sample_trace.json --out .agentdebug/report.json

# List traces in a store
agentdebug list --store-sqlite .agentdebug/errors.sqlite

# Run the LLM judge (requires AGENTDEBUG_LLM_BASE_URL + AGENTDEBUG_LLM_API_KEY)
agentdebug judge examples/sample_trace.json --attribute

# Launch the local dashboard at http://127.0.0.1:7777
agentdebug serve --store-sqlite .agentdebug/errors.sqlite

# DeepDebug — iterative multi-turn analysis (plan -> hypothesize -> verify -> refine)
agentdebug deep <trajectory.json>

# Render the cascade as a Python-traceback (root cause first, manifested failure last)
agentdebug deep <trajectory.json> --traceback
agentdebug analyze <trajectory.json> --traceback   # works without an LLM too

# Error Hub: package + push a trace to a Git remote or HF dataset
agentdebug hub push <trace_id> \
    --to git:git@github.com:your-org/agentdebug-bundles.git#bundles \
    --store-sqlite .agentdebug/errors.sqlite

# Pull a bundle someone else shared
agentdebug hub pull git:... --bundle bundle_01ABCD --into .agentdebug/hub_pulls

# Host integrations: generate a Claude Code Skill, or an OpenHands microagent
agentdebug integrations skill --target ~/.claude/skills
agentdebug integrations openhands-microagent --target .openhands/microagents

# Diagnose which adapters / integrations are available
agentdebug doctor

End-to-end demo (judge + attribution + Reflexion recovery, all live against an LLM): examples/llm_judge_demo.py.

Benchmark

scripts/eval_v0_1.py runs the rule analyzer + LLM judge + All-at-Once attributor across six realistic failing traces (action/format, planning/loop, verification, system/tool error, multi-agent handoff loss, memory retrieval). Latest results: docs/benchmarks/v0_1_smoke.md.

Documentation

Narrative (paper-style):

Engineering spec (numbered docs 00–18):

Development

pytest
mypy --strict ./
ruff check .

License

MIT License — see the LICENSE file. Original template copyright Haofei Yu, 2024; additions copyright ULab @ UIUC and contributors, 2026.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentdebugx-0.2.8.tar.gz (174.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentdebugx-0.2.8-py3-none-any.whl (90.0 kB view details)

Uploaded Python 3

File details

Details for the file agentdebugx-0.2.8.tar.gz.

File metadata

  • Download URL: agentdebugx-0.2.8.tar.gz
  • Upload date:
  • Size: 174.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for agentdebugx-0.2.8.tar.gz
Algorithm Hash digest
SHA256 475ed4a5ae090c569ec216bcfa05a4f5b81bed1f5329b945a3a303f9dfe5a7fc
MD5 f0dbac03daf5b57e3bc2397d53230c0b
BLAKE2b-256 de2e3b9416ff1339dc108eee0509bd3713790d508766c68128d79a1c3ffa9930

See more details on using hashes here.

File details

Details for the file agentdebugx-0.2.8-py3-none-any.whl.

File metadata

  • Download URL: agentdebugx-0.2.8-py3-none-any.whl
  • Upload date:
  • Size: 90.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for agentdebugx-0.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 20b58f59e847b7824b0f51345ad8ebf3effd6165ce103f52e1ec0ea2b9f65825
MD5 ecb6b0e15e6ca64db4390129179cb0ea
BLAKE2b-256 e8b860cdbdb3a2c7fe49f6eeb583dc50b6aa83c574314b5bf3bd16b59ca0e16a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page