Google のエージェント開発キットと A2A を用いたクロス言語マルチエージェントチームの構築
Google は Agent Development Kit と A2A プロトコルを活用し、異なるプログラミング言語で動作する複数のエージェントを連携させるチーム構築手法を発表した。
キーポイント
異言語マルチエージェントの連携実現
異なるプログラミング言語(例:Python と Go)で開発された個別のエージェントを、A2A プロトコルを通じてシームレスに連携させることが可能になる。
A2A プロトコルの標準化
エージェント間の通信と協働を定義する「Agent-to-Agent (A2A)」プロトコルが、Google の開発キットを通じて実装・利用される基盤として提示された。
チーム型アーキテクチャの構築
単一のエージェントではなく、複数の専門エージェントを「チーム」として構成し、複雑なタスクを分担・処理する新しい開発パラダイムが示された。
影響分析・編集コメントを表示
影響分析
この発表は、AI エージェント開発における「言語の壁」を解消し、既存の資産や異なる技術スタックを持つエージェントを統合して活用する道を開く画期的な進展です。これにより、大規模で複雑なタスクを解決するための柔軟なマルチエージェントアーキテクチャが実用レベルで加速され、企業内のシステム連携や分散型 AI 応用の拡大に大きく寄与すると考えられます。
編集コメント
異なる言語で書かれたエージェント同士が互いに協力できる仕組みは、実世界での複雑なタスク自動化において極めて重要なブレークスルーです。ただし、実際の導入においてはプロトコルの標準化とセキュリティ要件の整備が今後の課題となるでしょう。
2026 年 6 月 22 日
デベロッパーリレーションズエンジニア
Python エージェントと Go エージェントが Agent2Agent プロトコルを用いて契約コンプライアンスにどのように協力するか
あなたの契約コンプライアンスパイプラインには問題があります。データサイエンスチームは、Gemini を使用して法的契約を解析し、すべての主要な条項を抽出する優れた抽出エージェントを Python で作成しました。セキュリティエンジニアリングチームは、すべての決定論的ロジックと LLM(大規模言語モデル)を使用しないことで、Go で非常に高速なコンプライアンスバリデーターを構築しました。どちらも単独では完璧に機能します。しかし今、これらを単一の調整されたパイプラインとして連携させる必要があり、どちらのチームも自社のサービスを別の言語で書き直す気はありません。
これが生産環境における AI システムの実態です:異なるチーム、異なる言語、異なるデプロイ先。あなたが直面するかどうかではなく、どう解決するかという問題です。
本稿では、Gemini を使用して契約条項を抽出する Python エージェントと、企業ポリシーに対してそれらを検証する Go エージェントからなる契約コンプライアンスマルチエージェントパイプラインを構築します。両サービスはAgent2Agent (A2A) プロトコルによって接続され、Googleの Agent Development Kit (ADK) によってオーケストレーションされます。
その過程で、単一言語のデモと本番環境でのマルチエージェントシステムを分ける 3 つのアーキテクチャパターンを学びます。
- A2A プロトコルを用いた異言語間エージェント連携により、チームは各タスクに最適な言語でエージェントを構築でき、コードの書き換えが不要になります。
- ADK の RemoteA2aAgent(RemoteA2aAgent)抽象化により、数行のコードで任意のリモート A2A 準拠サービスをローカルサブエージェントとして扱えるようになります。
- 専門的な責任範囲を持つ複数のエージェントによるマルチエージェントパイプラインオーケストレーションにより、何でもやろうとする単一の巨大なプロンプトに代わります。
完全なソースコードは GitHub で公開されています。
image
エージェント 1 つでは不十分な場合
ほとんどの AI プロジェクトは同じように始まります:巨大なエージェント 1 つ、膨大なプロンプト 1 つ、すべてのツールを単一のコンテキストウィンドウに詰め込む。これはデモでは機能しますが、本番環境では以下の 3 つの主要な理由で崩壊します:
- コンテキストの劣化:ツールが 10〜15 を超えて増加すると、モデルは指示を見落とし、誤ったツールを呼び出したり、パラメータを捏造し始めます。追加される各ツールは、モデルの注意をより広い範囲に分散させることになります。翻訳、要約、メール作成も担当する契約書抽出エージェントは、最終的にどのツールを呼ぶべきか混乱してしまいます。
- 爆発半径:マイナーな機能における未処理の例外が、エージェントのターン全体をクラッシュさせます。翻訳 API のレート制限が、ワークフロー全体を停止させるべきではありません。しかし、モノリス型のアージェントでは、あらゆる失敗が完全な失敗となります。
- テスト不能性:50 の絡み合った責任を持つシステムをきれいに単体テストすることはできません。プロンプトの変更が潜在的にすべての下流の動作に影響を与える場合、回帰評価は推測の域を出ません。
解決策は、10 年前にバックエンドエンジニアリングを変革したと同じパターンです:モノリスを専門的なマイクロサービスに分解することです。各エージェントには一つの仕事と、焦点を絞ったプロンプト、そして最小限のツールセットが割り当てられます。

