README_zh.md
English Homepage | 文档 | 路线图
</span> <p align="center"> <a href="https://arxiv.org/abs/2402.14034"></a>
<a href="https://pypi.org/project/agentscope/">
</a>
<a href="https://pypi.org/project/agentscope/">
</a>
<a href="https://discord.gg/eYMpfnkG8h">
</a>
<a href="./LICENSE">
</a>
AgentScope 2.0 是一款面向生产、易于使用的智能体框架,提供与不断进化的模型能力相匹配的核心抽象。
我们为日益自主的大语言模型而设计。 我们的方法是充分发挥模型的推理与工具调用能力, 而不是用严格的提示词和固化的编排方式来束缚它们。
欢迎加入我们的社区
| Discord | 钉钉 |
|---|---|
AgentScope 需要 Python 3.11 或更高版本。
uv pip install agentscope
# 或者
# pip install agentscope
# 从 GitHub 拉取源码
git clone -b main https://github.com/agentscope-ai/agentscope.git
# 以可编辑模式安装
cd agentscope
uv pip install -e .
# 或者
# pip install -e .
使用 AgentScope 2.0,启动你的第一个智能体:
from agentscope.agent import Agent
from agentscope.tool import Toolkit, Bash, Grep, Glob, Read, Write, Edit
from agentscope.credential import DashScopeCredential
from agentscope.model import DashScopeChatModel
from agentscope.message import UserMsg
from agentscope.event import EventType
import os, asyncio
async def main() -> None:
agent = Agent(
name="Friday",
system_prompt="You're a helpful assistant named Friday.",
model=DashScopeChatModel(
credential=DashScopeCredential(
api_key=os.environ["DASHSCOPE_API_KEY"]
),
model="qwen3.6-plus",
),
toolkit=Toolkit(
tools=[
Bash(),
Grep(),
Glob(),
Read(),
Write(),
Edit(),
]
),
)
async for evt in agent.reply_stream(UserMsg("Tony", "Hi, Friday!")):
# 处理事件流,例如打印消息、更新 UI 等
match evt.type:
case EventType.REPLY_START:
...
case EventType.MODEL_CALL_START:
...
case EventType.TEXT_BLOCK_START:
...
case EventType.TEXT_BLOCK_DELTA:
...
case EventType.TEXT_BLOCK_END:
...
# 处理其他事件类型
asyncio.run(main())
一个基于 FastAPI 的可扩展多租户、多会话智能体服务,并在 examples/web_ui 中提供预构建的 Web UI
<sub><b>智能体团队</b> —— leader 智能体派生 worker,并通过内置的团队工具进行协调。</sub>
</td>
<sub><b>任务规划</b> —— 智能体将复杂工作拆解为可追踪的计划,并在执行过程中持续更新。</sub>
</td>
<sub><b>bypass 模式下的权限控制</b> —— 智能体端到端运行,无需为工具调用确认而暂停。</sub>
</td>
<sub><b>工具后台执行</b> —— 长时间运行的工具被转入后台;其结果稍后唤醒智能体并恢复对话。</sub>
</td>
运行以下命令启动智能体服务后端和 Web UI:
git clone -b main https://github.com/agentscope-ai/agentscope.git
cd agentscope/examples/agent_service
# 启动智能体服务后端
python main.py
然后打开另一个终端启动 Web UI:
cd agentscope/examples/web_ui
# 启动 webui
pnpm install
pnpm dev
我们欢迎社区的贡献!请参阅我们的 贡献指南 了解如何贡献。
AgentScope 基于 Apache License 2.0 发布。
如果我们的工作对您的研究或应用有帮助,请引用我们的论文。
@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},
}
感谢所有贡献者:
<a href="https://github.com/agentscope-ai/agentscope/graphs/contributors"> </a>