メインコンテンツまでスキップ

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 に相談するタイミングを判断し、質問を送信し、その回答を自身の回答に組み込みます。

仕組み:

  1. connector に remote agent の agent card URL(通常は /.well-known/agent.json で終わります)を指定します。agent card は remote agent の skills を記述します。
  2. Squid agent が remote agent が役立つと判断すると、prompt を使って呼び出し、text response を受け取ります。
  3. agent card の remote agent の description と skills によって、agent がいつ委任するかがガイドされます。

Squid application に A2A connector を追加する

  1. Squid ConsoleConnectors tab に移動します。

  2. Available Connectors をクリックします。

  3. A2A connector を見つけて、Add Connector を選択します。

  4. 次の設定詳細を指定します。

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 として安全に保存されます。
  1. Test Connection をクリックして、Squid が agent card を取得できることを確認し、その後 connector を追加します。

application で A2A connector を使用する

No-code Studio

  1. Squid ConsoleStudio tab に移動します。

  2. remote agent に委任する agent を開きます(または作成します)。

  3. Add Abilities をクリックし、先ほど作成した A2A connector を選択します。

  4. When to Use field で、agent がいつ remote agent に相談すべきかを説明します。例: "Call this when the user asks about shipping logistics."

  5. Test をクリックし、remote agent に委任されるべき質問をします。

Squid SDK を使用する

Squid SDK で AI agent を作成している場合は、ask() function の connectedIntegrations option に追加して A2A connector を接続します。

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',
},
],
});

制限事項

  • 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 を参照してください。
Squid agents を相互に接続する

同じ application 内で、ある Squid agent が別の Squid agent に委任するには、A2A は不要です。代わりに connected agents を使用してください。