By Qia Cheng、Xi Weng、Zhuo Guang
AgentScope, based on A2A protocol and Nacos Agent Registry, achieves unified discovery, governance, and cross-ecological collaboration for agents.
As enterprises gradually implement AI application architectures, starting from testing POC workflow/simple agents to gradually building production-ready agents, genuinely solving online issues, building an agent in the company becomes a path for all employees to improve efficiency. It is no longer just about simple business processes facing more complex problems; companies may encounter the following challenges:
● Diverse language stacks: Core business teams within the enterprise may use Java/Golang, while algorithm teams use Python, how to achieve seamless collaboration with multiple language stacks in agent architecture?
● Fragmented Agent frameworks: Different frameworks such as LangChain, AutoGPT, AgentScope, etc., each operating independently; how to achieve cross-framework calls?
● Multi-team Agent cooperation: If an agent has one team working on it, but they do not understand the business deeply, agents may be distributed across different services, teams, and projects. Internal selection may involve Dify, n8n low-code, and high-code platform selections; how to unify discovery and management?
● Non-standardized protocols: REST, gRPC, custom protocols... Each agent has its own interface specifications, leading to high integration costs and maintenance difficulties.

A2A (Agent-to-Agent) protocol is specifically designed to solve these issues. It is an open standard proposed by Google aimed at distributed, multi-agent interoperability, defining a unified message structure and capability description, allowing agents in different languages, frameworks, and runtimes to be discovered, called, and orchestrated. Based on A2A, agents can engage in rich interactions such as text dialogue, thinking, multi-modal content, tool calls, etc., without sharing code or coupling underlying implementations, truly realizing "define once, use everywhere".

AgentScope is an open-source framework focused on developer-centric multi-agent development launched by Alibaba. Its core goal is to address the challenges faced in the construction, operation, and management of agents, providing a production-grade solution that covers the entire lifecycle of "development, deployment, monitoring".
In the latest version of AgentScope, we fully support the A2A protocol and integrate Nacos as the default implementation of A2A Registry, building a complete distributed multi-agent collaboration system from development to deployment, enabling agent collaboration to transition from “working in isolation” to “open interconnection.”

● Say goodbye to "Agent Islands": Through the A2A protocol, agents in AgentScope can seamlessly interoperate with any agent that implements A2A, regardless of who developed it or what technology stack was used, allowing for efficient collaboration under a unified framework, breaking down technical barriers, and jointly building an open ecosystem across languages and frameworks.
● Unified development experience, farewell to adaptation worries: In AgentScope, calling a local agent and a remote A2A agent uses the same set of APIs. The framework automatically handles protocol conversions, error retries, and routing choices, allowing us to focus on business without writing redundant code for adapting to different agents, thereby enhancing efficiency and maintainability.
● Production-grade governance, out-of-the-box: Based on Nacos 3.0, the agent registration center, AgentScope applications have mature capabilities such as service discovery, health checks, and namespace isolation. Choosing Nacos as the default A2A Registry is not only due to its large-scale production validation but also because it is compatible with existing enterprise operation and maintenance systems, allowing agent governance without reinventing the wheel and accelerating large-scale implementation.
AgentScope provides unified A2A interface capabilities, allowing us to call remote A2A agents as naturally as local tools, achieving cross-language and cross-framework collaboration, saying goodbye to cumbersome protocol adaptation tasks:
● Bidirectional message conversion: Implement bidirectional conversion between the internal message format of the framework and A2A Message, supporting text, thinking, multi-modal, tool invocation, and other block types, preserving necessary metadata to ensure semantic consistency.
● Unified interaction paradigm: Supports both direct invocation and observe() methods. Direct invocation agent(msg) can immediately get results; observe() accumulates context first and then sends it along with the current input, suitable for long conversations and multi-turn collaboration scenarios.
● Task and interruption management: Built-in long task state management and artifact handling mechanism, supporting smooth interruptions of long-running tasks, covering timeout and cancellation scenarios.
● Unified service discovery capabilities: Standardizes the "discovery" capability through the AgentCardResolver extension point; any component implementing this interface, such as FixedAgentCardResolver, FileAgentCardResolver, WellKnownAgentCardResolver, NacosAgentCardResolver etc., can be loaded as needed, easily adapting to different infrastructures.

