Abstract
Recent advances in large language model (LLM) agents have shown remarkable progress in software issue resolution, leveraging advanced techniques such as multi-agent collaboration and Monte Carlo Tree Search (MCTS). However, current agents act as memoryless explorers—treating each problem separately without retaining or reusing knowledge from previous repair experiences. This leads to redundant exploration of failed trajectories and missed chances to adapt successful issue resolution methods to similar problems. To address this problem, we introduce SWE-Exp, an experience-enhanced approach that distills concise and actionable experience from prior agent trajectories, enabling continuous learning across issues. Our method introduces a multi-faceted experience bank that captures both successful and failed repair attempts. Specifically, it extracts reusable issue resolution knowledge at different levels—from high-level problem comprehension to specific code changes. Experiments show that SWE-Exp achieves state-of-the-art resolution rate (41.6% Pass@1) on SWE-bench-Verified under open-source agent frameworks. Our approach establishes a new paradigm in which automated software engineering agents systematically accumulate and leverage repair expertise, fundamentally shifting from trial-and-error exploration to strategic, experience-driven issue resolution.
Introduction
Current Large Language Model (LLM) agents for automated program repair (APR) typically operate in a vacuum. Even the most advanced systems—using techniques like Monte Carlo Tree Search (MCTS) or multi-agent collaboration—treat every new software issue as an isolated event. This "memoryless explorer" problem leads to three major inefficiencies: redundant exploration of failed strategies, an inability to transfer valuable patterns across tasks, and a lack of strategic evolution over time. SWE-Exp addresses these gaps by transforming agents into "experienced developers" equipped with a searchable bank of past repair successes and failures.
Methodology
SWE-Exp treats software issue resolution as a continuous learning process through a four-stage framework:
- Trajectory Collection: Raw execution logs are gathered from both successful and failed repair attempts across diverse open-source repositories.
- Experience Extraction: An "Experiencer" agent distills noisy logs into structured insights, categorized into Comprehension Experiences (interpreting the bug) and Modification Experiences (structuring the fix).
- Experience Retrieval & Reranking: For new issues, the system retrieves similar past cases from a vector database. A "Reranker" agent selects the most applicable experience to guide the current task.
- Experience-Driven Execution: A Dual-Agent Architecture consisting of an Instructor (high-level planner) and an Assistant (low-level executor) uses the retrieved experience to navigate the repository and generate patches.
Experimental Evaluation
The framework was evaluated on SWE-bench Verified, a dataset of 500 human-verified GitHub issues from real-world Python projects. This benchmark provides a rigorous test of an agent's ability to solve complex, non-trivial software bugs.
Key Results
- State-of-the-Art Performance: Using Claude 4 Sonnet, SWE-Exp achieved a 73.0% Pass@1 rate, outperforming previous leaders like SAGE (71.6%) and SWE-Search (70.8%).
- Open-Source Excellence: With the open-source DeepSeek-V3 model, SWE-Exp reached 42.0%, a substantial improvement over the 35.4% baseline.
- Efficiency: The overhead of retrieval and coordination is minimal. Average API costs remained nearly identical ($0.13 vs $0.12 per issue), with only a modest increase in runtime (approx. 37 seconds per instance).
Insights and Analysis
Analysis of the agent's behavior reveals that experience fundamentally changes how agents approach code. Without experience, agents often apply "band-aid" fixes to surface-level symptoms. With experience, they are more likely to identify underlying design flaws, such as creating defensive copies of mutated objects rather than patching specific instances.
Furthermore, the study found that Comprehension Experiences are slightly more influential than Modification Experiences, suggesting that understanding why a bug exists is the critical prerequisite for a robust fix. Interestingly, providing a single, highly relevant experience is more effective than providing multiple experiences, as excessive context can introduce conflicting information.
Conclusion
SWE-Exp demonstrates that systematic experience reuse is a powerful catalyst for automated software engineering. By shifting from trial-and-error to strategic, experience-driven resolution, the framework sets a new standard for agent performance. Future work will explore integrating formal verification to ensure the logical soundness of retrieved experiences and expanding the framework to other programming languages.
Summary updated