agentscope README

The project's README from github.com/agentscope-ai/agentscope. As one markdown file: README.md.

AgentScope Logo

中文主页 | Documentation | Roadmap

arxiv pypi pypi discord docs license Ask DeepWiki

agentscope-ai%2Fagentscope | Trendshift

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.

agentscope

News

More news →

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, Volcengine, 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.

Agent team
Agent team — a leader agent spawns workers and coordinates them through the built-in team tools.
Task planning
Task planning — the agent breaks complex work into a tracked plan and updates it as it goes.
Permission control in bypass mode
Permission control in bypass mode — the agent runs end-to-end without pausing for tool-call confirmations.
Background task offloading
Background task offloading — a long-running tool moves to the background; its result later wakes the agent up and the conversation resumes.

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

Contributing

We welcome contributions from the community! Please refer to our 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.

@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:

agentscope (agentscope-ai/agentscope)

Searching Database…

这是什么?AgentScope 2.0 是一个可用于生产环境、简单易用的 Python 框架,用于构建和运行 LLM 智能体。它依靠模型自身的推理和工具调用能力,而不是用严格的提示词和预设的编排方式把模型框死。
它是我写代码用的框架,还是拿来就能跑的成品?两个层次都有:一个 SDK,可以用基础构件(ReAct 循环、工具包、记忆、中间件)组装智能体;另外还有一个功能齐全的智能体服务——一个 FastAPI 后端,附带做好的 Web UI,能把你的智能体变成支持多租户、多会话的应用。
我怎样才能把第一个智能体跑起来?从 PyPI 或源码安装即可,需要 Python 3.11 或更高版本。然后你可以在 Console 里启动第一个智能体,这是一个终端模式,方便测试和调试智能体。
可以接入哪些 LLM 服务商?能在本地跑模型吗?Model 模块涵盖 LLM、嵌入和 TTS,支持 OpenAI、Anthropic、Gemini、DashScope、DeepSeek、Moonshot、火山引擎、xAI 和 Ollama,所以你可以通过 Ollama 完全在本地跑模型,不用付任何 API 费用。
里面的功能都稳定吗,还是有一部分仍处于实验阶段?这个框架的定位是可用于生产环境,但最新加入的实时语音智能体在发布说明中被明确标注为实验性功能。
除了聊天,智能体实际还能做什么?开箱即用的功能很多:Toolkit 可以管理 Python 工具、MCP 服务器和技能,自带内置的编码工具(Shell、文件编辑、搜索),还有任务和计划工具。GitHub MCP Registry 和 ClawHub 这类 Hub 让你浏览并安装 MCP 服务器和技能。
多个智能体能像团队一样协作吗?可以——一个主智能体可以派生工作者智能体,并通过内置的团队工具来协调它们,把复杂工作拆解成可跟踪的计划。Pipeline 还能让多个智能体共用一条事件流运行;借助 A2A 支持,智能体可以和任何兼容 A2A 的远程智能体对话。
我能把我的智能体接入 Discord 或其他聊天应用吗?可以——智能体服务内置 Channels,用于把智能体接入即时通讯平台:支持飞书(Lark)、Discord 和钉钉,还支持带消息路由的自定义 Channel。
工具和代码在哪里执行?有沙箱隔离吗?工作区由你自己选择:本地、Docker、Apple Container、Bubblewrap、E2B、OpenSandbox、Daytona 或 Kubernetes。权限控制很细,支持工具执行确认、绕过模式,以及人工在环控制。
Size
65.1 MB
Stars
33.5K
Age
2y
Commits · 90 Days