AgentScope
考えて動くエージェントに、隔離実行・文脈の圧縮・複数利用者向けの提供基盤まで付いた中国発のフレームワーク
AgentScopeとは
AgentScopeは、考えてツールを呼び、結果を見てまた考えるという基本のエージェントから始まり、そのうえで通常なら後から自分で作ることになる部分まで用意しています。ツールは自分のプロセス内ではなく隔離された環境で実行され、文脈は増えるにつれて圧縮したり外部に退避したりできます。途中で人に承認を求めることもでき、完成したエージェントは複数の利用者を分離した状態で提供する基盤として動かせます。その広さと引き換えに、2.0は1.0からの意図的な非互換変更であり、旧版向けに書かれた解説はそのままでは通用しません。
AgentScopeで何ができますか?
- ツールを安全な場所で実行する — ツールの実行はコンテナや外部のサンドボックスで隔離され、その範囲を利用者ごと、エージェントごと、セッションごとに分けられます。
- 関数・MCP・スキルを1つの道具箱にまとめる — 自分で書いた関数、MCP経由で使うツール、配布されたスキルを同じ場所に登録でき、エージェントからは1つの一覧として見えます。
- 文脈を切り捨てず圧縮する — 長くなった履歴を要約したりプロンプトの外に退避したりして、必要になったときに取り出します。上限で機械的に打ち切る方式ではありません。
- 人を経路に挟む — ツールの実行前に処理を止めて確認を求められます。エージェントが物事を変更できるようになった時点で、この確認が効いてきます。
- エージェント本体を触らず挙動を変える — ミドルウェアが実行時に呼び出しを包むため、手を入れたくないエージェントの周りに記録や制限、上書きを後から足せます。
- スクリプトではなくサービスとして提供する — 同じエージェントを、利用者ごとの分離と分散実行、実行状況を見るブラウザ画面を備えたサービスとして公開できます。
AgentScopeを選ぶ前に
- 2.0は1.0からの非互換変更だとプロジェクト自身が明示しています。旧版向けの解説記事やサンプルコードは、そのままでは動きません。
- 隔離実行や提供基盤、利用者ごとの分離といった特徴の多くはDockerやKubernetesが前提で、1本のスクリプトだけでは全体のごく一部しか使えません。
よくある質問
AgentScopeは商用利用できますか?
AgentScopeはApache-2.0ライセンスで公開されています。OSI承認のオープンソースライセンスで、商用利用が認められています。
AgentScopeはどの形で使えますか?
AgentScopeはセルフホスト・ローカル実行の形で利用できます。
ドキュメント
agentscope-ai/agentscope のREADMEより転載(Apache-2.0)。 原文を読む ↗
中文主页 | Documentation | Roadmap
What is AgentScope 2.0?
AgentScope 2.0 is a production-ready, easy-to-use agent framework with essential abstractions that keep up with rising model capability.
We design for increasingly agentic LLMs. Our approach leverages the models’ reasoning and tool use abilities rather than constraining them with strict prompts and opinionated orchestrations.
News
- [2026-08]
FEAT: Console supported — test and debug agents in the terminal. Example | Docs - [2026-08]
INTE: Feishu (Lark) and Discord channels supported. Feishu | Discord - [2026-08]
FEAT: Channels supported — connect agents to IM platforms in agent service. Example | Docs - [2026-08]
INTE: GitHub MCP Registry and ClawHub supported as built-in hubs. Example | Docs - [2026-08]
FEAT: MCP & Skill Hub supported — browse a hub, install into your library, add to a workspace. Example | Docs - [2026-07]
INTE: Daytona-based workspace/sandbox supported. Docs - [2026-07]
INTE: K8s, OpenSandbox-based workspace/sandbox supported. Docs - [2026-07]
INTE: ReMe long-term memory supported. Example | Docs - [2026-06]
FEAT: Agentic Memory supported. Example | Docs - [2026-06]
FEAT: Distributed & Multi-Tenancy & Multi-Session RAG service supported. Docs
Community
Welcome to join our community on
| Discord | DingTalk |
|---|---|
Quickstart
Installation
AgentScope requires Python 3.11 or higher.
From PyPI
uv pip install agentscope
From source
# 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
uv pip install -e .
Agent
The SDK layer — compose an agent from a rich set of building blocks:
| Building block | What’s inside |
|---|---|
| ReAct | Reasoning-acting loop with structured output, realtime interruption & resume, and batched (sequential / concurrent) tool acting |
| Toolkit | Agentic tool management over Python tools, MCP servers, and skills; ships with built-in coding tools (shell, file edit, search) and task/plan tools |
| Model | LLM, embedding, and TTS across major providers (OpenAI, Anthropic, Gemini, DashScope, DeepSeek, Moonshot, xAI, Ollama) |
| Context | Automatic compaction, tool-result offload, and context injection (system prompt, RAG, memory) via built-in middleware |
| Event System | Unified event bus streaming reasoning, tool calls, and multimodal content (text, image, audio) to the frontend |
| Permission & HITL | Fine-grained control over tools and resources, confirmation, bypass mode |
| Middleware | Composable hooks across the loop — reply, reasoning, acting, model calling, permission checking, context compression, system prompt |
| Memory | Agentic memory with switchable backends (ReMe, Mem0) |
| Workspace / Sandbox | Isolated tool & code execution — local, Docker, Apple Container, Bubblewrap, E2B, OpenSandbox, Daytona, K8s |
Start your first agent with AgentScope 2.0 in console:
from agentscope.agent import Agent
from agentscope.console import launch_console
from agentscope.tool import Toolkit, Bash, Grep, Glob, Read, Write, Edit
from agentscope.credential import DashScopeCredential
from agentscope.model import DashScopeChatModel
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(),
]
),
)
# Chat with the agent in the terminal — streamed output, tool-call
# confirmation and Ctrl+C interruption are all handled for you
await launch_console(agent)
asyncio.run(main())
Agent Service — All You Need to Build Your App
AgentScope ships a batteries-included agent service — a FastAPI backend with a pre-built Web UI (examples/web_ui) that turns your agents into a multi-tenant, multi-session application, with rich capabilities out of the box:
| Capability | What you get |
|---|---|
| Serving | Multi-tenancy, multi-session isolation, FastAPI backend, pre-built Web UI |
| Agent Team | Leader–worker orchestration, built-in team tools, task planning |
| Channels | Connect agents to IM platforms — Feishu (Lark), Discord, custom channels, message routing |
| RAG Service | Blob storage, index worker, multi-tenant retrieval |
| MCP & Skill Hub | Browse hubs (GitHub MCP Registry, ClawHub), install into your library, add to a workspace |
| Resource Sharing | Group- and org-level management for sharing models, MCP servers, skills, and workspaces |
| Persistence | SQL & NoSQL persistence of agent state and sessions |
| Scheduling | Scheduled tasks, agent wakeup, background task offloading |
Everything above is composable, so you can assemble your own application on top of the service with minimal glue code.
Run the following commands to start the agent service backend and the web UI:
git clone -b main https://github.com/agentscope-ai/agentscope.git
cd agentscope/examples/agent_service
# start the agent service backend
python main.py
Then open another terminal to start the web UI:
cd agentscope/examples/web_ui
# start the webui
pnpm install
pnpm dev
Publications
If you find our work helpful for your research or application, please cite our papers.
@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},
}