A2A プロトコル:エージェントが互いに発見し、対話する方法
Agent-to-Agent (A2A) プロトコルは、あらゆる言語やフレームワークで構築されたエージェントが相互運用できるようにするオープンスタンダードです。これはエージェントの世界における HTTP のようなものだと考えてください。内部の仕組みに関係なく、任意の 2 つのエージェントが通信できるための共通契約です。
A2A は 3 つの根本的な問題を解決します:
- ディスカバリー:エージェントは、/.well-known/agent.json で提供される Agent Cards(エージェントカード)と呼ばれる JSON メタデータを通じて、自らの機能を宣伝します。REST API 向けの OpenAPI 仕様書と同様に、このカードにはエージェントの名前、URL、バージョン、スキル、およびサポートされている入力・出力形式が宣言されます。呼び出し元のエージェントは、まずこのカードを取得して、遠隔のエージェントが何ができるかを理解します。
- コミュニケーション:すべてのデータ交換は JSON-RPC 2.0 を介して行われ、単一のエンドポイントを経由してルーティングされます。エージェント間の通信における中核となるメソッドは message/send です(当社の実装では、契約データの送信と結果の同期的な受信に使用されています)。これに加え、タスクの送信や取得には tasks/send や tasks/get といったプロトコルメソッドも用意されています。データは型付きの Message Parts(メッセージパーツ)内に運ばれ、自然言語には TextParts(テキストパーツ)、構造化された JSON データには DataParts(データパーツ)が使用されます。
- タスクライフサイクル:すべての相互作用は Task(タスク)に包囲され、明確に定義された状態(submitted: 送信済み、working: 作業中、completed: 完了、failed: 失敗)を遷移します。この状態機械により、エージェントは同じプロトコルで同期的なワークフロー(今すぐこの契約を確認する)と非同期的なワークフロー(48 時間かけてこの文書を検証する)の両方を処理できます。
このアプローチの素晴らしい点は、どちらのエージェントも相手の実装について何も知らなくてよいことです。Python エージェントが Go パッケージをインポートする必要はありませんし、Go エージェントが Python コードを実行することもありません。彼らは HTTP を介して共通のプロトコルで会話するだけです。
image
エージェントカードは実際にはどのようなものか
Go コンプライアンスサービスが「/.well-known/agent.json」で公開しているエージェントカードの例を以下に示します:
// go-compliance-agent/internal/agentcard/card.go
func GetCard() AgentCard {
agentURL := os.Getenv("AGENT_URL")
if agentURL == "" {
agentURL = "http://localhost:8888"
}
return AgentCard{
Name: "Security Compliance Validator",
Description: "Go ベースの検証エンジンで、ベンダー契約を企業のコンプライアンスポリシー規則に対してチェックします。",
Version: "1.0.0",
SupportedInterfaces: []AgentInterface{
{
URL: agentURL,
ProtocolBinding: "JSONRPC",
ProtocolVersion: "1.0",
},
},
Capabilities: Capabilities{
ExtendedAgentCard: false,
},
DefaultInputModes: []string{"application/json"},
DefaultOutputModes: []string{"application/json"},
Skills: []Skill{
{
ID: "contract_compliance_check",
Name: "Contract Compliance Check",
Description: "抽出された契約フィールドを企業のポリシー規則に対して検証します。",
Tags: []string{"compliance", "contract", "validation"},
Examples: []string{
"この契約のコンプライアンス違反をチェックする",
"ベンダー契約条項をポリシーに対して検証する",
},
},
},
}
}
Go
Copied
必ず JSON 形式で返してください。translation フィールドのみ。他のフィールド (technical_terms など) は一切追加しないこと — 余計なフィールドを書こうとして本文翻訳がトークン上限で打ち切られる事故を防ぐため:
{"translation": "翻訳全文"}
URL は環境変数から読み込まれるため、同じコードをローカル('localhost:8888')でもコンテナ内('go-compliance-agent:8888')でも動作させることができます。Skills 配列とは、単一のエージェントが複数の機能(capabilities)を広告できることを意味します。
コード実装のウォークスルー
Python で ADK を使用し、Go で標準的な HTTP サーバーを実装することで、このクロス言語チームがいかに容易に構築されるかを見ていきましょう。
エージェント間のデータバス:共有状態
個々のエージェントの詳細に入る前に、それらがどのように通信するかを理解することが重要です。ADK の ToolContext.state は、パイプライン内のすべてのサブエージェントが読み書きする共有辞書(dictionary)を提供します。関数の引数や戻り値を介してエージェント間でデータを渡すのではなく、エージェントは共有セッション状態(session state)を通じて通信を行います。
コンプライアンス・パイプラインの各ステップは、特定のチェックポイントにマッピングされます:
class ComplianceStep(str, Enum):
INGESTED = "INGESTED" # 契約書がアップロードされ、抽出待ち
EXTRACTED = "EXTRACTED" # Gemini によってフィールドが解析済み
COMPLIANCE_PENDING = "COMPLIANCE_PENDING" # Go エージェントへ送信され、結果待ち
COMPLIANCE_COMPLETE = "COMPLIANCE_COMPLETE"# Go エージェントから verdict(判断)が返却された
MANUAL_REVIEW = "MANUAL_REVIEW" # タイムアウトまたはエラーが発生し、人間へルーティング
REVIEW_READY = "REVIEW_READY" # レポート生成済み、違反事項発見
APPROVED = "APPROVED" # すべてのチェックに合格
Python
Copied
MANUAL_REVIEW ステートは強調する価値があります。サーバークラッシュ、ネットワークタイムアウト、コンテナの起動失敗などの理由により Go コンプライアンスエージェントが到達不能になった場合、パイプラインは単に失敗するのではなく、MANUAL_REVIEW 状態へ遷移し、ケースを人間の法務レビュー担当者にルーティングします。このフェイルセーフパターンは、下流サービスが一時的に利用できない可能性がある本番システムにおいて不可欠です。
1. フルマルチエージェントパイプライン:Go エージェントを Python でラップする
ADK を使用すれば、RemoteA2aAgent を用いてローカルでリモート A2A 準拠のエージェントを定義できます。SDK は、エージェントカードのハンドシェイク、パラメータのシリアライズ、JSON-RPC ネットワークリクエストを裏側で自動的に処理します。
# python-extraction-agent/app/agent.py
from google.adk.agents import Agent, SequentialAgent
from google.adk.agents.remote_a2a_agent import RemoteA2aAgent
from google.adk.models import Gemini
サブエージェント 1:LLM の推論を用いて詳細をインジェスト・抽出する
extractor_agent = Agent(
name="extractor_agent",
model=Gemini(model="gemini-3.5-flash"),
instruction="あなたは法務データ抽出エージェントです。契約書の項目(金額、契約相手、日付、保険など)を抽出してください...",
tools=[read_contract_text, save_extracted_fields, classify_risk_level]
)
サブエージェント 2:ローカルエージェントとしてラップされた Go A2A コンプライアンスサービス
compliance_agent = RemoteA2aAgent(
name="compliance_agent",
agent_card=GO_AGENT_CARD_URL,
description="抽出された契約項目が企業ポリシーに適合しているか検証します。"
)
サブエージェント 3:最終監査サマリーレポートの生成
report_agent = Agent(
name="report_agent",
model=Gemini(model="gemini-3.5-flash"),
instruction="最終コンプライアンスレポートと Markdown サマリーの生成。",
tools=[generate_summary_report]
)
コーディネーター:これらを順次連鎖させる
root_agent = SequentialAgent(
name="contract_compliance_coordinator",
description="契約の解析、A2A(Agent-to-Agent)コンプライアンス検証、および最終レポートを順に調整する。",
sub_agents=[extractor_agent, compliance_agent, report_agent],
)
Python
Copied
2. Go におけるコンプライアンスエンドポイント
Go 側では、コンプライアンスエージェントは A2A プロトコルを実装する標準的な HTTP サーバーです。発見のための Agent Card(エージェントカード)を公開し、メッセージ送信リクエストを受け付ける単一の JSON-RPC エンドポイントを備えています。これは抽出された契約フィールドに対して決定論的なポリシーチェックを実行し、合格/不合格の判定結果を返します。AI フレームワークや SDK は不要で、Go の標準ライブラリのみを使用すれば十分です。
以下に簡略化されたフローを示します(完全な実装 はリポジトリにあります):
// 簡略化した擬似コード — 完全な実装は GitHub リポジトリを参照してください
func HandleJSONRPC(w http.ResponseWriter, r *http.Request) {
var req JSONRPCRequest
json.NewDecoder(r.Body).Decode(&req)
必ず JSON 形式で返してください。translation フィールドのみ。他のフィールド (technical_terms 等) は一切追加しないこと — 余計なフィールドを書こうとして本文翻訳がトークン上限で打ち切られる事故を防ぐため:
{"translation": "翻訳全文"}
// A2A メッセージから契約詳細を抽出
var details compliance.ContractDetails
extractContractFromMessage(req.Params, &details)
// 決定論的なポリシーチェックを実行
result := compliance.CheckCompliance(details, policy)
// 判定結果を JSON-RPC レスポンスとして返す
writeJSONRPCResult(w, req.ID, result)
}
Go
Copied
## オープンソースアプリ:契約コンプライアンスエンジン
完全なパイプラインは、デプロイして拡張可能なオープンソースアプリケーションとして提供されます。リポジトリには、FastAPI サービスによって提供されるフル機能の運用コックピットが含まれています。
- 3 パネル構成の操作コックピット:左パネルではオペレーターが契約書を選択またはアップロードできます。中央パネルにはライブ結果が表示され、合格した契約書のコンプライアンス証明書と、失敗した契約書の違反レポートが示されます。右パネルは開発者用コンソールで、ポリシー制御、ネットワークシミュレーション、および 2 つのエージェント間で流れるデータのリアルタイムビューを提供します。
- ネットワーク障害シミュレーション:トグルスイッチにより、Go エージェントの状態を「通常」「遅延」「クラッシュ」の間で切り替えられます。「クラッシュ」に設定すると、フェイルセーフが作動する様子が確認できます。Python エージェントが停止を検知し、パイプラインを一時停止して、契約書を黙って失敗させるのではなく、手動での人間によるレビュー用にルーティングします。
- リアルタイムエージェント引継ぎインスペクター:右パネルには、Python から Go へ送信された正確なリクエストと、戻ってくるレスポンスが表示され、構造化された契約データが言語の境界を越えてリアルタイムで移動する様子を直接確認できます。
image
ADK と A2A アプローチの利点
- テクノロジーの自由:データサイエンスチームは Python で複雑な認知エージェントを記述でき、システムチームは Go、Rust、または C++ で高性能で安全なコンプライアンスバリデーターを記述できます。
- 統合の簡素化:Python のオーケストレーターは、Go エージェントをローカルクラスであるかのように通信します。カスタム HTTP クライアントを書いたり、手動での JSON-RPC ペイロードラップ処理を行ったりする必要はありません。
- 回復力:エージェントが分離されているため、微細なタイムアウトとリトライロジックを設定できます。Go バリデーターがダウンしている場合、Python エージェントは現在の状態チェックポイントを取得し、手動承認を待ちます。
- 隔離された監査:Go のコンプライアンスバリデーターは完全に決定論的です。監査目的のためには、同じ入力を渡して同一のポリシー判断結果が得られることを検証でき、LLM の非決定性を迂回できます。
結論
マルチエージェントオーケストレーションとは、単にプロンプトを連鎖させることではなく、堅牢なクロス言語分散システムを構築することです。
Google ADK とオープン A2A プロトコルを用いて Python の AI エコシステムと Go のランタイム信頼性を橋渡しすることで、両者の最良の要素を得ることができます。すなわち、曖昧さがある場所では認知推論を、ポリシーが必要な場所では決定論的な執行を実現します。
実際に自分で実行してみたいですか?
- contract-compliance-engine をクローンして、ローカル環境でライブデモを実行してください
- セッション管理、マルチエージェントパターン、評価フレームワークについては ADK のドキュメントを参照してください
- 詳細については Agent2Agent Protocol のドキュメントをご覧ください。
Previous
Next
原文を表示
JUNE 22, 2026
Developer Relations Engineer
How a Python agent and a Go agent collaborate on contract compliance using the Agent2Agent protocol
Your contract compliance pipeline has a problem. The data science team wrote a brilliant extraction agent in Python. It uses Gemini to parse legal contracts and pull out every key term. The security engineering team built a blazing-fast compliance validator in Go, using all deterministic logic and no LLM. Both work perfectly in isolation. But now you need them to work together, as a single coordinated pipeline, and neither team is willing to rewrite their service in another language.
This is the reality of production AI systems: different teams, different languages, different deployment targets. The question isn't whether you'll face this; it's how you'll solve it.
In this post, we'll build a Contract Compliance Multi-Agent Pipeline where a Python agent extracts contract terms using Gemini and a Go agent validates them against corporate policy. The two services are connected by the Agent2Agent (A2A) protocol and orchestrated by Google's Agent Development Kit (ADK).
Along the way, you'll learn three architectural patterns that separate production multi-agent systems from single-language demos:
- Cross-language agent collaboration using the A2A protocol so teams can build agents in the best language for the job without rewriting code.
- ADK's RemoteA2aAgent abstraction that turns any remote A2A-compliant service into a local sub-agent with a few lines of code
- Multi-agent pipeline orchestration where specialized agents with narrow responsibilities replace monolithic prompts that try to do everything
The complete source code is available on GitHub.