Through A2AAgent and AgentCardResolver, we can discover and invoke other agents from the A2A Registry by name, group, or tag, achieving agent reuse across teams, projects, and even languages. Based on the A2A Registry, agents have unified service discovery and governance capabilities, cooperating with existing configuration centers, gateways, circuit breakers, throttling, and security systems to lay a solid foundation for large-scale distributed agent applications.
The following example demonstrates how to use NacosAgentCardResolver to discover and invoke agents from the Nacos Registry:
Note to use the demo above the corresponding versions, Python (AgentScope v1.0.11, AgentScope Runtime v1.0.4) and Java (AgentScope v1.0.6, AgentScope Runtime v1.0.0)
Python Code Example Click to view detailed documentation
from agentscope.agent import A2AAgent
from agentscope.a2a import NacosAgentCardResolver
from agentscope.message import Msg
# Python AgentScope v1.0.11 or higher
# Create Nacos AgentCard Resolver
nacos_resolver = NacosAgentCardResolver(
remote_agent_name="my-remote-agent", # Name of the agent registered in Nacos
nacos_client_config=ClientConfig(
server_addresses="http://localhost:8848", # Nacos server address
# Other optional configuration items
),
)
# Use the Resolver to create an A2AAgent, discovering the Agent by name from Nacos
agent = A2AAgent(
agent_card=await nacos_resolver.get_agent_card()
)
Java Code Example Click to view detailed documentation
Use NacosAgentCardResolver to discover agents from the Nacos Registry:
import io.agentscope.agent.A2AAgent;
import io.agentscope.extensions.a2a.nacos.NacosAgentCardResolver;
import java.util.Properties;
import com.alibaba.nacos.api.PropertyKeyConst;
import com.alibaba.nacos.api.ai.AiFactory;
import com.alibaba.nacos.api.ai.AiService;
Properties properties = new Properties();
properties.put(PropertyKeyConst.SERVER_ADDR, "localhost:8848");
// Other optional configuration items
AiService aiService = AiFactory.createAiService(properties);
NacosAgentCardResolver agentCardResolver = new NacosAgentCardResolver(aiService);
A2AAgent agent = A2AAgent.builder()
.name("MyAgent")
.agentCardResolver(agentCardResolver)
.build();
Nacos 3.0, as the agent registration center, has well-validated service discovery and configuration management capabilities in production environments, helping enterprises build a unified agent service governance platform.
AgentScope Runtime provides unified A2A service exposure capabilities, helping us wrap local agent applications into endpoint services that comply with the A2A specification. Through the A2A protocol adapter, the application will automatically complete upon startup:
● Structured configuration system: Flexibly define the AgentCard (name, description, version, skills, default_input_modes/default_output_modes, etc.), transport layer configurations (host, port, path, etc.), Registry parameters, and task timeouts through the A2A extension configuration a2a_config.
● Automatic service wrapping: At startup, the A2A protocol adapter will encapsulate the agent application into an endpoint service that complies with the A2A specification, automatically handling protocol conversion, message routing, and other underlying details.
● Production-grade deployment support: Seamlessly integrate with mainstream frameworks, supporting AgentApp configuration systems on the Python side and Spring Boot Starter on the Java side, allowing agent services to naturally fit into the existing infrastructure.
● Automatic service registration and governance: Through the A2ARegistry abstract interface, both Python and Java can out-of-the-box integrate with Nacos Agent Registry. The agent capability descriptions (AgentCard) and network endpoints will be automatically registered with the Registry, making them available for discovery and invocation by other agents.

