Overview
AgentScope is an open-source Python framework for building agent and multi-agent applications on top of large language models. Version 2.0 focuses on production use, with abstractions designed to work alongside increasingly capable, tool-using models rather than constraining them with rigid prompts and orchestration.
It is aimed at Python developers who need more than a single chatbot loop: teams of agents that coordinate, call tools, and run code. The framework leans on the model's own reasoning and tool-use abilities, exposing the agent's reason-act loop through a unified event stream that you can wire into a UI or a human-in-the-loop step.
Within the multi-agent systems space, AgentScope adds the operational pieces you need to ship: a permission system for fine-grained control over tools, workspace sandboxes (local, Docker, or E2B), composable middleware, and a multi-tenancy, multi-session agent service for serving agents with isolation.
What it does
- Event system: a unified event bus that streams the agent's reasoning and actions to a frontend and supports human-in-the-loop
- Permission system for fine-grained, configurable control over which tools and resources an agent can use
- Workspace and sandbox support to run tools and code in isolated environments, with backends for local, Docker, and E2B
- Multi-tenancy and multi-session agent service for production-grade serving with isolation across tenants and sessions
- Extensible middleware: composable hooks to customize and extend the agent's reasoning-acting loop
- Built-in toolkit with file and shell tools such as Bash, Grep, Glob, Read, Write, and Edit, plus an Agent Team feature for coordinating worker agents
Getting started
AgentScope requires Python 3.11 or higher. Install it from PyPI, then create your first agent and stream its events.
Install AgentScope
Install the package from PyPI with uv or pip.
uv pip install agentscope
# or
# pip install agentscopeSet your model credentials
The quickstart uses DashScope, so export the API key the model client reads from the environment.
export DASHSCOPE_API_KEY=your_api_keyCreate and run an agent
Build an Agent with a model and a toolkit, then iterate over the event stream from reply_stream to handle the agent's output.
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!")):
match evt.type:
case EventType.TEXT_BLOCK_DELTA:
...
# Handle other event types
asyncio.run(main())Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Build a team of agents where a leader spawns and coordinates worker agents through the built-in team tools
- Serve agents to many users with a multi-tenant, multi-session FastAPI service and a pre-built web UI
- Run agent-generated code and tool calls safely inside local, Docker, or E2B sandboxes
- Stream an agent's reasoning and tool calls into a frontend, with human-in-the-loop approval gated by the permission system
How AgentScope compares
AgentScope alongside other open-source multi-agent systems tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| MetaGPT | ★ 68.9k | A multi-agent framework that models a software company, assigning roles like product manager, architect, and engineer to generate code from a single prompt. |
| AutoGen | ★ 59.1k | Microsoft Research's framework for building applications where multiple agents converse with each other and with tools to solve tasks. |
| CrewAI | ★ 54k | A framework for assembling teams ('crews') of role-playing agents that divide tasks and collaborate to complete a goal. |
| OpenAI Agents SDK | ★ 27.3k | OpenAI's lightweight Python SDK for building multi-agent workflows using explicit handoffs, tools, and guardrails. |
| AgentScope | ★ 27k | A Python framework for building production multi-agent applications |
| OpenAI Swarm | ★ 21.7k | An educational, lightweight framework from OpenAI for experimenting with multi-agent coordination through handoffs and routines. |
| PentAGI | ★ 17.8k | PentAGI is a self-hosted AI security platform that plans and runs penetration tests autonomously using a team of agents and 20+ built-in pentesting tools. |
| CAMEL | ★ 17.2k | A research-oriented framework for studying and building communicating agents that cooperate through role-playing conversations. |