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

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 に組み込みます。

仕組み:

  1. connector で remote agent の agent card URL(通常は /.well-known/agent.json で終わります)を指定します。agent card には remote agent の skill が記述されています。
  2. Squid agent が remote agent の支援が有効であると判断すると、prompt を指定して remote agent を call し、text response を受け取ります。
  3. agent card に含まれる remote agent の description と skill は、agent が delegate するタイミングを判断する guidance になります。

Squid Application に A2A Connector を追加する​

  1. Squid Console の Connectors tab に移動します。

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

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

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

Application で A2A Connector を使用する​

No-code Studio​

  1. Squid Console の Studio tab に移動します。

  2. remote agent に delegate する agent を開くか、作成します。

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

  4. When to Use field で、agent が remote agent に相談する状況を説明します。たとえば「user が shipping logistics について質問した場合にこれを call する」です。

  5. Test をクリックし、remote agent に delegate すべき質問をします。

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 への 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を参照してください。
Squid Agent 同士の接続

同じ application 内で一方の Squid agent から別の Squid agent に task を delegate する場合、A2A は必要ありません。代わりに connected agents を使用してください。