
We are thrilled to announce that Trae, the real AI engineer, has achieved #1 with a score of 75.2% on the SWE-bench Verified leaderboard. We are also excited to make Trae Agent an open-source project to benefit the community.
What is Trae Agent?
Trae Agent is an intelligent LLM-based assistant designed for software engineering tasks. Think of it as having a senior software engineer in your team who can autonomously:
✅ Lakeview model provides concise summarisation on agent steps
✅ Debug complex issues with systematic reproduction and analysis
✅ Implement robust fixes with comprehensive plans
✅ Navigate any codebase and understand existing patterns
✅ Write quality code following best practices
How Trae Agent Achieves SOTA on SWE-bench Verified?
Patch Generation
We employ a single-agent approach for patch generation. Specifically, we provide with Trae Agent the following tools:
-
str_replace_based_edit_tool
allows the agent to view files and directories, and make changes (create and edit) to existing files. -
bash
provides a persistent command execution interface for the agent to interact with the system, capture output and errors. -
sequential_thinking
provides structured problem-solving and analysis capabilities by breaking down complicated problems, iteratively thinking with revision, and hypothesis generation and verification. -
ckg_tools
builds a code knowledge graph for the code repository, allowing the agent to search for classes and functions. -
task_done
issues a signal of task completion and provides final results and summaries.
To generate patches with one single attempt, we provide different models with the agent, including Claude-4-Sonnet, Claude-4-Opus, Claude-3.7-Sonnet, and Gemini-2.5-Pro.
Patch Selection
From a pool of these patch candidates generated by different LLMs, we explore strategies for selecting the most promising patch, via two approaches: a baseline method, LLM-as-a-Selector, which leverages LLMs to choose from regression-tested patches, and our enhanced solution, the Selector Agent, which combines syntax-based voting and multi-agent verification.

Selector Agentis a more robust and scalable patch selection mechanism, which operates in three stages: patch generation using diverse LLMs, filtering through regression testing, and final selectionvia a combination of syntax-based voting and multi-agent verification. By clustering syntactically equivalent patches and validating them with auxiliary tools and contextual reasoning, the Selector Agent significantly improves selection accuracy. Its design not only leverages model consensus but also introduces safeguards against overfitting or spurious agreement, enabling more reliable and effective patch resolution across a wider candidate space.
Through these methods, we aim to balance diversity and reliability in patch selection, ultimately pushing the upper bound of automated resolution performance on SWE-bench-verified. Details of patch selection can be found in our previous blog post: https://www.trae.ai/blog/product_update_0528
Final Results
Our approach raises the overall success rate on the SWE-bench-verified benchmark to 75.2% 🎉, solving 376 out of 500 real-world software engineering tasks.
What is in the Open-source Project?
Multi-LLM Support

The LLM Client system provides a unified interface for multiple AI providers, works with OpenAI, Anthropic, and Azure and is easy to extend to new providers.
LLMClient
( llm_client.py
):
-
Factory pattern for creating provider-specific clients
-
Unified interface for chat completion
-
Trajectory recording integration
Rich Tool Ecosystem

The tools module provides a comprehensive set of capabilities that the agent can use to interact with the environment.
Tool Base Classes (base.py
) define several foundational classes:
-
Tool
: Abstract base class for all tools with methods for name, description, parameters, and execution -
ToolExecutor
: Manages tool execution, supporting both parallel and sequential execution modes -
ToolCall
andToolResult
: Data structures for tool invocation and results
Based on this abstraction, we provide the implementation of four tools ready to use:
-
File Editing Tool(
edit_tool.py
): theTextEditorTool
(namedstr_replace_based_edit_tool
) provides comprehensive file manipulation capabilities: view, create, str_replace and insert. -
Bash Tool (
bash_tool.py
): theBashTool
enables command-line interaction through a persistent bash session, with timeout protection, output capture and session management. -
Sequential Thinking Tool (
sequential_thinking_tool.py
): TheSequentialThinkingTool
provides structured problem-solving capabilities: dynamic thought process, revision, branching logic and hypothesis generation and verification. -
Task Done Tool (
task_done_tool.py
): A simple but essential tool that signals task completion to the agent.
Complete Observability

The trajectory recording system provides detailed trajectory recording for every action, including LLM interactions, agent steps, metadata and error tracking.
We also provide a rich terminal output in cli_console.py
with real-time updates. A lakeview mode is by default enabled which asynchronously uses another LLM to generate concise summarization of agent steps for better user experience.
Perfect for Building Custom Agents
Whether you want to use Trae Agent out-of-the-box or build your own specialized AI assistants, clean architecture makes it incredibly simple:
# Building a custom agent is this straightforward
class MyAgent(Agent):
def get_system_prompt(self) -> str:
return "Your specialized agent prompt"
Join the Movement
Try it now:
git clone <repository-url>
cd trae-agent
uv sync
cp trae-config.json trae-config-local.json
# specify your desired model and API key in trae-config-local.json
trae run "Your first software engineering task" --working-dir='PATH TO WORKING DIR' --config-file trae-config-local.json
We're looking for:
-
Early adopters to test and provide feedback
-
Contributors to help expand the tool ecosystem
-
Agent developers to build innovative assistants on our platform
-
Community members to share use cases and improvements
Get Started
-
Repository: github.com/bytedance/trae-agent
-
Documentation: https://github.com/bytedance/trae-agent/blob/main/README.md
-
Issues & Discussions: https://github.com/bytedance/trae-agent/issues
Trae Agent is licensed under the MIT License and developed with ❤️ for the software engineering community.