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>

# 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.0.tar.gz (136.6 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.0-py3-none-any.whl (67.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentdebugx-0.2.0.tar.gz
  • Upload date:
  • Size: 136.6 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.0.tar.gz
Algorithm Hash digest
SHA256 c6415916c5a0f6ecc5e217a924b8199adb849ea331f090d68374c88863b4ede3
MD5 c238210b4a9c96ddb91ad77073f6f566
BLAKE2b-256 ba148a64c4deeddd724ad006df48022da1508febac97829ddc534b8b3b509139

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agentdebugx-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 67.6 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa6c1f3d0aab7bc12a6336b20476b2069a286bb246b805197c96f68126af6cd5
MD5 47ae5f4959437fc93e2bd4cc94514943
BLAKE2b-256 ea88eeacb8bcd7d5e995538b6184578c03ffe8276904124313e76157193d68a5

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