agentscope-ai/agentscope

GitHub: agentscope-ai/agentscope

AgentScope 是一个生产级多智能体开发框架,提供工具调用、记忆管理、多智能体编排和强化学习微调能力,帮助开发者快速构建可观测、可部署的 AI Agent 应用。

Stars: 17145 | Forks: 1533

AgentScope Logo

[**中文主页**](https://github.com/agentscope-ai/agentscope/blob/main/README_zh.md) | [**教程**](https://doc.agentscope.io/) | [**路线图 (2026年1月 -)**](https://github.com/agentscope-ai/agentscope/blob/main/docs/roadmap.md) | [**常见问题**](https://doc.agentscope.io/tutorial/faq.html)

arxiv pypi pypi discord docs license

modelscope%2Fagentscope | Trendshift

## 什么是 AgentScope? AgentScope 是一个生产级、易用的智能体(Agent)框架,提供核心抽象以适配日益增强的模型能力,并内置微调(finetuning)支持。 我们为日益智能化的 LLM 而设计。 我们的方法利用模型的推理和工具使用能力, 而非通过严格的提示词(prompts)和固化的编排(orchestrations)来限制它们。 ## 为什么使用 AgentScope? - **简单**:5 分钟即可开始构建您的 Agent,内置 ReAct Agent、工具、技能、人机交互(human-in-the-loop)引导、记忆、规划、实时语音、评估和模型微调支持 - **可扩展**:大量工具、记忆和可观测性的生态集成;内置 MCP 和 A2A 支持;消息中心(message hub)支持灵活的多智能体编排和工作流 - **生产就绪**:支持本地部署、云端 Serverless 部署或 K8s 集群部署,内置 OTel 支持


The AgentScope Ecosystem

## 新闻 - **[2026-02] `FEAT`:** 实时语音 Agent 支持。[示例](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/realtime_voice_agent) | [多智能体实时示例](https://github.com/agentscope-ai/agentscope/tree/main/examples/workflows/multiagent_realtime) | [教程](https://doc.agentscope.io/tutorial/task_realtime.html) - **[2026-01] `COMM`:** 双周会议启动,分享生态更新和开发计划 —— 欢迎加入![详情与日程](https://github.com/agentscope-ai/agentscope/discussions/1126) - **[2026-01] `FEAT`:** 记忆模块中的数据库支持与记忆压缩。[示例](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/short_term_memory/memory_compression) | [教程](https://doc.agentscope.io/tutorial/task_memory.html) - **[2025-12] `INTG`:** A2A (Agent-to-Agent) 协议支持。[示例](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/a2a_agent) | [教程](https://doc.agentscope.io/tutorial/task_a2a.html) - **[2025-12] `FEAT`:** TTS (Text-to-Speech) 支持。[示例](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/tts) | [教程](https://doc.agentscope.io/tutorial/task_tts.html) - **[2025-11] `INTG`:** Anthropic Agent Skill 支持。[示例](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/agent_skill) | [教程](https://doc.agentscope.io/tutorial/task_agent_skill.html) - **[2025-11] `RELS`:** 用于多样化真实世界任务的 Alias-Agent 和用于数据处理的 Data-Juicer Agent 开源。[Alias-Agent](https://github.com/agentscope-ai/agentscope-samples/tree/main/alias) | [Data-Juicer Agent](https://github.com/agentscope-ai/agentscope-samples/tree/main/data_juicer_agent) - **[2025-11] `INTG`:** 通过 Trinity-RFT 库支持 Agentic RL。[示例](https://github.com/agentscope-ai/agentscope/tree/main/examples/tuner/react_agent) | [Trinity-RFT](https://github.com/agentscope-ai/Trinity-RFT) - **[2025-11] `INTG`:** 用于增强长期记忆的 ReMe。[示例](https://github.com/agentscope-ai/agentscope/tree/main/examples/functionality/long_term_memory/reme) - **[2025-11] `RELS`:** agentscope-samples 仓库发布,agentscope-runtime 升级,支持 Docker/K8s 部署和基于 VNC 的 GUI 沙箱。[Samples](https://github.com/agentscope-ai/agentscope-samples) | [Runtime](https://github.com/agentscope-ai/agentscope-runtime) [更多新闻 →](./docs/NEWS.md) ## 📑 目录 - [快速开始](#quickstart) - [安装](#installation) - [从 PyPI 安装](#from-pypi) - [从源码安装](#from-source) - [示例](#example) - [你好 AgentScope!](#hello-agentscope) - [语音 Agent](#voice-agent) - [实时语音 Agent](#realtime-voice-agent) - [人机交互](#human-in-the-loop) - [灵活的 MCP 使用](#flexible-mcp-usage) - [Agentic RL](#agentic-rl) - [多智能体工作流](#multi-agent-workflows) - [文档](#documentation) - [更多示例与样本](#more-examples--samples) - [功能](#functionality) - [智能体](#agent) - [游戏](#game) - [工作流](#workflow) - [评估](#evaluation) - [调优器](#tuner) - [贡献](#contributing) - [许可证](#license) - [出版物](#publications) - [贡献者](#contributors) ## 快速开始 ### 安装 #### 从 PyPI 安装 ``` pip install agentscope ``` 或者使用 uv: ``` uv pip install agentscope ``` #### 从源码安装 ``` # 从 GitHub 拉取 source code git clone -b main https://github.com/agentscope-ai/agentscope.git # 以 editable mode 安装 package cd agentscope pip install -e . # 或使用 uv: # uv pip install -e . ``` ## 示例 ### 你好 AgentScope! 从用户与一个名为 "Friday" 的 ReAct Agent 🤖 之间的对话开始! ``` 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()) ``` ### 语音 Agent 创建一个支持语音的 ReAct Agent,它可以理解语音并做出语音回应,甚至可以通过语音交互进行多智能体狼人杀游戏。 https://github.com/user-attachments/assets/c5f05254-aff6-4375-90df-85e8da95d5da ### 实时语音 Agent 构建一个带有 Web 界面的实时语音 Agent,可以通过语音输入和输出与用户交互。 [实时聊天机器人](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/realtime_voice_agent) | [实时多智能体示例](https://github.com/agentscope-ai/agentscope/tree/main/examples/workflows/multiagent_realtime) https://github.com/user-attachments/assets/1b7b114b-e995-4586-9b3f-d3bb9fcd2558 ### 人机交互 支持 ReActAgent 中的实时中断:对话可以通过实时取消操作进行中断,并通过可靠的记忆保存无缝恢复。 Realtime Steering ### 灵活的 MCP 使用 将单个 MCP 工具作为**本地可调用函数**使用,以组合工具包或封装成更复杂的工具。 ``` 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 通过强化学习集成无缝训练您的智能体应用。我们还准备了涵盖各种场景的多个示例项目: | 示例 | 描述 | 模型 | 训练结果 | |--------------------------------------------------------------------------------------------------|-------------------------------------------------------------|------------------------|-----------------------------| | [数学 Agent](https://github.com/agentscope-ai/agentscope-samples/tree/main/tuner/math_agent) | 通过多步推理微调数学解题 Agent。 | Qwen3-0.6B | 准确率:75% → 85% | | [冰湖环境](https://github.com/agentscope-ai/agentscope-samples/tree/main/tuner/frozen_lake) | 训练 Agent 在冰湖环境中导航。 | Qwen2.5-3B-Instruct | 成功率:15% → 86% | | [学会提问](https://github.com/agentscope-ai/agentscope-samples/tree/main/tuner/learn_to_ask) | 使用 LLM-as-a-judge 自动反馈微调 Agent。 | Qwen2.5-7B-Instruct | 准确率:47% → 92% | | [邮件搜索](https://github.com/agentscope-ai/agentscope-samples/tree/main/tuner/email_search) | 在没有标注真值的情况下改进工具使用能力。 | Qwen3-4B-Instruct-2507 | 准确率:60% | | [狼人杀游戏](https://github.com/agentscope-ai/agentscope-samples/tree/main/tuner/werewolves) | 训练 Agent 进行战略性多智能体游戏交互。 | Qwen2.5-7B-Instruct | 狼人胜率:50% → 80% | | [数据增强](https://github.com/agentscope-ai/agentscope-samples/tree/main/tuner/data_augment) | 生成合成训练数据以增强微调效果。 | Qwen3-0.6B | AIME-24 准确率:20% → 60% | ### 多智能体工作流 AgentScope 提供 ``MsgHub`` 和流水线来简化多智能体对话,提供高效的消息路由和无缝的信息共享 ``` 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()) ``` ## 文档 - [教程](https://doc.agentscope.io/tutorial/) - [常见问题](https://doc.agentscope.io/tutorial/faq.html) - [API 文档](https://doc.agentscope.io/api/agentscope.html) ## 更多示例与样本 ### 功能 - [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) - [规划](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 Agent](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/react_agent) - [语音 Agent](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/voice_agent) - [深度研究 Agent](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/deep_research_agent) - [浏览器使用 Agent](https://github.com/agentscope-ai/agentscope/tree/main/examples/agent/browser_agent) - [元规划 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) - [实时语音 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 Agent](https://github.com/agentscope-ai/agentscope/tree/main/examples/tuner/react_agent) ## 许可证 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}, } ``` ## 贡献者 感谢我们所有的贡献者:
标签:AgentScope, AI编程, Apex, AutoGen, AutoGPT, DLL 劫持, LLM应用开发, Mutation, PyRIT, Python, RAG, 人工智能, 企业级AI, 可视化, 多智能体框架, 多智能体系统, 大语言模型, 威胁情报, 子域名突变, 开发者工具, 无后门, 智能体可信, 机器学习, 模型可解释性, 用户代理, 用户模式Hook绕过, 网络调试, 自动化, 请求拦截, 逆向工具, 阿里开源