agentdebugx 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agentdebugx-0.1.0/LICENSE +21 -0
- agentdebugx-0.1.0/PKG-INFO +217 -0
- agentdebugx-0.1.0/README.md +178 -0
- agentdebugx-0.1.0/docs/00_overview.md +138 -0
- agentdebugx-0.1.0/docs/01_literature_survey.md +208 -0
- agentdebugx-0.1.0/docs/02_architecture.md +210 -0
- agentdebugx-0.1.0/docs/03_taxonomy.md +173 -0
- agentdebugx-0.1.0/docs/04_trace_schema.md +235 -0
- agentdebugx-0.1.0/docs/05_adapters.md +434 -0
- agentdebugx-0.1.0/docs/06_detectors.md +224 -0
- agentdebugx-0.1.0/docs/07_attribution.md +218 -0
- agentdebugx-0.1.0/docs/08_recovery.md +250 -0
- agentdebugx-0.1.0/docs/09_error_database.md +174 -0
- agentdebugx-0.1.0/docs/10_taxonomy_induction.md +123 -0
- agentdebugx-0.1.0/docs/11_multimodal.md +110 -0
- agentdebugx-0.1.0/docs/12_ui_dashboard.md +200 -0
- agentdebugx-0.1.0/docs/13_class_design.md +539 -0
- agentdebugx-0.1.0/docs/14_api_reference.md +285 -0
- agentdebugx-0.1.0/docs/15_roadmap.md +157 -0
- agentdebugx-0.1.0/docs/16_governance.md +107 -0
- agentdebugx-0.1.0/docs/17_claude_code_design_patterns.md +281 -0
- agentdebugx-0.1.0/docs/18_comparison_codex_vs_design.md +101 -0
- agentdebugx-0.1.0/docs/ERROR_TAXONOMY.md +69 -0
- agentdebugx-0.1.0/docs/OPEN_SOURCE_DEVELOPMENT_PLAN.md +259 -0
- agentdebugx-0.1.0/docs/README.md +48 -0
- agentdebugx-0.1.0/docs/RESEARCH_SURVEY.md +200 -0
- agentdebugx-0.1.0/docs/benchmarks/v0_1_smoke.json +182 -0
- agentdebugx-0.1.0/docs/benchmarks/v0_1_smoke.md +58 -0
- agentdebugx-0.1.0/pyproject.toml +177 -0
- agentdebugx-0.1.0/src/agentdebug/__init__.py +65 -0
- agentdebugx-0.1.0/src/agentdebug/adapters/__init__.py +10 -0
- agentdebugx-0.1.0/src/agentdebug/adapters/base.py +22 -0
- agentdebugx-0.1.0/src/agentdebug/adapters/langgraph.py +261 -0
- agentdebugx-0.1.0/src/agentdebug/adapters/otel.py +151 -0
- agentdebugx-0.1.0/src/agentdebug/adapters/raw.py +134 -0
- agentdebugx-0.1.0/src/agentdebug/analyzers.py +152 -0
- agentdebugx-0.1.0/src/agentdebug/attribution.py +230 -0
- agentdebugx-0.1.0/src/agentdebug/cli.py +272 -0
- agentdebugx-0.1.0/src/agentdebug/events.py +114 -0
- agentdebugx-0.1.0/src/agentdebug/instrumentation.py +57 -0
- agentdebugx-0.1.0/src/agentdebug/judges.py +258 -0
- agentdebugx-0.1.0/src/agentdebug/llm.py +165 -0
- agentdebugx-0.1.0/src/agentdebug/models.py +169 -0
- agentdebugx-0.1.0/src/agentdebug/recorder.py +183 -0
- agentdebugx-0.1.0/src/agentdebug/recovery.py +113 -0
- agentdebugx-0.1.0/src/agentdebug/storage.py +167 -0
- agentdebugx-0.1.0/src/agentdebug/taxonomy.py +271 -0
- agentdebugx-0.1.0/src/agentdebug/ui/__init__.py +14 -0
- agentdebugx-0.1.0/src/agentdebug/ui/server.py +260 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Haofei Yu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agentdebugx
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Portable error analysis, tracing, and recovery framework for agentic AI systems. Import as `agentdebug`.
|
|
5
|
+
License: MIT
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Keywords: llm,agents,debugging,observability,failure-analysis,agent-debugging,agentic-ai,tracing,evaluation
|
|
8
|
+
Author: ULab @ UIUC
|
|
9
|
+
Author-email: ulab@illinois.edu
|
|
10
|
+
Requires-Python: >=3.9,<4.0
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
24
|
+
Classifier: Topic :: Software Development :: Debuggers
|
|
25
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
26
|
+
Classifier: Topic :: System :: Monitoring
|
|
27
|
+
Classifier: Typing :: Typed
|
|
28
|
+
Provides-Extra: all
|
|
29
|
+
Provides-Extra: langgraph
|
|
30
|
+
Provides-Extra: otel
|
|
31
|
+
Provides-Extra: ui
|
|
32
|
+
Requires-Dist: httpx (>=0.24,<1.0)
|
|
33
|
+
Requires-Dist: pydantic (>=1.10,<3.0)
|
|
34
|
+
Project-URL: Documentation, https://github.com/ulab-uiuc/AgentDebugX/tree/main/docs
|
|
35
|
+
Project-URL: Homepage, https://github.com/ulab-uiuc/AgentDebugX
|
|
36
|
+
Project-URL: Repository, https://github.com/ulab-uiuc/AgentDebugX
|
|
37
|
+
Description-Content-Type: text/markdown
|
|
38
|
+
|
|
39
|
+
# AgentDebugX
|
|
40
|
+
|
|
41
|
+
AgentDebugX is an open-source framework for tracing, diagnosing, and recovering
|
|
42
|
+
from failures in agentic AI systems. It is packaged as `agentdebug` so existing
|
|
43
|
+
agent stacks can add structured debugging with a small import:
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
from agentdebug import AgentDebug, EventType, SQLiteTraceStore
|
|
47
|
+
|
|
48
|
+
debugger = AgentDebug(store=SQLiteTraceStore(".agentdebug/errors.sqlite"))
|
|
49
|
+
|
|
50
|
+
with debugger.trace(goal="Book a refundable flight", framework="my-agent") as trace:
|
|
51
|
+
trace.record(EventType.PLAN, agent_name="planner", output="Search flights first")
|
|
52
|
+
trace.record(
|
|
53
|
+
EventType.TOOL_RESULT,
|
|
54
|
+
agent_name="browser",
|
|
55
|
+
error="Timeout while loading checkout page",
|
|
56
|
+
step_index=3,
|
|
57
|
+
)
|
|
58
|
+
report = trace.analyze()
|
|
59
|
+
|
|
60
|
+
print(report.summary)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Vision
|
|
64
|
+
|
|
65
|
+
Most observability tools show what an agent did. AgentDebugX aims to explain why
|
|
66
|
+
it failed, who or which module caused the issue, when the first critical error
|
|
67
|
+
occurred, and what should be changed next.
|
|
68
|
+
|
|
69
|
+
The long-term scope is:
|
|
70
|
+
|
|
71
|
+
- A portable trajectory IR for single-agent, multi-agent, tool-use, UI, and
|
|
72
|
+
multimodal runs.
|
|
73
|
+
- An agentic error database for storing traces, diagnostic reports, taxonomy
|
|
74
|
+
labels, artifacts, and recovery outcomes.
|
|
75
|
+
- Automated failure localization across step, module, agent, and run levels.
|
|
76
|
+
- Automated taxonomy generation that clusters new failures and proposes new
|
|
77
|
+
labels when existing taxonomies are insufficient.
|
|
78
|
+
- Recovery suggestions that can be used by humans, CI workflows, or self-healing
|
|
79
|
+
agents.
|
|
80
|
+
- UI and notebook experiences for timeline debugging, attribution, replay, and
|
|
81
|
+
dataset curation.
|
|
82
|
+
|
|
83
|
+
## Current Status
|
|
84
|
+
|
|
85
|
+
This repository now contains the first framework skeleton:
|
|
86
|
+
|
|
87
|
+
- `agentdebug.models`: normalized event, artifact, trajectory, taxonomy, and
|
|
88
|
+
diagnostic report schemas.
|
|
89
|
+
- `agentdebug.recorder`: high-level `AgentDebug` and `TraceSession` APIs.
|
|
90
|
+
- `agentdebug.analyzers`: deterministic baseline analyzer for immediate local
|
|
91
|
+
feedback.
|
|
92
|
+
- `agentdebug.taxonomy`: seed taxonomy inspired by AgentDebug, MAST, Who&When,
|
|
93
|
+
AgentRx, AgentSight, and multimodal extensions.
|
|
94
|
+
- `agentdebug.storage`: JSONL and SQLite trace stores.
|
|
95
|
+
- `agentdebug.instrumentation`: lightweight function/tool tracing helper.
|
|
96
|
+
- `agentdebug.cli`: initial `agentdebug analyze` command.
|
|
97
|
+
|
|
98
|
+
Many advanced modules are intentionally not implemented yet. The design docs
|
|
99
|
+
spell out the proposed path before we lock into heavy abstractions.
|
|
100
|
+
|
|
101
|
+
## Install
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# From PyPI (distribution name: agentdebugx; import as `agentdebug`)
|
|
105
|
+
pip install agentdebugx
|
|
106
|
+
|
|
107
|
+
# With the optional local dashboard
|
|
108
|
+
pip install 'agentdebugx[ui]'
|
|
109
|
+
|
|
110
|
+
# With LangChain/LangGraph callback adapter
|
|
111
|
+
pip install 'agentdebugx[langgraph]'
|
|
112
|
+
|
|
113
|
+
# With OpenTelemetry GenAI export shim
|
|
114
|
+
pip install 'agentdebugx[otel]'
|
|
115
|
+
|
|
116
|
+
# Everything
|
|
117
|
+
pip install 'agentdebugx[all]'
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
From source:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
pip install -e . # or: poetry install
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Quick Start
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
from agentdebug import AgentDebug, EventType
|
|
130
|
+
from agentdebug.models import model_to_json
|
|
131
|
+
|
|
132
|
+
debugger = AgentDebug()
|
|
133
|
+
trajectory = debugger.start_trace(
|
|
134
|
+
goal="Find a paper and summarize the method",
|
|
135
|
+
framework="custom-react-agent",
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
debugger.record_event(
|
|
139
|
+
trajectory,
|
|
140
|
+
EventType.LLM_CALL,
|
|
141
|
+
agent_name="researcher",
|
|
142
|
+
module="planning",
|
|
143
|
+
step_index=1,
|
|
144
|
+
input="Find the latest AgentDebug paper",
|
|
145
|
+
)
|
|
146
|
+
debugger.record_event(
|
|
147
|
+
trajectory,
|
|
148
|
+
EventType.TOOL_RESULT,
|
|
149
|
+
agent_name="search",
|
|
150
|
+
module="action",
|
|
151
|
+
step_index=2,
|
|
152
|
+
error="JSON schema validation failed: missing parameter query",
|
|
153
|
+
)
|
|
154
|
+
debugger.finish_trace(trajectory, success=False)
|
|
155
|
+
|
|
156
|
+
report = debugger.analyze(trajectory)
|
|
157
|
+
print(model_to_json(report, indent=2))
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
CLI:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# Run the rule-based analyzer (works offline, no LLM)
|
|
164
|
+
agentdebug analyze examples/sample_trace.json --out .agentdebug/report.json
|
|
165
|
+
|
|
166
|
+
# List traces in a store
|
|
167
|
+
agentdebug list --store-sqlite .agentdebug/errors.sqlite
|
|
168
|
+
|
|
169
|
+
# Run the LLM judge (requires AGENTDEBUG_LLM_BASE_URL + AGENTDEBUG_LLM_API_KEY)
|
|
170
|
+
agentdebug judge examples/sample_trace.json --attribute
|
|
171
|
+
|
|
172
|
+
# Launch the local dashboard at http://127.0.0.1:7777
|
|
173
|
+
agentdebug serve --store-sqlite .agentdebug/errors.sqlite
|
|
174
|
+
|
|
175
|
+
# Diagnose which adapters / integrations are available
|
|
176
|
+
agentdebug doctor
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
End-to-end demo (judge + attribution + Reflexion recovery, all live against an
|
|
180
|
+
LLM): `examples/llm_judge_demo.py`.
|
|
181
|
+
|
|
182
|
+
## Benchmark
|
|
183
|
+
|
|
184
|
+
`scripts/eval_v0_1.py` runs the rule analyzer + LLM judge + All-at-Once
|
|
185
|
+
attributor across six realistic failing traces (action/format,
|
|
186
|
+
planning/loop, verification, system/tool error, multi-agent handoff loss,
|
|
187
|
+
memory retrieval). Latest results:
|
|
188
|
+
[docs/benchmarks/v0_1_smoke.md](docs/benchmarks/v0_1_smoke.md).
|
|
189
|
+
|
|
190
|
+
## Documentation
|
|
191
|
+
|
|
192
|
+
Narrative (paper-style):
|
|
193
|
+
|
|
194
|
+
- [Research Survey](docs/RESEARCH_SURVEY.md)
|
|
195
|
+
- [Open-Source Development Plan](docs/OPEN_SOURCE_DEVELOPMENT_PLAN.md)
|
|
196
|
+
- [Seed Error Taxonomy](docs/ERROR_TAXONOMY.md)
|
|
197
|
+
|
|
198
|
+
Engineering spec (numbered docs 00–18):
|
|
199
|
+
|
|
200
|
+
- [docs/README.md](docs/README.md) — full doc index
|
|
201
|
+
- [docs/00_overview.md](docs/00_overview.md) — vision + north-star UX
|
|
202
|
+
- [docs/02_architecture.md](docs/02_architecture.md) — 7-layer architecture
|
|
203
|
+
- [docs/18_comparison_codex_vs_design.md](docs/18_comparison_codex_vs_design.md) — Codex scaffold ↔ design-spec reconciliation that drove v0.1
|
|
204
|
+
|
|
205
|
+
## Development
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
pytest
|
|
209
|
+
mypy --strict ./
|
|
210
|
+
ruff check .
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## License
|
|
214
|
+
|
|
215
|
+
[MIT License](LICENSE) — see the `LICENSE` file. Original template copyright
|
|
216
|
+
Haofei Yu, 2024; additions copyright ULab @ UIUC and contributors, 2026.
|
|
217
|
+
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# AgentDebugX
|
|
2
|
+
|
|
3
|
+
AgentDebugX is an open-source framework for tracing, diagnosing, and recovering
|
|
4
|
+
from failures in agentic AI systems. It is packaged as `agentdebug` so existing
|
|
5
|
+
agent stacks can add structured debugging with a small import:
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
from agentdebug import AgentDebug, EventType, SQLiteTraceStore
|
|
9
|
+
|
|
10
|
+
debugger = AgentDebug(store=SQLiteTraceStore(".agentdebug/errors.sqlite"))
|
|
11
|
+
|
|
12
|
+
with debugger.trace(goal="Book a refundable flight", framework="my-agent") as trace:
|
|
13
|
+
trace.record(EventType.PLAN, agent_name="planner", output="Search flights first")
|
|
14
|
+
trace.record(
|
|
15
|
+
EventType.TOOL_RESULT,
|
|
16
|
+
agent_name="browser",
|
|
17
|
+
error="Timeout while loading checkout page",
|
|
18
|
+
step_index=3,
|
|
19
|
+
)
|
|
20
|
+
report = trace.analyze()
|
|
21
|
+
|
|
22
|
+
print(report.summary)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Vision
|
|
26
|
+
|
|
27
|
+
Most observability tools show what an agent did. AgentDebugX aims to explain why
|
|
28
|
+
it failed, who or which module caused the issue, when the first critical error
|
|
29
|
+
occurred, and what should be changed next.
|
|
30
|
+
|
|
31
|
+
The long-term scope is:
|
|
32
|
+
|
|
33
|
+
- A portable trajectory IR for single-agent, multi-agent, tool-use, UI, and
|
|
34
|
+
multimodal runs.
|
|
35
|
+
- An agentic error database for storing traces, diagnostic reports, taxonomy
|
|
36
|
+
labels, artifacts, and recovery outcomes.
|
|
37
|
+
- Automated failure localization across step, module, agent, and run levels.
|
|
38
|
+
- Automated taxonomy generation that clusters new failures and proposes new
|
|
39
|
+
labels when existing taxonomies are insufficient.
|
|
40
|
+
- Recovery suggestions that can be used by humans, CI workflows, or self-healing
|
|
41
|
+
agents.
|
|
42
|
+
- UI and notebook experiences for timeline debugging, attribution, replay, and
|
|
43
|
+
dataset curation.
|
|
44
|
+
|
|
45
|
+
## Current Status
|
|
46
|
+
|
|
47
|
+
This repository now contains the first framework skeleton:
|
|
48
|
+
|
|
49
|
+
- `agentdebug.models`: normalized event, artifact, trajectory, taxonomy, and
|
|
50
|
+
diagnostic report schemas.
|
|
51
|
+
- `agentdebug.recorder`: high-level `AgentDebug` and `TraceSession` APIs.
|
|
52
|
+
- `agentdebug.analyzers`: deterministic baseline analyzer for immediate local
|
|
53
|
+
feedback.
|
|
54
|
+
- `agentdebug.taxonomy`: seed taxonomy inspired by AgentDebug, MAST, Who&When,
|
|
55
|
+
AgentRx, AgentSight, and multimodal extensions.
|
|
56
|
+
- `agentdebug.storage`: JSONL and SQLite trace stores.
|
|
57
|
+
- `agentdebug.instrumentation`: lightweight function/tool tracing helper.
|
|
58
|
+
- `agentdebug.cli`: initial `agentdebug analyze` command.
|
|
59
|
+
|
|
60
|
+
Many advanced modules are intentionally not implemented yet. The design docs
|
|
61
|
+
spell out the proposed path before we lock into heavy abstractions.
|
|
62
|
+
|
|
63
|
+
## Install
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# From PyPI (distribution name: agentdebugx; import as `agentdebug`)
|
|
67
|
+
pip install agentdebugx
|
|
68
|
+
|
|
69
|
+
# With the optional local dashboard
|
|
70
|
+
pip install 'agentdebugx[ui]'
|
|
71
|
+
|
|
72
|
+
# With LangChain/LangGraph callback adapter
|
|
73
|
+
pip install 'agentdebugx[langgraph]'
|
|
74
|
+
|
|
75
|
+
# With OpenTelemetry GenAI export shim
|
|
76
|
+
pip install 'agentdebugx[otel]'
|
|
77
|
+
|
|
78
|
+
# Everything
|
|
79
|
+
pip install 'agentdebugx[all]'
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
From source:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pip install -e . # or: poetry install
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Quick Start
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
from agentdebug import AgentDebug, EventType
|
|
92
|
+
from agentdebug.models import model_to_json
|
|
93
|
+
|
|
94
|
+
debugger = AgentDebug()
|
|
95
|
+
trajectory = debugger.start_trace(
|
|
96
|
+
goal="Find a paper and summarize the method",
|
|
97
|
+
framework="custom-react-agent",
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
debugger.record_event(
|
|
101
|
+
trajectory,
|
|
102
|
+
EventType.LLM_CALL,
|
|
103
|
+
agent_name="researcher",
|
|
104
|
+
module="planning",
|
|
105
|
+
step_index=1,
|
|
106
|
+
input="Find the latest AgentDebug paper",
|
|
107
|
+
)
|
|
108
|
+
debugger.record_event(
|
|
109
|
+
trajectory,
|
|
110
|
+
EventType.TOOL_RESULT,
|
|
111
|
+
agent_name="search",
|
|
112
|
+
module="action",
|
|
113
|
+
step_index=2,
|
|
114
|
+
error="JSON schema validation failed: missing parameter query",
|
|
115
|
+
)
|
|
116
|
+
debugger.finish_trace(trajectory, success=False)
|
|
117
|
+
|
|
118
|
+
report = debugger.analyze(trajectory)
|
|
119
|
+
print(model_to_json(report, indent=2))
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
CLI:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# Run the rule-based analyzer (works offline, no LLM)
|
|
126
|
+
agentdebug analyze examples/sample_trace.json --out .agentdebug/report.json
|
|
127
|
+
|
|
128
|
+
# List traces in a store
|
|
129
|
+
agentdebug list --store-sqlite .agentdebug/errors.sqlite
|
|
130
|
+
|
|
131
|
+
# Run the LLM judge (requires AGENTDEBUG_LLM_BASE_URL + AGENTDEBUG_LLM_API_KEY)
|
|
132
|
+
agentdebug judge examples/sample_trace.json --attribute
|
|
133
|
+
|
|
134
|
+
# Launch the local dashboard at http://127.0.0.1:7777
|
|
135
|
+
agentdebug serve --store-sqlite .agentdebug/errors.sqlite
|
|
136
|
+
|
|
137
|
+
# Diagnose which adapters / integrations are available
|
|
138
|
+
agentdebug doctor
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
End-to-end demo (judge + attribution + Reflexion recovery, all live against an
|
|
142
|
+
LLM): `examples/llm_judge_demo.py`.
|
|
143
|
+
|
|
144
|
+
## Benchmark
|
|
145
|
+
|
|
146
|
+
`scripts/eval_v0_1.py` runs the rule analyzer + LLM judge + All-at-Once
|
|
147
|
+
attributor across six realistic failing traces (action/format,
|
|
148
|
+
planning/loop, verification, system/tool error, multi-agent handoff loss,
|
|
149
|
+
memory retrieval). Latest results:
|
|
150
|
+
[docs/benchmarks/v0_1_smoke.md](docs/benchmarks/v0_1_smoke.md).
|
|
151
|
+
|
|
152
|
+
## Documentation
|
|
153
|
+
|
|
154
|
+
Narrative (paper-style):
|
|
155
|
+
|
|
156
|
+
- [Research Survey](docs/RESEARCH_SURVEY.md)
|
|
157
|
+
- [Open-Source Development Plan](docs/OPEN_SOURCE_DEVELOPMENT_PLAN.md)
|
|
158
|
+
- [Seed Error Taxonomy](docs/ERROR_TAXONOMY.md)
|
|
159
|
+
|
|
160
|
+
Engineering spec (numbered docs 00–18):
|
|
161
|
+
|
|
162
|
+
- [docs/README.md](docs/README.md) — full doc index
|
|
163
|
+
- [docs/00_overview.md](docs/00_overview.md) — vision + north-star UX
|
|
164
|
+
- [docs/02_architecture.md](docs/02_architecture.md) — 7-layer architecture
|
|
165
|
+
- [docs/18_comparison_codex_vs_design.md](docs/18_comparison_codex_vs_design.md) — Codex scaffold ↔ design-spec reconciliation that drove v0.1
|
|
166
|
+
|
|
167
|
+
## Development
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
pytest
|
|
171
|
+
mypy --strict ./
|
|
172
|
+
ruff check .
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## License
|
|
176
|
+
|
|
177
|
+
[MIT License](LICENSE) — see the `LICENSE` file. Original template copyright
|
|
178
|
+
Haofei Yu, 2024; additions copyright ULab @ UIUC and contributors, 2026.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# 00 — Project Overview
|
|
2
|
+
|
|
3
|
+
## 1. The problem
|
|
4
|
+
|
|
5
|
+
LLM agent frameworks have proliferated — AutoGen, LangGraph, CrewAI, OpenAI Agents SDK, OpenHands, smolagents, LlamaIndex, DSPy, Pydantic-AI, MetaGPT, Camel-AI — but **failure analysis has not kept up**. The field is fragmented along four axes:
|
|
6
|
+
|
|
7
|
+
1. **No common trace schema.** Each framework emits its own event format; observability vendors (LangSmith, Langfuse, AgentOps, Phoenix, Opik, Weave) each reimplement integration per framework, and traces cannot be compared across frameworks.
|
|
8
|
+
2. **No standard error taxonomy.** Every paper invents one — AgentDebug's 5-module taxonomy (memory/reflection/planning/action/system; Zhu et al. arXiv:2509.25370), MAST's 14 multi-agent failure modes (Cemri et al. arXiv:2503.13657), Galileo's 7 operational families, τ-bench's 4 labels, AgentBench's TLE/CLE/IF/IA codes. These rarely cross-walk.
|
|
9
|
+
3. **Attribution remains an open research problem.** Best published methods (Zhang et al. "Who & When", arXiv:2505.00212; AgenTracer, arXiv:2509.03312) hit ~53% agent-blame and ~14% step-blame accuracy. Counterfactual replay, spectrum-based fault localization, and classical delta debugging (Zeller 1999) have **never been benchmarked head-to-head** on agent traces.
|
|
10
|
+
4. **Recovery is scattered.** Reflexion, Self-Refine, CRITIC, RCI, AutoManual, LATS, LangGraph checkpointing, SagaLLM compensating actions — each lives in its own repo with its own interface.
|
|
11
|
+
|
|
12
|
+
The cost of this fragmentation is concrete: developers cannot answer "*which* agent broke, *when*, *why*, and *how do I fix it*" reliably for any non-trivial agent. Production agents ship with bespoke logging and ad-hoc post-mortems. Research papers cannot reuse each other's failure corpora.
|
|
13
|
+
|
|
14
|
+
## 2. The vision
|
|
15
|
+
|
|
16
|
+
**AgentDebugX is to LLM agents what OpenTelemetry + Sentry + a fault-tree analyzer is to distributed services.**
|
|
17
|
+
|
|
18
|
+
A single import gives any agent:
|
|
19
|
+
|
|
20
|
+
- **Uniform trajectory capture** in an OpenTelemetry-GenAI-aligned schema, regardless of framework.
|
|
21
|
+
- **Layered error detection** — fast rule checks, anomaly detection, LLM-as-judge, spec monitors.
|
|
22
|
+
- **Pluggable attribution** — which agent, which step, with confidence and counterfactual evidence.
|
|
23
|
+
- **Composable recovery** — verbal reflection, refine loops, tool-grounded critique, saga rollback.
|
|
24
|
+
- **A community error database** — every trace contributes (opt-in) to a versioned, searchable corpus of agent failures keyed by taxonomy.
|
|
25
|
+
- **Automated taxonomy induction** — as the corpus grows, AgentDebugX surfaces new failure modes and proposes taxonomy revisions.
|
|
26
|
+
- **Concrete fix suggestions** — for each detected error, an LLM-grounded recommendation backed by similar resolved cases.
|
|
27
|
+
- **Multimodal support** — screenshots, DOM snapshots, click traces for computer-use / GUI agents.
|
|
28
|
+
- **A web UI and IDE integration** for trace browsing, time-travel debugging, and review workflows.
|
|
29
|
+
|
|
30
|
+
## 3. Scope
|
|
31
|
+
|
|
32
|
+
### In scope (v0 → v1)
|
|
33
|
+
|
|
34
|
+
- Python library with adapters for the 12+ frameworks listed above.
|
|
35
|
+
- Canonical trace schema based on OTel GenAI semantic conventions.
|
|
36
|
+
- AgentDebugX-Tax v0.1 — MAST-14 + AgentDebug-5 + security/tool/grounding extensions.
|
|
37
|
+
- v1 detectors: rule-based, repeated-state, perplexity anomaly, LLM-judge.
|
|
38
|
+
- v1 attribution: All-at-Once, Step-by-Step, Binary-Search (Who&When reproductions) + Counterfactual Replay.
|
|
39
|
+
- v1 recovery: Reflexion memory, Self-Refine loop, CRITIC-with-tools, LangGraph-checkpoint rewind.
|
|
40
|
+
- Local error database (SQLite + DuckDB) + optional sync to a hosted community instance.
|
|
41
|
+
- Web UI for trace browsing, attribution review, fix suggestion.
|
|
42
|
+
|
|
43
|
+
### In scope (v2)
|
|
44
|
+
|
|
45
|
+
- Hierarchical delta debugging on traces.
|
|
46
|
+
- Goal-conditioned TnT-LLM taxonomy induction.
|
|
47
|
+
- Saga-pattern compensating-action layer.
|
|
48
|
+
- LTL/temporal-logic monitor synthesis from natural-language specs.
|
|
49
|
+
- HITL taxonomy refinement workflow for community contributions.
|
|
50
|
+
- Multimodal trace recorder (screenshot + DOM diff per step).
|
|
51
|
+
- AgentDebugX-as-a-Judge fine-tuned small model (AgenTracer-style).
|
|
52
|
+
|
|
53
|
+
### Explicitly out of scope
|
|
54
|
+
|
|
55
|
+
- Replacing an agent framework. AgentDebugX is *additive*, not a runtime.
|
|
56
|
+
- Hosting LLM inference. We never call models the user didn't configure.
|
|
57
|
+
- Acting as a commercial observability platform — we *export to* LangSmith/Langfuse/Phoenix, we are not a competitor.
|
|
58
|
+
- Building yet another eval harness. We integrate with Inspect AI for evals.
|
|
59
|
+
|
|
60
|
+
## 4. North-star UX
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
# 1. Install
|
|
64
|
+
# pip install agentdebugx (PyPI distribution — short import is `agentdebug`)
|
|
65
|
+
|
|
66
|
+
# 2. Add a handful of lines around your agent (v0.1 explicit API)
|
|
67
|
+
from agentdebug import AgentDebug, EventType, SQLiteTraceStore
|
|
68
|
+
|
|
69
|
+
debugger = AgentDebug(store=SQLiteTraceStore(".agentdebug/errors.sqlite"))
|
|
70
|
+
with debugger.trace(goal="Book a refundable flight", framework="my-agent") as trace:
|
|
71
|
+
trace.record(EventType.PLAN, agent_name="planner", output="Search flights first")
|
|
72
|
+
trace.record(EventType.TOOL_RESULT, agent_name="browser",
|
|
73
|
+
error="Timeout while loading checkout page", step_index=3)
|
|
74
|
+
report = trace.analyze()
|
|
75
|
+
print(report.summary)
|
|
76
|
+
|
|
77
|
+
# v0.2+ adds zero-line auto-attach: `agentdebug.init(project="my-agent")`
|
|
78
|
+
# auto-detects the framework and attaches the right adapter.
|
|
79
|
+
|
|
80
|
+
# 4. After it runs (or fails), inspect — v0.1
|
|
81
|
+
report = debugger.analyze(trajectory)
|
|
82
|
+
report.summary
|
|
83
|
+
# -> Trace ID: tr_01J...
|
|
84
|
+
# Status: failed
|
|
85
|
+
# Detected errors: 2
|
|
86
|
+
# [HIGH] FM-2.3 task_derailment at step 7 (agent: researcher)
|
|
87
|
+
# [MEDIUM] tool_arg_format_error at step 4 (tool: search_web)
|
|
88
|
+
# Attribution: step 4 caused the cascade (confidence 0.71, method: counterfactual)
|
|
89
|
+
# Suggested fix: tighten search_web JSON schema; add a retry-with-clarification loop
|
|
90
|
+
# Similar past cases: 14 (see https://errors.agentdebugx.dev/q/tr_01J...)
|
|
91
|
+
|
|
92
|
+
# 5. Open the dashboard
|
|
93
|
+
agentdebugx.serve() # → http://localhost:7777
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
For v0.1, the LLM judge + attributor are wired directly:
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
from agentdebug import AgentDebug, SQLiteTraceStore
|
|
100
|
+
from agentdebug.llm import OpenAICompatClient
|
|
101
|
+
from agentdebug.judges import LLMJudgeAnalyzer
|
|
102
|
+
from agentdebug.attribution import AllAtOnceAttributor
|
|
103
|
+
|
|
104
|
+
llm = OpenAICompatClient(base_url="...", api_key="...", model="gemini-3-flash")
|
|
105
|
+
debugger = AgentDebug(store=SQLiteTraceStore())
|
|
106
|
+
trajectory = debugger.start_trace(goal="...", framework="langgraph")
|
|
107
|
+
# ... record events ...
|
|
108
|
+
debugger.finish_trace(trajectory, success=False)
|
|
109
|
+
|
|
110
|
+
report = LLMJudgeAnalyzer(llm=llm).analyze(trajectory)
|
|
111
|
+
blame = AllAtOnceAttributor(llm=llm).attribute(trajectory, report.findings)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## 5. Design principles
|
|
115
|
+
|
|
116
|
+
1. **OTel-first.** Wire format is OpenTelemetry GenAI semantic conventions. Free interop with Phoenix, Langfuse, Datadog, SigNoz, MLflow, Logfire.
|
|
117
|
+
2. **Framework-agnostic.** No assumption about which agent framework is in use; auto-detect.
|
|
118
|
+
3. **Thin adapters.** Each framework adapter is ≤ 200 LOC and uses the framework's native extension point (callback / hook / event bus / OTel) — never deep monkey-patching unless that's the only option.
|
|
119
|
+
4. **Composable, not monolithic.** Detectors, attributors, recoverers all share small interfaces and can be mixed.
|
|
120
|
+
5. **Honest about uncertainty.** Attribution and recovery surface confidence scores. We never claim "the agent broke at step 7" — we say "candidate hypothesis: step 7 (confidence 0.71, evidence: …)".
|
|
121
|
+
6. **Local-first, community-augmented.** Local SQLite database by default; opt-in sync to the community corpus. User owns the data.
|
|
122
|
+
7. **Open governance.** Taxonomy and schema evolve via public RFCs.
|
|
123
|
+
8. **Skeptical of marketing.** Galileo-style "7 modes" are derivative repackagings. We cite primary methodologies.
|
|
124
|
+
|
|
125
|
+
## 6. Non-goals stated as risks
|
|
126
|
+
|
|
127
|
+
- **We will not present attribution as ground truth.** SOTA is too unreliable.
|
|
128
|
+
- **We will not auto-apply recovery actions that have side effects** (sending emails, DB writes) without explicit user opt-in and a saga-pattern compensation registered.
|
|
129
|
+
- **We will not lock users into our taxonomy.** Custom taxonomy registries are first-class.
|
|
130
|
+
|
|
131
|
+
## 7. Naming
|
|
132
|
+
|
|
133
|
+
- PyPI distribution: `agentdebugx`
|
|
134
|
+
- Python import: `agentdebug` (short, ergonomic — chosen for adoption UX)
|
|
135
|
+
- Repository: `AgentDebugX` (brand)
|
|
136
|
+
- Default taxonomy: `AgentDebugX-Tax v0.1` — 19 seed modes (see [03_taxonomy.md](./03_taxonomy.md))
|
|
137
|
+
- Community corpus: `ADBXCorpus` (deferred to v0.3)
|
|
138
|
+
- Reference web UI: `AgentDebugX Console` (deferred to v0.2)
|