When one agent isn't enough
Most AI projects start the same way: one big agent, one massive prompt, every tool crammed into a single context window. It works for demos. It falls apart in production for three key reasons:
- Context degradation: As tools multiply beyond 10-15, the model starts missing instructions, calling wrong tools, or hallucinating parameters. Each additional tool dilutes the model's attention across a wider surface area. A contract extraction agent that also handles translation, summarization, and email drafting will eventually get confused about which tool to call when.
- Blast radius: One unhandled exception in a minor feature crashes the entire agent turn. A rate limit on a translation API shouldn't bring down your entire workflow. But in a monolithic agent, every failure is a total failure.
- Untestable: You can't cleanly unit test a system with 50 entangled responsibilities. When every prompt change potentially affects every downstream behavior, evaluating regressions becomes guesswork.
The fix is the same pattern that transformed backend engineering a decade ago: decompose the monolith into specialized microservices. Each agent gets one job, a focused prompt, and a minimal toolset.

The A2A protocol: how agents discover and talk to each other
The Agent-to-Agent (A2A) protocol is an open standard that enables agents built in any language or framework to interoperate. Think of it as the HTTP of the agent world: a shared contract that lets any two agents communicate regardless of how they're built internally.
A2A solves three fundamental problems:
- Discovery: Agents advertise their capabilities through Agent Cards, JSON metadata served at /.well-known/agent.json. Similar to OpenAPI specs for REST APIs, the card declares the agent's name, URL, version, skills, and supported input/output formats. A calling agent fetches the card first to understand what the remote agent can do.
- Communication: All data exchange happens over JSON-RPC 2.0, routed through a single endpoint. The core method for agent communication is message/send (used by our implementation to submit contract data and receive results synchronously), alongside other protocol methods like tasks/send and tasks/get for task submission and retrieval. Data travels inside typed Message Parts: TextParts for natural language and DataParts for structured JSON.
- Task lifecycle: Every interaction is wrapped in a Task that transitions through well-defined states: submitted, working, completed, or failed. This state machine means agents can handle both synchronous workflows (check this contract now) and asynchronous ones (verify this document over 48 hours) with the same protocol.
The beauty of this approach is that neither agent needs to know anything about the other's implementation. The Python agent doesn't import Go packages. The Go agent doesn't run Python code. They just speak a shared protocol over HTTP.

