AgentDebug: Where LLM Agents Fail and How They can Learn From Failures
Abstract
Large Language Models (LLMs) agents, which integrate planning, memory, reflection, and tool-use modules, have shown promise in solving complex, multi-step tasks. Yet their sophisticated architectures amplify vulnerability to cascading failures, where a single root-cause error propagates through subsequent decisions, leading to task failure. Current systems lack a framework that can comprehensively understand agent error in a modular and systemic way, and therefore fail to detect these errors accordingly. We address this gap with three contributions. First, we introduce the AgentErrorTaxonomy, a modular classification of failure modes spanning memory, reflection, planning, action, and system-level operations. Second, we construct the Agent Error Benchmark, the first dataset of systematically annotated failure trajectories from ALFWorld, GAIA, and WebShop, grounding error analysis in real-world agent rollouts. Third, we propose AgentDebug, a debugging framework that isolates root-cause failures and provides corrective feedback, enabling agents to recover and iteratively improve. Beyond the framework, we also design an automated data curation pipeline to construct AgentDebug-Traj2k, a large-scale dataset generated via proposer–reviewer collaboration, where multiple models propose debugging analyses and consolidates them into high-quality annotations. Build upon this dataset, we train AgentDebugger-4B, a specialized model for agent debugging. Experiments on AgentErrorBench show that AgentDebug framework achieves 24% higher all-correct accuracy and 17% higher step accuracy over the strongest baseline. The generated feedback further enables 26% relative improvements in task success across ALFWorld, GAIA, and WebShop. In addition, AgentDebugger-4B improves over its base model and even outperforms GPT-4.1 in error detection, demonstrating the effectiveness of scalable debugging supervision.