A2A (Agent-to-Agent)
Connect your Squid AI agents to external agents that speak the Agent-to-Agent (A2A) protocol
Overview
The Agent-to-Agent (A2A) protocol is an open standard that lets AI agents from different platforms talk to each other. With the A2A connector, a Squid AI agent can delegate work to an external A2A-compatible agent: your agent decides when to consult the remote agent, sends it a question, and incorporates the response into its answer.
How it works:
- You point the connector at the remote agent's agent card URL (typically ending in
/.well-known/agent.json). The agent card describes the remote agent's skills. - When your Squid agent decides the remote agent can help, it calls it with a prompt and receives a text response.
- The remote agent's description and skills from the agent card guide your agent on when to delegate to it.
Adding the A2A connector to your Squid application
-
Navigate to the Connectors tab in the Squid Console.
-
Click Available Connectors.
-
Find the A2A connector, and select Add Connector.
-
Provide the following configuration details:
Connector ID: A string that uniquely identifies the connector in your code.
A2A Agent Card URL: The URL of the remote agent's agent card. For example, https://api.example.com/.well-known/agent.json.
Authorization (optional): If the remote agent requires authentication, provide the header to send with each request:
- Header Name: The name of the auth header. Defaults to
Authorization. - Header Value: The header value, such as
Bearer <token>. Stored securely as a Squid secret.
- Click Test Connection to verify that Squid can fetch the agent card, then add the connector.
Using the A2A connector in your application
No-code Studio
-
Navigate to the Studio tab in the Squid Console.
-
Open (or create) the agent that should delegate to the remote agent.
-
Click Add Abilities and select the A2A connector you created earlier.
-
In the When to Use field, describe when the agent should consult the remote agent, such as "Call this when the user asks about shipping logistics."
-
Click on Test and ask a question that should be delegated to the remote agent.
Using the Squid SDK
If you are creating your AI agent with the Squid SDK, connect the A2A connector by adding it to the connectedIntegrations option of the ask() function:
- TypeScript
- Python
await this.squid
.ai()
.agent('AGENT_ID')
.ask('What is the shipping status of order 1234?', {
connectedIntegrations: [
{
integrationId: 'A2A_CONNECTOR_ID',
integrationType: 'a2a',
description: 'Call this agent for shipping and logistics questions',
},
],
});
await squid.ai().agent('AGENT_ID').ask(
'What is the shipping status of order 1234?',
options={
'connectedIntegrations': [
{
'integrationId': 'A2A_CONNECTOR_ID',
'integrationType': 'a2a',
'description': 'Call this agent for shipping and logistics questions',
}
]
},
)
Limitations
- Calls to the remote agent are synchronous and text-based. Remote agents that respond with long-running task objects, streaming, or non-text content are not supported.
- The connector is outbound only: it lets a Squid agent call an external A2A agent. To expose capabilities from your Squid backend to other systems, see the MCP server documentation.
To have one Squid agent delegate to another Squid agent in the same application, you don't need A2A; use connected agents instead.