TLDR: Trae Agent is a novel AI system designed to automate the resolution of complex software issues at the repository level. Unlike previous methods, it uses a multi-agent approach for generating diverse potential solutions, intelligently pruning redundant or incorrect ones, and then selecting the best fix through a sophisticated understanding of the codebase. This system has achieved leading performance on a major software engineering benchmark, demonstrating significant improvements in automatically fixing bugs and implementing features.
In the rapidly evolving world of software development, resolving issues—whether they are bugs or new feature requests—is a constant and critical challenge. While large language models (LLMs) have made significant strides in automating various coding tasks, they often struggle with the complexity of real-world, repository-level software issues. These issues demand a deep understanding of entire codebases, cross-file reasoning, and the ability to pinpoint subtle, multi-component problems.
Traditional LLM-based approaches have shown remarkable capabilities at the function level, for instance, achieving high success rates on benchmarks like HumanEval. However, their performance drops significantly when faced with repository-level tasks, as seen with models like GPT-4o, which performs much lower on the SWE-bench benchmark. This gap highlights the need for more sophisticated solutions that can handle the intricacies of real-world software engineering.
Introducing Trae Agent: A Multi-Agent Approach to Issue Resolution
A new research paper introduces Trae Agent, an innovative LLM-based system designed to tackle these complex software issues. Trae Agent is the first of its kind to use an agent-based ensemble reasoning approach for repository-level issue resolution. It frames the problem as an “optimal solution search” and addresses the key challenges of navigating large solution spaces and achieving repository-level understanding through a modular architecture.
The system is composed of three main, interconnected components:
1. Patch Generation: Creating Diverse Solutions
The first step involves a “coder agent” that generates a diverse set of potential fixes, or “candidate patches,” in parallel. To ensure a wide variety of solutions, Trae Agent uses a high-temperature sampling strategy and can leverage multiple state-of-the-art LLMs, such as Gemini 2.5 Pro, Claude 3.7 Sonnet, and GPT-4.1. This coder agent is equipped with a rich set of tools, including file editing, bash command execution, and sequential thinking capabilities, allowing it to interact with the software environment and refine its understanding of the problem. This diverse generation process ensures that the system explores a broad range of potential solutions, increasing the likelihood of finding a correct one.
2. Patch Pruning: Refining the Solution Space
After generating numerous candidate patches, Trae Agent employs a hierarchical “patch pruning” component. This crucial step aims to reduce the “ensemble space” by eliminating redundant or faulty patches. It combines two strategies: “patch deduplication” and “regression testing.” Patch deduplication identifies and removes semantically equivalent patches, while regression testing uses a “tester agent” to execute existing tests from the codebase. Any patch that fails these tests is discarded, ensuring that only promising candidates proceed to the next stage. This pruning process is vital because, as the research shows, a significant portion of initially generated patches can be either redundant or incorrect, making accurate selection more challenging.
3. Patch Selection: Identifying the Optimal Fix
The final and most critical component is “patch selection,” where Trae Agent identifies the most accurate fix from the pruned candidates. This is achieved through a “selector agent” that simulates a real-world program comprehension process. This agent builds a comprehensive understanding of the repository by gathering and analyzing relevant code snippets (static understanding) and collecting execution traces from automatically generated tests (dynamic understanding). To further enhance robustness and mitigate potential LLM “hallucinations,” the selector agent employs a “majority voting” strategy. It runs multiple iterations, and the patch that receives the most votes is selected as the final solution.
Also Read:
- Automating Multi-Agent System Design with Finite State Machines: Introducing MetaAgent
- Repair-R1: Enhancing AI Bug Fixing Through Proactive Test Generation
Impressive Performance and Real-World Impact
Extensive experiments were conducted on the widely-used SWE-bench Verified benchmark, a collection of real-world GitHub issues. Trae Agent consistently and significantly outperformed four state-of-the-art ensemble reasoning baselines across various LLMs. It achieved an average improvement of 10.22% in Pass@1, a metric indicating the proportion of generated patches that successfully pass all tests. Notably, Trae Agent has secured the first place on the SWE-bench Verified leaderboard with a remarkable Pass@1 score of 75.20%.
The research also highlights that Trae Agent’s performance continues to improve with larger ensemble sizes, a characteristic not observed in baseline methods, demonstrating its superior scalability. The study further confirmed that each of Trae Agent’s modular components—patch deduplication, regression testing, the selector agent, and majority voting—contributes substantially to its overall effectiveness.
Trae Agent is not just a theoretical advancement; it’s an open-source project available on GitHub, which has already garnered significant community interest with over 8,000 stars. This work suggests that integrating ensemble reasoning techniques into existing agent-based systems can dramatically improve their ability to resolve complex real-world software issues, providing a guiding principle for the design of future AI-powered software engineering frameworks. You can find more details about the research paper here: Trae Agent Research Paper.