What an Agent Card Actually looks like
Here is the Agent Card the Go compliance service exposes at ‘/.well-known/agent.json’:
// go-compliance-agent/internal/agentcard/card.go
func GetCard() AgentCard {
agentURL := os.Getenv("AGENT_URL")
if agentURL == "" {
agentURL = "http://localhost:8888"
}
return AgentCard{
Name: "Security Compliance Validator",
Description: "Go-based validation engine that checks vendor contracts against corporate compliance policy rules.",
Version: "1.0.0",
SupportedInterfaces: []AgentInterface{
{
URL: agentURL,
ProtocolBinding: "JSONRPC",
ProtocolVersion: "1.0",
},
},
Capabilities: Capabilities{
ExtendedAgentCard: false,
},
DefaultInputModes: []string{"application/json"},
DefaultOutputModes: []string{"application/json"},
Skills: []Skill{
{
ID: "contract_compliance_check",
Name: "Contract Compliance Check",
Description: "Validates extracted contract fields against corporate policy rules.",
Tags: []string{"compliance", "contract", "validation"},
Examples: []string{
"Check this contract for compliance violations",
"Validate vendor agreement terms against policy",
},
},
},
}
}Go
Copied
The URL is read from an environment variable so the same code works locally (‘localhost:8888’) and in containers (‘go-compliance-agent:8888’). The Skills array means a single agent can advertise multiple capabilities.
Code Implementation Walkthrough
Here is how easily this cross-language team is assembled using the ADK in Python and a standard HTTP server in Go.
Shared state: the data bus between agents
Before diving into individual agents, it's important to understand how they communicate. ADK's ToolContext.state provides a shared dictionary that all sub-agents in a pipeline read and write to. Rather than passing data between agents through function arguments or return values, agents communicate through a shared session state.
Each step in our compliance pipeline maps to a specific checkpoint:
class ComplianceStep(str, Enum):
INGESTED = "INGESTED" # Contract uploaded, awaiting extraction
EXTRACTED = "EXTRACTED" # Fields parsed by Gemini
COMPLIANCE_PENDING = "COMPLIANCE_PENDING" # Sent to Go agent, awaiting result
COMPLIANCE_COMPLETE = "COMPLIANCE_COMPLETE"# Go agent returned verdict
MANUAL_REVIEW = "MANUAL_REVIEW" # Timeout or error, routed to human
REVIEW_READY = "REVIEW_READY" # Report generated, violations found
APPROVED = "APPROVED" # All checks passedPython
Copied
The MANUAL_REVIEW state is worth highlighting. If the Go compliance agent is unreachable for reasons like server crash, network timeout, container not started - the pipeline doesn't just fail. It transitions to MANUAL_REVIEW, routing the case to a human legal reviewer. This fail-safe pattern is essential for production systems where downstream services may be intermittently unavailable.
1. Full Multi-Agent Pipeline: Wrapping the Go Agent in Python
Using the ADK, you can define a remote A2A-compliant agent locally using RemoteA2aAgent. The SDK automatically handles the Agent Card handshake, parameter serialization, and JSON-RPC network requests behind the scenes.
# python-extraction-agent/app/agent.py
from google.adk.agents import Agent, SequentialAgent
from google.adk.agents.remote_a2a_agent import RemoteA2aAgent
from google.adk.models import Gemini
# Sub-Agent 1: Ingests & extracts details using LLM reasoning
extractor_agent = Agent(
name="extractor_agent",
model=Gemini(model="gemini-3.5-flash"),
instruction="You are a Legal Data Extraction Agent. Extract contract fields: value, contractor, dates, insurance...",
tools=[read_contract_text, save_extracted_fields, classify_risk_level]
)
# Sub-Agent 2: Go A2A Compliance Service wrapped as a local agent
compliance_agent = RemoteA2aAgent(
name="compliance_agent",
agent_card=GO_AGENT_CARD_URL,
description="Validates extracted contract fields against corporate policies."
)
# Sub-Agent 3: Generates the final audit summary report
report_agent = Agent(
name="report_agent",
model=Gemini(model="gemini-3.5-flash"),
instruction="Generate the final compliance report and Markdown summary.",
tools=[generate_summary_report]
)
# Coordinator: Chains them together sequentially
root_agent = SequentialAgent(
name="contract_compliance_coordinator",
description="Orchestrates contract parsing, A2A compliance validation, and final reporting in sequence.",
sub_agents=[extractor_agent, compliance_agent, report_agent],
)Python
Copied
2. The Go Compliance Endpoint
On the Go side, the compliance agent is a standard HTTP server that implements the A2A protocol. It exposes an Agent Card for discovery and a single JSON-RPC endpoint that accepts message/send requests, runs deterministic policy checks against the extracted contract fields, and returns a pass/fail verdict. No AI frameworks or SDKs needed — just the Go standard library.
Here's the simplified flow (the full implementation is in the repository):
// Simplified pseudo-code — see GitHub repository for full implementation
func HandleJSONRPC(w http.ResponseWriter, r *http.Request) {
var req JSONRPCRequest
json.NewDecoder(r.Body).Decode(&req)
// Extract contract details from the A2A message
var details compliance.ContractDetails
extractContractFromMessage(req.Params, &details)
// Run deterministic policy checks
result := compliance.CheckCompliance(details, policy)
// Return verdict as a JSON-RPC response
writeJSONRPCResult(w, req.ID, result)
}Go
Copied
Open source App: Contract Compliance Engine
The complete pipeline ships as an open source application you can deploy and extend. The repository includes a full-featured operations cockpit served by the FastAPI service.
- Three-panel operations cockpit: The left panel lets operators select or upload contracts. The center panel shows live results: compliance certificates for passing contracts and violation reports for failures. The right panel is a developer console with policy controls, network simulation, and a real-time view of the data flowing between the two agents.
- Network fault simulation: A toggle lets you switch the Go agent between Normal, Delayed, and Crashed states. Setting it to Crashed shows the fail-safe in action: the Python agent detects the outage, halts the pipeline, and routes the contract for manual human review instead of silently failing.
- Live agent handoff inspector: The right panel displays the exact request sent from Python to Go and the response coming back, so you can see the structured contract data crossing the language boundary in real time.

