The post presents a contract-compliance pipeline in which a Python agent uses Gemini to extract contract terms and a Go service applies deterministic corporate-policy checks. It connects the services with the Agent2Agent (A2A) protocol and uses Google's Agent Development Kit (ADK), including RemoteA2aAgent, to expose the remote validator as a local sub-agent in a SequentialAgent. A2A supplies discovery through Agent Cards at /.well-known/agent.json, JSON-RPC 2.0 messaging through message/send, typed Message Parts, and task states such as submitted, working, completed, and failed. Pipeline state is shared through ADK's ToolContext.state, with failures transitioning to MANUAL_REVIEW for human legal review when the Go service is unavailable. The accompanying open-source application demonstrates live handoffs, policy verdicts, and simulated network faults, while the conclusion emphasizes language independence, decoupling, resilience, and deterministic auditing.
Context
The contract-compliance workflow combines an extraction agent written in Python with a deterministic compliance validator written in Go, but the teams do not want to rewrite their services in another language. The post also identifies monolithic agents' context degradation, broad failure impact, and testing difficulties as motivations for specialized agents.
Approach / What changed
A Python extraction agent and Go compliance service communicate over the A2A protocol, while Google's ADK orchestrates them through RemoteA2aAgent and SequentialAgent. Agent Cards enable discovery, JSON-RPC 2.0 carries structured messages, ToolContext.state stores pipeline checkpoints, and unavailable downstream services route cases to MANUAL_REVIEW.
Takeaways
1
RemoteA2aAgent handles the Agent Card handshake, parameter serialization, and JSON-RPC network requests for a remote A2A-compliant service.
2
The pipeline records checkpoints in ToolContext.state and routes failures such as Go-agent crashes or timeouts to MANUAL_REVIEW for human legal review.
3
The Go service uses the standard library and deterministic policy checks, allowing identical inputs to produce verifiable compliance verdicts without LLM non-determinism.
A2A lets agents discover each other and hand off tasks over JSON-RPC 2.0. This guide walks through exposing an Agent Card, sending typed messages, connecting a remote service, and routing failures to a human review checkpoint.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.