AgentScope 2.0 - An open-source multi-agent development framework from Tongyi Labs
AgentScope 2.0 is an open-source multi-agent development framework launched by Tongyi Labs. It focuses on stable operation, security control, and production deployment in real-world scenarios, adding features such as model fault tolerance, a permission system, refactored context management, and Middleware...
What is AgentScope 2.0?
AgentScope 2.0 is an open-source multi-agent development framework launched by Tongyi Labs. It focuses on stable operation, security control and production deployment in real-world scenarios. It adds systematic capabilities such as model fault tolerance, permission system, context management reconstruction, middleware extension, workspace execution decoupling and Agent Service service deployment, enabling agents to move from running demos to stable production.
Main features of AgentScope 2.0
- Model Fault ToleranceSupports unified access to mainstream models such as Qwen, Anthropic, DeepSeek, Gemini, OpenAI, Grok, and Moonshot. It introduces an automatic retry and backup model switching mechanism, automatically attempting a backup model when the primary model fails, ensuring uninterrupted long-chain tasks.
- Process Transparency and Event SystemsThe messaging module has been restructured to handle various message types, including text, files/images, tool results, and model reflections, through a unified Content Block. An event stream system has been introduced to support streaming output of events such as model call start, text increment, tool call, and user confirmation, enabling real-time visibility, interactivity, and intervention in the execution process.
- Security Boundary and Access Control SystemSystematic access control covers tool calls, file read/write, and command execution. It assesses risk based on static rules, tool type, and input content, supporting automatic permission grants, denials, or initiation of user approval processes. It can identify dangerous directories, sensitive files, high-risk commands, and dangerous deletion operations.
- Context management refactoringStructured compression preserves key information such as task objectives, current status, critical findings, and next steps. Tool results are automatically truncated to prevent excessively long logs from overloading the context. A new caching mechanism for file read/write operations forces a "read-before-modify" approach, reducing redundant I/O.
- Middleware extension mechanismIt supports inserting custom logic at key nodes such as model invocation, thinking and planning, and tool execution for purposes such as log tracing, security checks, business strategy injection, and dynamic context injection, without modifying the framework source code.
- Workspace execution decouplingAbstracting the execution environment unifies different backend interfaces such as local, Docker containers, and E2B cloud sandboxes. The agent's runtime logic is decoupled from the environment, supporting write-once, seamless switching between local and cloud environments. A built-in preheating pool mechanism supports batch environment initialization for parallel scenarios.
- Agent Service Service DeploymentThis feature merges the Runtime Agent Service capabilities into the main repository, facilitating 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 StructureDataBlock uses Content Block to abstract and carry multimodal messages such as text, files/images, tool results, and model thoughts. It supports two types of data sources: base64 and URL, and is compatible with the multimodal capabilities of different model APIs.
- Event-driven architectureAn Agent response no longer simply returns the final text, but instead streams events such as the start of a model call, text increments, tool calls, tool results, user confirmation, and external execution, allowing the front-end UI to display the execution progress in real time.
- Permission check processWhen an intelligent 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 three results: allow, deny, or user confirmation.
- Context management strategyFor multi-round inference, tool results, and file content of long-term tasks, structured compression is used to preserve key states, excessively long tool results are automatically truncated, and repeated reading is reduced through a file caching mechanism.
- Middleware instrumentationHooks are reserved in key execution stages such as model invocation, thinking and planning, and tool execution, allowing developers to insert custom logic to achieve unified handling of cross-cutting concerns such as logs, permissions, and context.
- Workspace Abstract LayerWorkspaceBase abstracts common capabilities such as identity identification, lifecycle, resource discovery, context unloading, and dynamic resource management, allowing different execution backends (local, container, cloud sandbox) to connect by implementing the same set of interfaces.
How to use AgentScope 2.0
- Mounting FrameInstall AgentScope via pip:
pip install agentscope - Configuration Model AccessSpecify the primary and backup models in the configuration, and set the number of retries and the switching strategy.
- Defining intelligent agents and toolsCreate an intelligent agent using ReActAgent and register the necessary utility functions to the Toolkit.
- Set permission rulesConfigure permission policies for tool calls, file read/write, and command execution, and define allow/deny/acknowledge rules.
- Select execution environmentChoose a local machine, Docker container, or E2B cloud sandbox as the execution backend via Workspace.
- Start the service or run it locally: Use Agent Service to start a standard interface service, or run the agent workflow locally via script.
The core advantages of AgentScope 2.0
-
High stabilityAutomatic retry and backup switching at the model layer, context-structured compression, and file caching ensure uninterrupted execution of long-chain tasks.
-
High securityThe system-wide permission system supports rule checks, risk assessments, and user approvals, establishing an automatic interception and approval mechanism for high-risk operations.
-
Transparent and controllableThe event flow system makes the execution process visible in real time, supports manual confirmation and intervention, and eliminates black-box responses.
-
Flexible expansionThe Middleware mechanism allows for plug-and-play business logic without modifying the source code, and the Workspace supports seamless switching between local/container/cloud sandbox.
-
Production readyThe built-in Agent Service provides standard interfaces, streaming output, and session recovery, and can be deployed directly from development scripts to provide production services.
-
Multimodal leadershipIt supports a wide range of multimodal capabilities, including image generation, TTS, voice input, and real-time voice, as well as MCP and A2A protocols.
Project address for AgentScope 2.0
- Project official website: https://docs.agentscope.io/zh/v2
Comparison of AgentScope 2.0 with similar competing products
| Comparison Dimensions | AgentScope 2.0 | AutoGen (Microsoft) | CrewAI |
|---|---|---|---|
| Core positioning | Enterprise-level multi-agent development framework | Multi-agent dialogue orchestration framework | Role-based multi-agent orchestration framework |
| Design Philosophy | Agent-Oriented Programming emphasizes agent autonomy and organizational structure. | Dialogue as workflow emphasizes multi-agent collaborative dialogue. | Role-playing team, natural language defining agent roles and objectives |
| 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 + standby model switching | Relying on the fault tolerance of the model layer itself. | No built-in fault tolerance mechanism |
| Execution process transparent | An event stream system displays the execution process in a streaming manner and supports manual intervention. | Based on the history of the dialogue, the visibility of the process is limited. | Only task output is displayed; no process event flow is shown. |
| Permissions and Security | A systematic permission system that supports rule checks, risk assessments, and user approvals. | Basic security controls, no system-level permissions. | No systematic access control |
| Context Management | Structured compression + result truncation + file caching | Dialogue history management, unstructured compression | Basic task output transmission, without context compression. |
| Execution environment | Workspace abstraction enables seamless switching between local/container/cloud sandbox environments. | You need to configure the execution environment yourself. | No execution environment abstraction |
| Service-oriented deployment | Built-in Agent Service, standard interface + streaming output + session recovery | Requires deployment in conjunction with external services. | Requires CrewAI Enterprise platform |
| Extension mechanism | Middleware mechanism, plug and play | Expanding through the Selector mechanism | Limited flexibility due to Flows expansion. |
| Multimodal support | Image generation, TTS, voice input, real-time voice | Text-based; multimodal requires customization. | No built-in multimodal support |
| Protocol support | MCP (HTTP+Stdio), A2A | MCP Community Support | A2A protocol support is 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 and analysis, role collaboration |
| Difficulty of getting started | Medium level (requires understanding of async/await) | Easy (can be learned in 10 minutes) | Extremely low (can run with just 20 lines of code) |
| Production readiness | High (built-in sandbox, service-oriented architecture, monitoring) | (Production ready in October 2025) | (There are latency issues with the enterprise platform) |
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 Agent: Build multimodal intelligent agent applications that support voice input and real-time dialogue.
-
Security-sensitive tasks: Scenarios involving file operations, command execution, etc., that require strict access control and audit trails.
-
Long-term continuous tasks: A complex workflow that requires multiple rounds of reasoning, multiple tool calls, and state maintenance across rounds.
-
Multi-cloud/hybrid deploymentAn environment that requires flexible switching between local development, container testing, and cloud sandbox production.