Benefits of the ADK and A2A Approach
- Freedom of Technology: Your data science team can write complex cognitive agents in Python, and your systems team can write high-performance, secure compliance validators in Go, Rust, or C++.
- Simplified Integration: The Python orchestrator communicates with the Go agent as if it were a local class. You do not have to write custom HTTP clients or handle manual JSON-RPC payload wrapping.
- Resilience: Because the agents are decoupled, you can configure granular timeouts and retry logic. If the Go validator is down, the Python agent saves the current state checkpoint and waits for manual approval.
- Isolated Auditing: The Go compliance validator is completely deterministic. For audit purposes, you can pass the same inputs and verify they produce identical policy verdicts, bypassing LLM non-determinism.
Conclusion
Multi-agent orchestration isn't just about chaining prompts; it's about building robust, cross-language distributed systems.
By bridging Python's AI ecosystem and Go's runtime reliability using Google ADK and the open A2A protocol, you get the best of both worlds: cognitive reasoning where there is ambiguity, and deterministic enforcement where there is policy.
Ready to run this yourself?
- Clone the contract-compliance-engine and run the live demo locally
- Explore the ADK documentation for session management, multi-agent patterns, and evaluation frameworks
- Explore the Agent2Agent Protocol documentation for more details.
Previous
Next
関連記事
ゲーム理論では、一般化された戦略が専門化された戦略に勝る場合がある
MIT の研究者らが発表した研究で、不完全な情報下でのポーカーや入札競争などのシナリオにおいて、特定の状況に特化した専門家よりも、幅広い状況に対応できる一般化された戦略の方が勝利する可能性を示した。
30 億パラメータモデル上でマルチエージェント経済を稼働:Thousand Token Wood の実装
Hugging Face は、30 億パラメータの軽量モデルを用いて複数のエージェントが経済活動を行うシステム「Thousand Token Wood」の実装と配送を発表した。
Amazon Bedrock AgentCore を活用し、Baz が AI エージェントのコードレビュー精度を向上させた方法
Baz は開発者と製品要件の乖離により手動レビューが非効率だった課題に対し、Amazon Bedrock AgentCore を導入。これにより機能要件や設計意図への適合性を自動検証可能となり、納期短縮と品質の一貫性向上を実現した。
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み