A2A (Agent-to-Agent)
Squid AI エージェントを、Agent-to-Agent (A2A) protocol を話す外部エージェントに接続します
概要
Agent-to-Agent (A2A) protocol は、異なるプラットフォームの AI agents が相互に通信できるようにするオープンスタンダードです。A2A connector を使用すると、Squid AI agent は外部の A2A-compatible agent に作業を委任できます。あなたの agent は、remote agent に相談するタイミングを判断し、質問を送信し、その回答を自身の回答に組み込みます。
仕組み:
- connector に remote agent の agent card URL(通常は
/.well-known/agent.jsonで終わります)を指定します。agent card は remote agent の skills を記述します。 - Squid agent が remote agent が役立つと判断すると、prompt を使って呼び出し、text response を受け取ります。
- agent card の remote agent の description と skills によって、agent がいつ委任するかがガイドされます。
Squid application に A2A connector を追加する
-
Squid Console の Connectors tab に移動します。
-
Available Connectors をクリックします。
-
A2A connector を見つけて、Add Connector を選択します。
-
次の設定詳細を指定します。
Connector ID: コード内で 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 の名前。デフォルトは
Authorizationです。 - Header Value:
Bearer <token>などの header value。Squid secret として安全に保存されます。
- Test Connection をクリックして、Squid が agent card を取得できることを確認し、その後 connector を追加します。
application で A2A connector を使用する
No-code Studio
-
Squid Console の Studio tab に移動します。
-
remote agent に委任する agent を開きます(または作成します)。
-
Add Abilities をクリックし、先ほど作成した A2A connector を選択します。
-
When to Use field で、agent がいつ remote agent に相談すべきかを説明します。例: "Call this when the user asks about shipping logistics."
-
Test をクリックし、remote agent に委任されるべき質問をします。
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 への呼び出しは synchronous かつ text-based です。long-running task objects、streaming、または non-text content で応答する remote agents はサポートされていません。
- connector は outbound のみです。つまり、Squid agent が外部の A2A agent を呼び出せるようにします。Squid backend の capabilities を他の systems に公開するには、MCP server documentation を参照してください。
同じ application 内で、ある Squid agent が別の Squid agent に委任するには、A2A は不要です。代わりに connected agents を使用してください。