+
+
+ {% trans %}Back to top{% endtrans %}
+
+
+ {% block content %}{{ body }}{% endblock %}
+
+
+
+
+ {% if theme_top_of_page_button != "edit" -%}
+ {{ warning("Got configuration for 'top_of_page_button': this is deprecated.") }}
+ {%- endif -%}
+
+ {%- if theme_top_of_page_buttons == "" -%}
+ {% if theme_top_of_page_button == None -%}
+ {#- We respect the old configuration of disabling all the buttons -#}
+ {%- set theme_top_of_page_buttons = [] -%}
+ {% else %}
+ {%- set theme_top_of_page_buttons = ["view", "edit"] -%}
+ {%- endif -%}
+ {% else -%}
+ {% if theme_top_of_page_button != "edit" -%}
+ {%- set theme_top_of_page_buttons = [] -%}
+ {{ warning("Got configuration for both 'top_of_page_button' and 'top_of_page_buttons', ignoring both and removing all top of page buttons.") }}
+ {%- endif -%}
+ {%- endif -%}
+ {%- include "components/language-switch.html" with context -%}
+ {% for button in theme_top_of_page_buttons -%}
+ {% if button == "view" %}
+ {%- include "components/view-this-page.html" with context -%}
+ {% elif button == "edit" %}
+ {%- include "components/edit-this-page.html" with context -%}
+ {% else %}
+ {{ warning("Got an unsupported value in 'top_of_page_buttons' for theme configuration") }}
+ {% endif %}
+ {%- endfor -%}
+ {#- Theme toggle -#}
+
+
+
+
+
+
+
|
|
+
+
+
+## 📑 Table of Contents
+
+- [Quickstart](#quickstart)
+ - [Installation](#installation)
+ - [From PyPI](#from-pypi)
+ - [From source](#from-source)
+- [Example](#example)
+ - [Hello AgentScope!](#hello-agentscope)
+ - [Voice Agent](#voice-agent)
+ - [Realtime Voice Agent](#realtime-voice-agent)
+ - [Human-in-the-loop](#human-in-the-loop)
+ - [Flexible MCP Usage](#flexible-mcp-usage)
+ - [Agentic RL](#agentic-rl)
+ - [Multi-Agent Workflows](#multi-agent-workflows)
+- [Documentation](#documentation)
+- [More Examples & Samples](#more-examples--samples)
+ - [Functionality](#functionality)
+ - [Agent](#agent)
+ - [Game](#game)
+ - [Workflow](#workflow)
+ - [Evaluation](#evaluation)
+ - [Tuner](#tuner)
+- [Contributing](#contributing)
+- [License](#license)
+- [Publications](#publications)
+- [Contributors](#contributors)
+
+
+
+## Quickstart
+
+### Installation
+
+> AgentScope requires **Python 3.10** or higher.
+
+#### From PyPI
+
+```bash
+pip install agentscope
+```
+
+Or with uv:
+
+```bash
+uv pip install agentscope
+```
+
+#### From source
+
+```bash
+# Pull the source code from GitHub
+git clone -b main https://github.com/agentscope-ai/agentscope.git
+
+# Install the package in editable mode
+cd agentscope
+
+pip install -e .
+# or with uv:
+# uv pip install -e .
+```
+
+
+## Example
+
+### Hello AgentScope!
+
+Start with a conversation between user and a ReAct agent 🤖 named "Friday"!
+
+```python
+from agentscope.agent import ReActAgent, UserAgent
+from agentscope.model import DashScopeChatModel
+from agentscope.formatter import DashScopeChatFormatter
+from agentscope.memory import InMemoryMemory
+from agentscope.tool import Toolkit, execute_python_code, execute_shell_command
+import os, asyncio
+
+
+async def main():
+ toolkit = Toolkit()
+ toolkit.register_tool_function(execute_python_code)
+ toolkit.register_tool_function(execute_shell_command)
+
+ agent = ReActAgent(
+ name="Friday",
+ sys_prompt="You're a helpful assistant named Friday.",
+ model=DashScopeChatModel(
+ model_name="qwen-max",
+ api_key=os.environ["DASHSCOPE_API_KEY"],
+ stream=True,
+ ),
+ memory=InMemoryMemory(),
+ formatter=DashScopeChatFormatter(),
+ toolkit=toolkit,
+ )
+
+ user = UserAgent(name="user")
+
+ msg = None
+ while True:
+ msg = await agent(msg)
+ msg = await user(msg)
+ if msg.get_text_content() == "exit":
+ break
+
+asyncio.run(main())
+```
+
+### Voice Agent
+
+Create a voice-enabled ReAct agent that can understand and respond with speech, even playing a multi-agent werewolf game with voice interactions.
+
+
+https://github.com/user-attachments/assets/c5f05254-aff6-4375-90df-85e8da95d5da
+
+
+### Realtime Voice Agent
+
+Build a realtime voice agent with web interface that can interact with users via voice input and output.
+
+[Realtime chatbot](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/realtime_voice_agent) | [Realtime Multi-Agent Example](https://github.com/agentscope-ai/agentscope/tree/main/examples/workflows/multiagent_realtime)
+
+https://github.com/user-attachments/assets/1b7b114b-e995-4586-9b3f-d3bb9fcd2558
+
+
+
+### Human-in-the-loop
+
+Support realtime interruption in ReActAgent: conversation can be interrupted via cancellation in realtime and resumed
+seamlessly via robust memory preservation.
+
+
+
+### Flexible MCP Usage
+
+Use individual MCP tools as **local callable functions** to compose toolkits or wrap into a more complex tool.
+
+```python
+from agentscope.mcp import HttpStatelessClient
+from agentscope.tool import Toolkit
+import os
+
+async def fine_grained_mcp_control():
+ # Initialize the MCP client
+ client = HttpStatelessClient(
+ name="gaode_mcp",
+ transport="streamable_http",
+ url=f"https://mcp.amap.com/mcp?key={os.environ['GAODE_API_KEY']}",
+ )
+
+ # Obtain the MCP tool as a **local callable function**, and use it anywhere
+ func = await client.get_callable_function(func_name="maps_geo")
+
+ # Option 1: Call directly
+ await func(address="Tiananmen Square", city="Beijing")
+
+ # Option 2: Pass to agent as a tool
+ toolkit = Toolkit()
+ toolkit.register_tool_function(func)
+ # ...
+
+ # Option 3: Wrap into a more complex tool
+ # ...
+```
+
+### Agentic RL
+
+Train your agentic application seamlessly with Reinforcement Learning integration. We also prepare multiple sample projects covering various scenarios:
+
+| Example | Description | Model | Training Result |
+|--------------------------------------------------------------------------------------------------|-------------------------------------------------------------|------------------------|-----------------------------|
+| [Math Agent](https://github.com/agentscope-ai/agentscope-samples/tree/main/tuner/math_agent) | Tune a math-solving agent with multi-step reasoning. | Qwen3-0.6B | Accuracy: 75% → 85% |
+| [Frozen Lake](https://github.com/agentscope-ai/agentscope-samples/tree/main/tuner/frozen_lake) | Train an agent to navigate the Frozen Lake environment. | Qwen2.5-3B-Instruct | Success rate: 15% → 86% |
+| [Learn to Ask](https://github.com/agentscope-ai/agentscope-samples/tree/main/tuner/learn_to_ask) | Tune agents using LLM-as-a-judge for automated feedback. | Qwen2.5-7B-Instruct | Accuracy: 47% → 92% |
+| [Email Search](https://github.com/agentscope-ai/agentscope-samples/tree/main/tuner/email_search) | Improve tool-use capabilities without labeled ground truth. | Qwen3-4B-Instruct-2507 | Accuracy: 60% |
+| [Werewolf Game](https://github.com/agentscope-ai/agentscope-samples/tree/main/tuner/werewolves) | Train agents for strategic multi-agent game interactions. | Qwen2.5-7B-Instruct | Werewolf win rate: 50% → 80% |
+| [Data Augment](https://github.com/agentscope-ai/agentscope-samples/tree/main/tuner/data_augment) | Generate synthetic training data to enhance tuning results. | Qwen3-0.6B | AIME-24 accuracy: 20% → 60% |
+
+### Multi-Agent Workflows
+
+AgentScope provides ``MsgHub`` and pipelines to streamline multi-agent conversations, offering efficient message routing and seamless information sharing
+
+```python
+from agentscope.pipeline import MsgHub, sequential_pipeline
+from agentscope.message import Msg
+import asyncio
+
+async def multi_agent_conversation():
+ # Create agents
+ agent1 = ...
+ agent2 = ...
+ agent3 = ...
+ agent4 = ...
+
+ # Create a message hub to manage multi-agent conversation
+ async with MsgHub(
+ participants=[agent1, agent2, agent3],
+ announcement=Msg("Host", "Introduce yourselves.", "assistant")
+ ) as hub:
+ # Speak in a sequential manner
+ await sequential_pipeline([agent1, agent2, agent3])
+ # Dynamic manage the participants
+ hub.add(agent4)
+ hub.delete(agent3)
+ await hub.broadcast(Msg("Host", "Goodbye!", "assistant"))
+
+asyncio.run(multi_agent_conversation())
+```
+
+
+## Documentation
+
+- [Tutorial](https://doc.agentscope.io/tutorial/)
+- [FAQ](https://doc.agentscope.io/tutorial/faq.html)
+- [API Docs](https://doc.agentscope.io/api/agentscope.html)
+
+## More Examples & Samples
+
+### Functionality
+
+- [MCP](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/mcp)
+- [Anthropic Agent Skill](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/agent_skill)
+- [Plan](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/plan)
+- [Structured Output](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/structured_output)
+- [RAG](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/rag)
+- [Long-Term Memory](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/long_term_memory)
+- [Session with SQLite](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/session_with_sqlite)
+- [Stream Printing Messages](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/stream_printing_messages)
+- [TTS](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/tts)
+- [Code-first Deployment](https://github.com/agentscope-ai/agentscope/tree/main/examples/deployment/planning_agent)
+- [Memory Compression](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/short_term_memory/memory_compression)
+
+### Agent
+
+- [ReAct Agent](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/react_agent)
+- [Voice Agent](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/voice_agent)
+- [Deep Research Agent](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/deep_research_agent)
+- [Browser-use Agent](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/browser_agent)
+- [Meta Planner Agent](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/meta_planner_agent)
+- [A2A Agent](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/a2a_agent)
+- [Realtime Voice Agent](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/realtime_voice_agent)
+
+### Game
+
+- [Nine-player Werewolves](https://github.com/agentscope-ai/agentscope/tree/main/examples/game/werewolves)
+
+### Workflow
+
+- [Multi-agent Debate](https://github.com/agentscope-ai/agentscope/tree/main/examples/workflows/multiagent_debate)
+- [Multi-agent Conversation](https://github.com/agentscope-ai/agentscope/tree/main/examples/workflows/multiagent_conversation)
+- [Multi-agent Concurrent](https://github.com/agentscope-ai/agentscope/tree/main/examples/workflows/multiagent_concurrent)
+- [Multi-agent Realtime Conversation](https://github.com/agentscope-ai/agentscope/tree/main/examples/workflows/multiagent_realtime)
+
+### Evaluation
+
+- [ACEBench](https://github.com/agentscope-ai/agentscope/tree/main/examples/evaluation/ace_bench)
+
+### Tuner
+
+- [Tune ReAct Agent](https://github.com/agentscope-ai/agentscope/tree/main/examples/tuner/react_agent)
+
+
+## Contributing
+
+We welcome contributions from the community! Please refer to our [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines
+on how to contribute.
+
+## License
+
+AgentScope is released under Apache License 2.0.
+
+## Publications
+
+If you find our work helpful for your research or application, please cite our papers.
+
+- [AgentScope 1.0: A Developer-Centric Framework for Building Agentic Applications](https://arxiv.org/abs/2508.16279)
+
+- [AgentScope: A Flexible yet Robust Multi-Agent Platform](https://arxiv.org/abs/2402.14034)
+
+```
+@article{agentscope_v1,
+ author = {Dawei Gao, Zitao Li, Yuexiang Xie, Weirui Kuang, Liuyi Yao, Bingchen Qian, Zhijian Ma, Yue Cui, Haohao Luo, Shen Li, Lu Yi, Yi Yu, Shiqi He, Zhiling Luo, Wenmeng Zhou, Zhicheng Zhang, Xuguang He, Ziqian Chen, Weikai Liao, Farruh Isakulovich Kushnazarov, Yaliang Li, Bolin Ding, Jingren Zhou}
+ title = {AgentScope 1.0: A Developer-Centric Framework for Building Agentic Applications},
+ journal = {CoRR},
+ volume = {abs/2508.16279},
+ year = {2025},
+}
+
+@article{agentscope,
+ author = {Dawei Gao, Zitao Li, Xuchen Pan, Weirui Kuang, Zhijian Ma, Bingchen Qian, Fei Wei, Wenhao Zhang, Yuexiang Xie, Daoyuan Chen, Liuyi Yao, Hongyi Peng, Zeyu Zhang, Lin Zhu, Chen Cheng, Hongzhu Shi, Yaliang Li, Bolin Ding, Jingren Zhou}
+ title = {AgentScope: A Flexible yet Robust Multi-Agent Platform},
+ journal = {CoRR},
+ volume = {abs/2402.14034},
+ year = {2024},
+}
+```
+
+## Contributors
+
+All thanks to our contributors:
+
+
+
+
+### 灵活的 MCP 控制
+
+AgentScope 支持将单个 MCP 工具作为**本地可调用函数**使用,装备给智能体或封装为更复杂的工具。
+
+```python
+from agentscope.mcp import HttpStatelessClient
+from agentscope.tool import Toolkit
+import os
+
+async def fine_grained_mcp_control():
+ # 以高德MCP为例,初始化MCP客户端
+ client = HttpStatelessClient(
+ name="gaode_mcp",
+ transport="streamable_http",
+ url=f"https://mcp.amap.com/mcp?key={os.environ['GAODE_API_KEY']}",
+ )
+
+ # 将 MCP 工具获取为**本地可调用函数**,并在任何地方使用
+ func = await client.get_callable_function(func_name="maps_geo")
+
+ # 选项 1:直接调用
+ await func(address="天安门广场", city="北京")
+
+ # 选项 2:作为工具传递给智能体
+ toolkit = Toolkit()
+ toolkit.register_tool_function(func)
+ # ...
+
+ # 选项 3:包装为更复杂的工具
+ # ...
+```
+
+### 智能体强化学习
+
+通过强化学习集成无缝训练智能体应用。我们还准备了涵盖各种场景的样例项目:
+
+| 样例 | 描述 | 模型 | 训练结果 |
+|--------------------------------------------------------------------------------------------------|----------------------------|------------------------|-----------------------------|
+| [Math Agent](https://github.com/agentscope-ai/agentscope-samples/tree/main/tuner/math_agent) | 通过多步推理调优数学求解智能体。 | Qwen3-0.6B | Accuracy: 75% → 85% |
+| [Frozen Lake](https://github.com/agentscope-ai/agentscope-samples/tree/main/tuner/frozen_lake) | 训练智能体进行冰湖游戏。 | Qwen2.5-3B-Instruct | Success rate: 15% → 86% |
+| [Learn to Ask](https://github.com/agentscope-ai/agentscope-samples/tree/main/tuner/learn_to_ask) | 使用 LLM 作为评判获得自动反馈,从而调优智能体。 | Qwen2.5-7B-Instruct | Accuracy: 47% → 92% |
+| [Email Search](https://github.com/agentscope-ai/agentscope-samples/tree/main/tuner/email_search) | 在训练数据没有标注真值的情况下提升工具使用能力。 | Qwen3-4B-Instruct-2507 | Accuracy: 60% |
+| [Werewolf Game](https://github.com/agentscope-ai/agentscope-samples/tree/main/tuner/werewolves) | 训练智能体进行战略性多智能体游戏互动。 | Qwen2.5-7B-Instruct | 狼人胜率:50% → 80% |
+| [Data Augment](https://github.com/agentscope-ai/agentscope-samples/tree/main/tuner/data_augment) | 生成合成训练数据以增强调优结果。 | Qwen3-0.6B | AIME-24 accuracy: 20% → 60% |
+
+### 多智能体工作流
+
+AgentScope 提供 ``MsgHub`` 和 pipeline 来简化多智能体对话,提供高效的消息路由和无缝信息共享
+
+```python
+from agentscope.pipeline import MsgHub, sequential_pipeline
+from agentscope.message import Msg
+import asyncio
+
+async def multi_agent_conversation():
+ # 创建智能体
+ agent1 = ...
+ agent2 = ...
+ agent3 = ...
+ agent4 = ...
+
+ # 创建消息中心来管理多智能体对话
+ async with MsgHub(
+ participants=[agent1, agent2, agent3],
+ announcement=Msg("Host", "请介绍一下自己。", "assistant")
+ ) as hub:
+ # 按顺序发言
+ await sequential_pipeline([agent1, agent2, agent3])
+ # 动态管理参与者
+ hub.add(agent4)
+ hub.delete(agent3)
+ await hub.broadcast(Msg("Host", "再见!", "assistant"))
+
+asyncio.run(multi_agent_conversation())
+```
+
+
+## 文档
+
+- [教程](https://doc.agentscope.io/zh_CN/tutorial/)
+- [常见问题](https://doc.agentscope.io/zh_CN/tutorial/faq.html)
+- [API 文档](https://doc.agentscope.io/zh_CN/api/agentscope.html)
+
+## 更多样例
+
+### 功能
+
+- [MCP](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/mcp)
+- [Anthropic 智能体技能](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/agent_skill)
+- [计划](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/plan)
+- [结构化输出](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/structured_output)
+- [RAG](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/rag)
+- [长期记忆](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/long_term_memory)
+- [基于 SQLite 的会话管理](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/session_with_sqlite)
+- [流式打印消息](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/stream_printing_messages)
+- [TTS](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/tts)
+- [高代码部署](https://github.com/agentscope-ai/agentscope/tree/main/examples/deployment/planning_agent)
+- [记忆压缩](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/short_term_memory/memory_compression)
+
+### 智能体
+
+- [ReAct 智能体](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/react_agent)
+- [语音智能体](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/voice_agent)
+- [Deep Research 智能体](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/deep_research_agent)
+- [Browser-use 智能体](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/browser_agent)
+- [Meta Planner 智能体](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/meta_planner_agent)
+- [A2A 智能体](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/a2a_agent)
+- [实时语音交互智能体](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/realtime_voice_agent)
+
+### 游戏
+
+- [九人制狼人杀](https://github.com/agentscope-ai/agentscope/tree/main/examples/game/werewolves)
+
+### 工作流
+
+- [多智能体辩论](https://github.com/agentscope-ai/agentscope/tree/main/examples/workflows/multiagent_debate)
+- [多智能体对话](https://github.com/agentscope-ai/agentscope/tree/main/examples/workflows/multiagent_conversation)
+- [多智能体并发](https://github.com/agentscope-ai/agentscope/tree/main/examples/workflows/multiagent_concurrent)
+- [多智能体实时语音交互](https://github.com/agentscope-ai/agentscope/tree/main/examples/workflows/multiagent_realtime)
+
+### 评估
+
+- [ACEBench](https://github.com/agentscope-ai/agentscope/tree/main/examples/evaluation/ace_bench)
+
+### 微调
+
+- [调优 ReAct 智能体](https://github.com/agentscope-ai/agentscope/tree/main/examples/tuner/react_agent)
+
+
+## 贡献
+
+我们欢迎社区的贡献!请参阅我们的 [贡献指南](./CONTRIBUTING_zh.md) 了解如何贡献到 AgentScope。
+
+## 许可
+
+AgentScope 基于 Apache License 2.0 发布。
+
+## 论文
+
+如果我们的工作对您的研究或应用有帮助,请引用我们的论文。
+
+- [AgentScope 1.0: A Developer-Centric Framework for Building Agentic Applications](https://arxiv.org/abs/2508.16279)
+
+- [AgentScope: A Flexible yet Robust Multi-Agent Platform](https://arxiv.org/abs/2402.14034)
+
+```
+@article{agentscope_v1,
+ author = {Dawei Gao, Zitao Li, Yuexiang Xie, Weirui Kuang, Liuyi Yao, Bingchen Qian, Zhijian Ma, Yue Cui, Haohao Luo, Shen Li, Lu Yi, Yi Yu, Shiqi He, Zhiling Luo, Wenmeng Zhou, Zhicheng Zhang, Xuguang He, Ziqian Chen, Weikai Liao, Farruh Isakulovich Kushnazarov, Yaliang Li, Bolin Ding, Jingren Zhou},
+ title = {AgentScope 1.0: A Developer-Centric Framework for Building Agentic Applications},
+ journal = {CoRR},
+ volume = {abs/2508.16279},
+ year = {2025},
+}
+
+@article{agentscope,
+ author = {Dawei Gao, Zitao Li, Xuchen Pan, Weirui Kuang, Zhijian Ma, Bingchen Qian, Fei Wei, Wenhao Zhang, Yuexiang Xie, Daoyuan Chen, Liuyi Yao, Hongyi Peng, Zeyu Zhang, Lin Zhu, Chen Cheng, Hongzhu Shi, Yaliang Li, Bolin Ding, Jingren Zhou},
+ title = {AgentScope: A Flexible yet Robust Multi-Agent Platform},
+ journal = {CoRR},
+ volume = {abs/2402.14034},
+ year = {2024},
+}
+```
+
+## 贡献者
+
+感谢所有贡献者:
+
+
+
+
+