AWorld: Build, evaluate and train General Multi-Agent Assistance with ease
3 months ago
1
AWorld (Agent World) is the next-generation framework engineered for agent self-improvement at scale. We enable AI agents to continuously evolve by synthesizing their own knowledge and experiences. This core capability is powered by:
Multi-Agent Systems (MAS): Build complex, interacting agent societies using our plug-and-play protocols and robust context management.
Intelligence Beyond a Single Model: Generates high-quality feedback and diverse synthetic training data that fuel individual agent evolution.
Cloud-Native for Diversity & Scale: Delivers the high concurrency and scalability for training smarter agents and achieving self-improvement.
AWorld empowers you to rapidly build individual tool-using agents, orchestrate sophisticated multi-agent systems, train agents effectively, and synthesize the high-quality data required for continuous agent evolution – all converging towards autonomous self-improvement.
Agentic Achievements Unboxed! 🔥
🏅️ [2025/08/06] Excel in Stability with Multi-Agent System on GAIA
Achieved an average Pass@1 score of 67.89 and Pass@3 score of 83.49 across 109 tasks from the test dataset. See more details here. See Technical report here.
🚀 [2025/07/25] Plug-&-Play Math Mastery!
Built a MAS solving 5/6 IMO 2025 problems in hours - proving agent orchestration beats solo models.
Peek at the genius under the hood!
🧩 [2025/07/23] Build BFCL Runtimes Readily!
New BFCL tutorial shows how to synthesize function calls training data in minutes.
Start cooking up your own agents right here!
🏆 [2025/07/07] GAIA Soars to 77.08! Cloud-native runtimes now enable distributed agent evolution.
See how diverse environments evolves smarter models training recipe.
We introduce the concepts of Agent and Runners to help you get started quickly.
importosfromaworld.agents.llm_agentimportAgentfromaworld.runnerimportRunnerssummarizer=Agent(
name="Summary Agent",
system_prompt="You specialize at summarizing.",
)
result=Runners.sync_run(
input="Tell me a succint history about the universe",
agent=summarizer,
)
In parallel, we introduce the concepts of Swarm to construct a team of agents.
importosfromaworld.agents.llm_agentimportAgentfromaworld.runnerimportRunnersfromaworld.core.agent.swarmimportSwarmresearcher=Agent(
name="Research Agent",
system_prompt="You specialize at researching.",
)
summarizer=Agent(
name="Summary Agent",
system_prompt="You specialize at summarizing.",
)
# Create agent team with collaborative workflowteam=Swarm(researcher, summarizer)
result=Runners.sync_run(
input="Tell me a complete history about the universe",
swarm=team,
)
Finally, run your own agents or teams
# Set LLM credentialsexport LLM_MODEL_NAME="gpt-4"export LLM_API_KEY="your-api-key-here"export LLM_BASE_URL="https://api.openai.com/v1"# Run
python /path/to/agents/or/teams
🌏 Click to View Advanced Usages
Pass AgentConfig Explicitly
importosfromaworld.agents.llm_agentimportAgentfromaworld.runnerimportRunnersfromaworld.config.confimportAgentConfigfromaworld.core.agent.swarmimportSwarmgpt_conf=AgentConfig(
llm_provider="openai",
llm_model_name="gpt-4o",
llm_api_key="<OPENAI_API_KEY>",
llm_temperature=0.1,
)
openrouter_conf=AgentConfig(
llm_provider="openai",
llm_model_name="google/gemini-2.5-pro",
llm_api_key="<OPENROUTER_API_KEY>",
llm_base_url="https://openrouter.ai/api/v1"llm_temperature=0.1,
)
researcher=Agent(
name="Research Agent",
conf=gpt_conf,
system_prompt="You specialize at researching.",
)
summarizer=Agent(
name="Summary Agent",
conf=openrouter_conf,
system_prompt="You specialize at summarizing.",
)
# Create agent team with collaborative workflowteam=Swarm(researcher, summarizer)
result=Runners.sync_run(
input="Tell me a complete history about the universe",
swarm=team,
)
Agent Equipped with MCP Tools
importosfromaworld.agents.llm_agentimportAgentfromaworld.runnerimportRunnersmcp_config= {
"mcpServers": {
"GorillaFileSystem": {
"type": "stdio",
"command": "python",
"args": ["examples/BFCL/mcp_tools/gorilla_file_system.py"],
},
}
}
file_sys=Agent(
name="file_sys_agent",
system_prompt=(
"You are a helpful agent to use ""the standard file system to perform file operations."
),
mcp_servers=mcp_config.get("mcpServers", []).keys(),
mcp_config=mcp_config,
)
result=Runners.sync_run(
input=(
"use mcp tools in the GorillaFileSystem server ""to perform file operations: ""write the content 'AWorld' into ""the hello_world.py file with a new line ""and keep the original content of the file. ""Make sure the new and old ""content are all in the file; ""and display the content of the file"
),
agent=file_sys,
)
Agent Integrated with Memory
It is recommended to use MemoryFactory to initialize and access Memory instances.
"""Leader-Executor topology: ┌───── plan ───┐ exec1 exec2Each agent communicates with a single supervisor agent, well recognized as Leader-Executor topology, also referred to as a team topology in Aworld."""fromaworld.agents.llm_agentimportAgentfromaworld.core.agent.swarmimportTeamSwarmplan=Agent(name="plan", conf=agent_conf)
exec1=Agent(name="exec1", conf=agent_conf)
exec2=Agent(name="exec2", conf=agent_conf)
swarm=TeamSwarm(plan, exec1, exec2)
Optionally, you can use Handsoff mechanism to customize your own topology.
AWorld provides a comprehensive environment that supports a diverse array of applications, such as Product Prototype Verification, Foundational Model Training, and the design of Multi-Agent Systems (MAS) through meta-learning.
This framework is engineered to be highly adaptable, enabling researchers and developers to explore and innovate across multiple domains, thereby advancing the capabilities and applications of multi-agent systems.
Define the foundational classes, descriptions, output parsing, and multi-agent collaboration (swarm) logic for defining, managing, and orchestrating agents in the AWorld system.
Contains runner classes that manage the execution loop for agents in environments, handling episode rollouts and parallel training/evaluation workflows.
Feature a comprehensive context management system for AWorld agents, enabling complete state tracking, configuration management, prompt optimization, multi-task state handling, and dynamic prompt templating throughout the agent lifecycle.
Feature an observable tracing framework for AWorld, enabling distributed tracing, context propagation, span management, and integration with popular frameworks and protocols to monitor and analyze agent, tool, and task execution.
💡 Check the examples directory to explore diverse AWorld applications.
Agent Construction
Topology Orchestration
Environment
✅ Integrated MCP services
✅ Encapsulated runtime
✅ Runtime state management
✅ Multi-model providers
✅ Flexible MAS patterns
✅ High-concurrency support
✅ Customization options
✅ Clear state tracing
✅ Distributed training
Here is a forward illustration to collect BFCL forward trajectories: tutorial.
During training, an action-state rollout demonstration using AWorld's distributed environments.
Note
An illustration of training code that seamlessly integrates the RL learning framework (Swift, in this example) with AWorld as the environment is shown below. This integration enables scalable and efficient agent training through distributed environment execution. (To run high-concurrency rollouts, you need to deploy an online distributed environment. Please contact [email protected] if assistance is needed.)
🌏 Click to View Tutorial Example
To apply and use this integration:
cd ms-swift/patches
git apply 0001-feat-add-agent-training-support-with-aworld-server.patch
AWorld allows you to construct agents and multi-agent systems with ease.
Multi-Agent Systems for Model Evolutions
AWorld aims to reach the limitations of models and continuously push intelligence forward by constructing diverse runtime environments, such as tools, agents, and models,
The following is a list of successful proposal (with open-source models, technical reports, and code):
Multi-Agent Systems for Applications
AWorld's plug-and-play MAS architecture enables real-world web application development beyond agent training.
Build production-ready systems that handle complex tasks through:
We warmly welcome developers to join us in building and improving AWorld! Whether you're interested in enhancing the framework, fixing bugs, or adding new features, your contributions are valuable to us.
For academic citations or wish to contact us, please use the following BibTeX entry:
@software{aworld2025,
author = {Agent Team at InclusionAI},
title = {AWorld: Enabling Agent Self-Improvement through Interactive Experience with Dynamic Runtime},
year = {2025},
url = {https://github.com/inclusionAI/AWorld},
version = {0.1.0},
publisher = {GitHub},
email = {chenyi.zcy at antgroup.com}
}
Create your first agnet in agent_deploy/my_first_agent:
__init__.py: Create empty __ini__.py file.
cd agent_deploy/my_first_agent
touch __init__.py
agent.py: Define your agent logic:
importloggingimportosfromaworld.cmd.data_modelimportBaseAWorldAgent, ChatCompletionRequestfromaworld.config.confimportAgentConfig, TaskConfigfromaworld.agents.llm_agentimportAgentfromaworld.core.taskimportTaskfromaworld.runnerimportRunnerslogger=logging.getLogger(__name__)
classAWorldAgent(BaseAWorldAgent):
def__init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
defname(self):
return"My First Agent"defdescription(self):
return"A helpful assistant that can answer questions and help with tasks"asyncdefrun(self, prompt: str=None, request: ChatCompletionRequest=None):
# Load LLM configuration from environment variablesagent_config=AgentConfig(
llm_provider=os.getenv("LLM_PROVIDER", "openai"),
llm_model_name=os.getenv("LLM_MODEL_NAME", "gpt-4"),
llm_api_key=os.getenv("LLM_API_KEY"),
llm_base_url=os.getenv("LLM_BASE_URL"),
llm_temperature=float(os.getenv("LLM_TEMPERATURE", "0.7"))
)
# Validate required configurationifnotagent_config.llm_model_nameornotagent_config.llm_api_key:
raiseValueError("LLM_MODEL_NAME and LLM_API_KEY must be set!")
# Optional: Configure MCP tools for enhanced capabilitiesmcp_config= {
"mcpServers": {
"amap-mcp": {
"type": "sse",
"url": "https://mcp.example.com/sse?key=YOUR_API_KEY", # Replace Your API Key"timeout": 30,
"sse_read_timeout": 300
}
}
}
# Create the agent instanceagent=Agent(
conf=agent_config,
name="My First Agent",
system_prompt="""You are a helpful AI assistant. Your goal is to: - Answer questions accurately and helpfully - Provide clear, step-by-step guidance when needed - Be friendly and professional in your responses""",
mcp_servers=["amap-mcp"],
mcp_config=mcp_config
)
# Extract user inputuser_input=promptor (request.messages[-1].contentifrequestelse"")
# Create and execute tasktask=Task(
input=user_input,
agent=agent,
conf=TaskConfig(max_steps=5),
session_id=getattr(request, 'session_id', None)
)
# Stream the agent's responseasyncforoutputinRunners.streamed_run_task(task).stream_events():
yieldoutput
Setup environment variables:
# Navigate back to project rootcd${agent-project-root-dir}# Set your LLM credentialsexport LLM_MODEL_NAME="gpt-4"export LLM_API_KEY="your-api-key-here"export LLM_BASE_URL="https://api.openai.com/v1"# Optional for OpenAI
Launch Your Agent:
# Option 1: Launch with Web UI
aworld web
# Then open http://localhost:8000 in your browser# Option 2: Launch REST API (For integrations)
aworld api_server
# Then visit http://localhost:8000/docs for API documentation
Success! Your agent is now running and ready to chat!