Co-Pilot / 辅助式
更新于 24 days ago

aworld

IinclusionAI
1.1k
inclusionai/aworld
80
Agent 评分

💡 摘要

AWorld使得在丰富环境中创建不断进化的智能代理成为可能。

🎯 适合人群

人工智能研究人员构建智能系统的开发者专注于基于代理模型的数据科学家人工智能和机器学习领域的教育工作者探索先进人工智能能力的科技爱好者

🤖 AI 吐槽:看起来很能打,但别让配置把人劝退。

安全分析中风险

风险:Medium。建议检查:是否执行 shell/命令行指令;是否发起外网请求(SSRF/数据外发);API Key/Token 的获取、存储与泄露风险;文件读写范围与路径穿越风险;依赖锁定与供应链风险。以最小权限运行,并在生产环境启用前审计代码与依赖。

AWorld: Rich Environments, Intelligent Agents, Continuous Evolution

"Self-awareness: the hardest problem isn't solving within limits, it's discovering one's own limitations"

[![Twitter Follow][twitter-image]][twitter-url] [![WeChat QR Code][wechat-image]][wechat-url] [![Discord][discord-image]][discord-url] [![License: MIT][license-image]][license-url] [![DeepWiki][deepwiki-image]][deepwiki-url] [![arXiv][arxiv-image]][arxiv-url] [![Tutorial][tutorial-image]][tutorial-url] [![Playground][playground-image]][playground-url]

中文版 | Installation | Environments | Agent | Experience | Training | Architecture | Evolution | Contributing |


AWorld (Agent World) builds intelligent agents and rich environments where they operate, pushing the frontiers of AI capabilities and enabling continuous evolution. This project provides the fundamental recipe for agentic learning: Environment Access, Agent Construction, Experience Retrieval, and Model Training. What makes AWorld powerful is that agents can use these same components to automatically improve themselves.

💡 Visit our homepage for more details, or try our online environments and agents.

Installation

[!TIP] Python>=3.11

git clone https://github.com/inclusionAI/AWorld && cd AWorld pip install -e .

Online Access to Complex Environments

Provisioning rich environments is hard—packages conflict, APIs need keys, concurrency must scale. We make it painless with three access modes:

  1. Use our default hosted setup (tooling with usage costs includes a limited free tier).
  2. Bring your own API keys for unrestricted access (coming soon).
  3. Pull our Docker images and run everything on your own infrastructure (coming soon).
import os import asyncio from aworld.sandbox import Sandbox INVITATION_CODE = os.environ.get("INVITATION_CODE", "") mcp_config = { "mcpServers": { "gaia_server": { "type": "streamable-http", "url": "https://playground.aworldagents.com/environments/mcp", "timeout": 600, "sse_read_timeout": 600, "headers": { "ENV_CODE": "gaia", "Authorization": f"Bearer {INVITATION_CODE}", } } } } async def _list_tools(): sand_box = Sandbox(mcp_config=mcp_config, mcp_servers=["gaia_server"]) return await sand_box.mcpservers.list_tools() if __name__ == "__main__": tools = asyncio.run(_list_tools()) print(tools)

Efficient Agent Construction

In Aworld, an agent is simply a model enhanced with tools. To spin one up, you only need:

  1. a model endpoint (for training, a vLLM service works great)
  2. an online environment to call (use our hosted options or plug in your own MCP toolchain) That’s it—no heavyweight scaffolding required.
from aworld.agents.llm_agent import Agent from aworld.runner import Runners # refer the section above for details mcp_config = {...} searcher = Agent( name="Search Agent", system_prompt="You specialize at searching.", mcp_config=mcp_config ) if __name__ == "__main__": result = Runners.sync_run( input="Use google search tool to answer the question: the news about AI today.", agent=searcher ) print(f"answer: {result.answer}")

Remember to plug in your LLM credentials first.

# Set LLM credentials export LLM_MODEL_NAME="gpt-4" export LLM_API_KEY="your-api-key-here" export LLM_BASE_URL="https://api.openai.com/v1"

Complex Agent System Construction

Real-world problems often need more than a single agent. AWorld gives you flexible build paths:

  1. design automated workflows end to end Docs
  2. spin up MCP-enabled agents Docs
  3. orchestrate multi-agent systems (MAS) Docs

Want to see it live? Load a pre-built DeepResearch team in the AWorld Playground, inspect the source, and run it end to end.

Experience to samples

Our runtime captures every step across offline and online runs. Each task yields a complete trajectory—every LLM call, action, and reward—so you can synthesize training samples, audit performance, and iterate with confidence.

Complete Task Trajectories

