What Is AgentScope 2.0
AgentScope 2.0 is an open-source multi-agent development framework released by Tongyi Lab, focusing on stable operation, security control, and production deployment in real-world scenarios. It introduces systematic capabilities such as model fault tolerance, a permission system, a refactored context management system, Middleware extension, decoupled Workspace execution, and Agent Service-based deployment, enabling agents to move from working demos to stable production.
Main Features of AgentScope 2.0
- Model Fault Tolerance: Supports unified access to mainstream models such as Qwen, Anthropic, DeepSeek, Gemini, OpenAI, Grok, and Moonshot. It introduces automatic retries and fallback model switching mechanisms. When the primary model call fails, it automatically attempts a fallback model to ensure long-chain tasks are not interrupted.
- Process Transparency and Event System: Refactors the message module to carry multiple message types such as text, files/images, tool results, and model thinking through unified Content Blocks. It introduces an event stream system that supports streaming output of events such as model call start, text increments, tool calls, and user confirmations, making the execution process visible, interactive, and intervenable in real time.
- Security Boundaries and Permission System: Systematic permission control covers tool calls, file reads and writes, and command execution. It performs risk assessment based on static rules, tool types, and input content, supports automatic allowance, rejection, or entry into a user approval process, and can identify dangerous directories, sensitive files, high-risk commands, and dangerous deletion operations.
- Context Management Refactor: Structured compression preserves key information such as task goals, current status, key findings, and next-step plans. Tool results are automatically truncated to prevent excessively long logs from overwhelming the context. A caching mechanism is added for file reads and writes, enforcing "read before write" to reduce redundant IO.
- Middleware Extension Mechanism: Supports inserting custom logic at key nodes such as model calls, thinking and planning, and tool execution, for log tracing, security checks, business policy injection, dynamic context injection, and more, without modifying the framework source code.
- Workspace Execution Decoupling: Abstracts the execution environment and unifies interfaces for different backends such as local, Docker containers, and E2B cloud sandboxes. Agent execution logic is decoupled from the environment, supporting write once and seamless switching between local and cloud. A built-in warm-up pool mechanism supports batch environment initialization for parallel scenarios.
- Agent Service-Based Deployment: Merges the Runtime's Agent Service capabilities into the main library, connecting development and deployment. It provides standard service interfaces, streaming output, and session recovery capabilities, supporting stable invocation by frontend applications, external systems, and workflows.
Technical Principles of AgentScope 2.0
- Unified Message Structure: Uses Content Block abstraction to carry multimodal messages such as text, files/images, tool results, and model thinking. DataBlock supports two types of data sources, base64 and URL, and is compatible with the multimodal capabilities of different model APIs.
- Event-Driven Architecture: An Agent reply no longer only returns final text, but instead streams events such as model call start, text increments, tool calls, tool results, user confirmations, and external execution, allowing the frontend UI to display execution progress in real time.
- Permission Check Flow: When an agent initiates a tool call, file read/write, or command execution, the permission system sequentially performs rule checks, input analysis, and risk assessment, and outputs one of three results: allow, deny, or user confirmation.
- Context management strategy: For multi-turn reasoning, tool results, and file content in long-term tasks, it uses structured compression to retain key state, automatically truncates overly long tool results, and reduces repeated reads through a file caching mechanism.
- Middleware instrumentation: Hooks are reserved at key execution stages such as model calls, thought planning, and tool execution, allowing developers to insert custom logic to uniformly handle cross-cutting concerns such as logging, permissions, and context.
- Workspace abstraction layer: WorkspaceBase abstracts common capabilities such as identity, lifecycle, resource discovery, context offloading, and dynamic resource management. Different execution backends (local, container, cloud sandbox) can be integrated by implementing the same set of interfaces.
How to use AgentScope 2.0
- Install the framework: Install AgentScope via pip:
pip install agentscope - Configure model access: Specify the primary model and backup model in the configuration, and set the retry count and switching strategy.
- Define agents and tools: Create an agent with ReActAgent, and register the required tool functions with the Toolkit.
- Set permission rules: Configure permission policies for tool calls, file read/write, and command execution, and define allow/deny/confirm rules.
- Choose the execution environment: Use Workspace to choose local, Docker container, or E2B cloud sandbox as the execution backend.
- Start a service or run locally: Use Agent Service to start a standard interface service, or run the agent workflow locally via a script.
Core advantages of AgentScope 2.0
-
Strong stability: Automatic retries at the model layer + backup switching, structured context compression, and file caching ensure that long-chain tasks continue to execute without interruption.
-
High security: The systematic permission system supports rule checks, risk assessment, and user approval, establishing automatic interception and approval mechanisms for high-risk operations.
-
Transparent and controllable: The event stream system makes the execution process visible in real time, supports manual confirmation and manual intervention, and bids farewell to black-box replies.
-
Flexible extensibility: The Middleware mechanism allows business logic to be plugged in without modifying source code, and Workspace supports seamless switching between local/container/cloud sandbox.
-
Production-ready: The built-in Agent Service provides standard interfaces, streaming output, and session recovery, enabling direct transition from development scripts to production services.
-
Leading multimodal capabilities: Supports rich multimodal capabilities such as image generation, TTS, voice input, and real-time voice, as well as the MCP and A2A protocols.
Project address of AgentScope 2.0
- Project official website:https://docs.agentscope.io/zh/v2
Comparison of AgentScope 2.0 with similar competing products
| Comparison dimension | AgentScope 2.0 | AutoGen (Microsoft) | CrewAI |
|---|---|---|---|
| Core positioning | Enterprise-grade multi-agent development framework | Multi-agent conversation orchestration framework | Role-based multi-agent orchestration framework |
| Design philosophy | Agent-Oriented Programming, emphasizing agent autonomy and organizational structure | Conversation as workflow, emphasizing multi-agent collaborative dialogue | Role-playing teams, defining agent roles and goals in natural language |
| Multi-model support | Qwen, Anthropic, DeepSeek, Gemini, OpenAI, Grok, Moonshot, etc. | OpenAI, Azure OpenAI, Anthropic, local models, etc. | OpenAI, Anthropic, Gemini, Ollama, open-source models, etc. |
| Model fault tolerance | ✅ Automatic retry + fallback model switching | ⚠️ Relies on the model layer's own fault tolerance | ❌ No built-in fault tolerance mechanism |
| Transparent execution process | ✅ Event stream system, streaming display of the execution process, supports human intervention | ⚠️ Based on conversation history, limited process visibility | ❌ Only displays task output, no process event stream |
| Permissions and security | ✅ Systematic permission system, supports rule checking, risk assessment, user approval | ⚠️ Basic security controls, no systematic permissions | ❌ No systematic permission control |
| Context management | ✅ Structured compression + result truncation + file caching | ⚠️ Conversation history management, no structured compression | ⚠️ Basic task output passing, no context compression |
| Execution environment | ✅ Workspace abstraction, seamless switching between local/container/cloud sandbox | ⚠️ Execution environment must be configured manually | ❌ No execution environment abstraction |
| Service-oriented deployment | ✅ Built-in Agent Service, standard interface + streaming output + session recovery | ⚠️ Requires deployment in combination with external services | ⚠️ Requires the CrewAI Enterprise platform |
| Extension mechanism | ✅ Middleware mechanism, plug and play | ⚠️ Extends through the Selector mechanism | ⚠️ Extends through Flows, limited flexibility |
| Multimodal support | ✅ Image generation, TTS, voice input, real-time voice | ⚠️ Primarily text, multimodal requires customization | ❌ No built-in multimodal support |
| Protocol support | ✅ MCP (HTTP+Stdio)、A2A | ⚠️ MCP community support | ⚠️ A2A protocol support in progress |
| Applicable scenarios | Enterprise-level complex collaboration, real-time voice Agents, multimodal applications | Rapid prototyping, multi-role dialogue simulation, code generation | Rapid prototyping, content generation, research analysis, role collaboration |
| Learning curve | Medium (requires understanding async/await) | Low (get started in 10 minutes) | Very low (runs with 20 lines of code) |
| Production readiness | High (built-in sandbox, serviceization, monitoring) | Medium (production-ready in October 2025) | Medium (enterprise platform has latency issues) |
Application scenarios of AgentScope 2.0
-
Enterprise-level complex collaboration systems: Business process automation that requires multi-agent hierarchical collaboration and strict organizational management.
-
Real-time voice Agents: Build multimodal agent applications that support voice input and real-time conversation.
-
Security-sensitive tasks: Scenarios involving file operations, command execution, and other activities that require strict permission control and audit trails.
-
Long-chain persistent tasks: Complex workflows that require multiple rounds of reasoning, multiple tool invocations, and state retention across rounds.
-
Multi-cloud/hybrid deployment: Environments that need to flexibly switch between local development, container testing, and cloud sandbox production.