A2A(Agent-to-Agent)
Squid AI agent を Agent-to-Agent(A2A)protocol を使用する external agent に接続します
概要
Agent-to-Agent(A2A)protocol は、異なる platform の AI agent 同士が communication できるようにする open standard です。A2A connector を使用すると、Squid AI agent は external の A2A-compatible agent に work を delegate できます。agent は remote agent に相談するタイミングを決定し、質問を送信して response を answer に組み込みます。
仕組み:
- connector で remote agent の agent card URL(通常は
/.well-known/agent.jsonで終わります)を指定します。agent card には remote agent の skill が記述されています。 - Squid agent が remote agent の支援が有効であると判断すると、prompt を指定して remote agent を call し、text response を受け取ります。
- agent card に含まれる remote agent の description と skill は、agent が delegate するタイミングを判断する guidance になります。
Squid Application に A2A Connector を追加する
-
Squid Console の Connectors tab に移動します。
-
Available Connectors をクリックします。
-
A2A connector を見つけ、Add Connector を選択します。
-
次の configuration detail を指定します。
Connector ID: code 内で connector を一意に識別する string。
A2A Agent Card URL: remote agent の agent card の URL。たとえば https://api.example.com/.well-known/agent.json。
Authorization(optional): remote agent が authentication を必要とする場合、各 request で送信する header を指定します。
- Header Name: auth header の name。default は
Authorization。 - Header Value:
Bearer <token>などの header value。Squid secretとして安全に保存されます。
- Test Connection をクリックして Squid が agent card を fetch できることを確認し、connector を追加します。
Application で A2A Connector を使用する
No-code Studio
-
Squid Console の Studio tab に移動します。
-
remote agent に delegate する agent を開くか、作成します。
-
Add Abilities をクリックし、先ほど作成した A2A connector を選択します。
-
When to Use field で、agent が remote agent に相談する状況を説明します。たとえば「user が shipping logistics について質問した場合にこれを call する」です。
-
Test をクリックし、remote agent に delegate すべき質問をします。
Squid SDK を使用する
Squid SDK を使用して AI agent を作成する場合は、ask() function の connectedIntegrations option に A2A connector を追加して接続します。
- 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',
}
]
},
)
制限事項
- remote agent への call は synchronous かつ text-based です。long-running task object、streaming、non-text content で response する remote agent はサポートされません。
- connector は outbound 専用です。Squid agent から external A2A agent を call できます。Squid backend の capability を他の system に公開するには、MCP server documentationを参照してください。
同じ application 内で一方の Squid agent から別の Squid agent に task を delegate する場合、A2A は必要ありません。代わりに connected agents を使用してください。