The following example demonstrates how to use Nacos Registry for service registration at the Runtime layer:
Python Code Example Click to view detailed documentation
When constructing the AgentApp, specify the Registry instance or list through the registry field of the A2A configuration extension field a2a_config parameter:
from agentscope_runtime.engine.app import AgentApp
from agentscope_runtime.engine.deployers.adapter.a2a import (
AgentCardWithRuntimeConfig,
)
from agentscope_runtime.engine.deployers.adapter.a2a.nacos_a2a_registry import (
NacosRegistry,
)
from v2.nacos import ClientConfigBuilder
# Create a Nacos Registry instance
registry = NacosRegistry(
nacos_client_config=ClientConfigBuilder()
.server_address("nacos-server:8848")
# Other optional configuration items
.build()
)
app = AgentApp(
app_name="TestAgent",
app_description="TestAgent",
# Configure the registry in a2a_config
a2a_config=AgentCardWithRuntimeConfig(registry=registry),
)
Environment variables can be set through the .env file or system environment variables:
# .env file example
A2A_REGISTRY_ENABLED=true
A2A_REGISTRY_TYPE=nacos
NACOS_SERVER_ADDR=localhost:8848
# Other optional configuration items
Java Code Example Click to view detailed documentation
In the latest version of Java AgentScope, applications can directly expose A2A services; only when using Sandbox is it necessary to use Runtime.
For non-latest versions, Java developers can seamlessly integrate AgentScope agents into existing Spring Boot infrastructure. By introducing the spring-boot-starter-agentscope-runtime-a2a-nacos dependency, the application will automatically expose A2A services and register with the Nacos Registry upon startup.
Maven dependency configuration:
<dependency>
<groupId>io.agentscope</groupId>
<artifactId>spring-boot-starter-agentscope-runtime-a2a-nacos</artifactId>
<version>1.0.3</version>
</dependency>
application.yaml configuration:
agentscope:
a2a:
server:
card:
description: "Java agent based on A2A protocol"
provider:
organization: Your organization name
url: https://your-organization.com
nacos:
server-addr: ${NACOS_SERVER_ADDRESS:127.0.0.1:8848}
# Other optional configuration items
With the above configuration, the Spring Boot application will automatically upon startup:
/a2a/jsonrpc)/.well-known/agent-card.json), for other agents to discover and understand the current agent's capabilities.Thanks to this mechanism, AgentScope applications automatically register as A2A agents in Nacos upon startup, laying the groundwork for subsequent discovery, routing, gray-scale testing, and monitoring. For teams that have widely adopted the Java technology stack, this means that agent services can naturally coexist on the same set of infrastructure, significantly reducing the costs and operational burdens of introduction.
AgentScope fully supports the A2A protocol and Nacos Agent Registry, marking a key step for agents from "single-point capabilities" to "open interconnect ecosystems," aiding enterprises in building a unified agent management platform and facilitating large-scale adoption of Agents:
A2AAgent and AgentCardResolver, we provide unified A2A access capabilities and flexible discovery strategies, with Nacos integrated by default, supporting dynamic agent discovery and invocation.A2ARegistry abstract interface, we provide unified A2A service exposure capabilities, supporting automatic service registration and governance, seamlessly integrating with Python AgentApp and Java Spring Boot Starter.In the future, we will continue to delve deeper into A2A and Registry, iterating on discovery and routing, version and gray-scale testing, security and access control, making production-oriented agent applications more stable and user-friendly.
648 posts | 55 followers
FollowAlibaba Cloud Native Community - August 25, 2025
Alibaba Cloud Native Community - January 21, 2026
Alibaba Cloud Native Community - October 11, 2025
Alibaba Cloud Native Community - December 11, 2025
Alibaba Developer - February 4, 2021
Alibaba Cloud Native Community - September 29, 2025
648 posts | 55 followers
Follow
Tongyi Qianwen (Qwen)
Top-performance foundation models from Alibaba Cloud
Learn MoreMore Posts by Alibaba Cloud Native Community