Tasks unfold over many LLM calls. The framework captures every step, giving you a full trajectory.

import asyncio from aworld.runner import Runners from aworld.core.task import Task from aworld.logs.util import logger import json # refer the section above for agent constrution searcher = Agent(...) if __name__ == "__main__": async def test_complete_trajectory(): task = Task( input="Use google search tool to answer the question: the news about AI today.", agent=searcher ) responses = await Runners.run_task(task) resp = responses[task.id] logger.info(f"task answer: {resp.answer}") logger.info(f"task trajectory: {json.dumps(resp.trajectory, ensure_ascii=False)}") asyncio.run(test_complete_trajectory())

Single-Step Introspection

Need finer control? Call step() to inspect one action/response pair at a time. This lets you inject intermediate rewards during training, enabling richer, more flexible learning signals.

import os import asyncio from aworld.runner import Runners from aworld.core.task import Task from aworld.logs.util import logger import json from aworld.config import TaskConfig, TaskRunMode # refer the section above for agent constrution searcher = Agent(...) if __name__ == "__main__": async def test_single_step_introspection(): task = Task( input="Use google search tool to answer the question: the news about AI today.", agent=searcher, conf=TaskConfig( resp_carry_context=True, run_mode=TaskRunMode.INTERACTIVE ) ) trajectory_log = os.path.join(os.path.dirname(__file__), "trajectory_log.txt") is_finished = False step = 1 while not is_finished: with open(trajectory_log, "a", encoding="utf-8") as traj_file: is_finished, observation, response = await Runners.step(task) traj_file.write(f"Step {step}\n") traj_file.write(json.dumps(response.trajectory, ensure_ascii=False, indent=2)) traj_file.write("\n\n") step += 1 asyncio.run(test_single_step_introspection())

Training

Once agents can roam across environments, AWorld closes the loop with two complementary training modes that drive continuous improvement.

Model Training

Plug any mainstream LLM trainer—AReal, Swift, Verl, Slime, etc.—into the runtime to update model parameters directly. Adapters are lightweight, so you can reuse the same environment and agent code across trainers.

from datasets import load_dataset from aworld.agents.llm_agent import Agent from aworld.config import AgentConfig from train.trainer.agent_trainer import AgentTrainer from train.examples.train_gaia_with_aworld_verl.metrics.gaia_reward_function import gaia_reward_func # refer the section above for details mcp_config = {...} # Configure agent to use Verl as the model service (adapts inference format automatically) agent_config = AgentConfig( llm_provider="verl" ) searcher = Agent( name="Search Agent", system_prompt="You specialize at searching.", mcp_config=mcp_config, conf=agent_config ) train_dataset = load_dataset("", split="train") test_dataset = load_dataset("", split="test") trainer = AgentTrainer( agent=agent, config=custom_train_config, reward_func=gaia_reward_func, train_dataset=train_dataset, test_dataset=test_dataset ) trainer.train()

💡 Check the real case which includes the full training config to run agentic training.

Meta-Learning

Beyond weights, you can meta-learn whole agent systems. Spin up role-specific agents that critique, rewrite prompts, refine workflow, or adjust strategies for a target agent, then iterate the team (e.g., our Gaia demo).

Architecture Design Principles

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.

Concepts & Framework

| Concepts | Description | | :-------------------------------------- | ------------ | | agent | Define the foundational classes, descriptions, output parsing, and multi-agent collaboration (swarm) logic for defining, managing, and orchestrating agents in the AWorld system. | | runner | Contains runner classes that manage the execution loop for agents in environments, handling episode rollouts and parallel training/evaluation workflows. | | task | Define the base Task class that encapsulates environment objectives, necessary tools, and termination co

五维分析
清晰度8/10
创新性8/10
实用性9/10
完整性8/10
可维护性7/10
优缺点分析

优点

  • 支持代理的持续进化
  • 灵活构建多代理系统
  • 全面跟踪代理性能
  • 与各种LLM训练器集成

缺点

  • 需要了解Python和人工智能概念
  • 安装可能涉及复杂的依赖关系
  • 高级功能的文档有限
  • 某些功能仍在开发中

相关技能

specweave

A
toolCo-Pilot / 辅助式
86/ 100

“就像有一个永不休息的私人助理,但确实需要Node.js才能运行。”

mgrep

A
toolCo-Pilot / 辅助式
86/ 100

“看起来很能打,但别让配置把人劝退。”

context-fundamentals

A
toolCo-Pilot / 辅助式
86/ 100

“这是你的智能体开始胡言乱语之前你希望拥有的教科书,但读了它也修不好那个bug。”

免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。

版权归原作者所有 inclusionAI.