Google ADK and A2A Protocol for Cross-Language Agents
Google ADK and A2A Protocol for Cross-Language Agents
Most multi-agent demos I see use a single language — everything in Python, everything talking through the same framework, every agent sharing the same runtime assumptions. Real systems don’t work that way. Your compliance logic is in Go because it needs to be fast and deterministic. Your NLP pipeline is in Python because that’s where the model SDKs live. Your data layer speaks SQL and your API layer speaks gRPC.
Google just published a walkthrough that shows how to make these pieces actually talk to each other using two components from their agent stack: the Agent Development Kit (ADK) and the Agent-to-Agent (A2A) protocol. The specific example — a contract review pipeline where a Python agent parses legalese via Gemini and a Go agent validates compliance deterministically — is simple enough to follow but complex enough to show where the architecture matters.
I went through the published code and the architecture doc. Here’s what’s worth paying attention to.
The Architecture: Three Layers That Actually Make Sense
The setup has three distinct layers, and the clarity of the separation is why this works:
Layer 1 — Agent Cards for capability discovery. Each agent publishes an Agent Card, which is essentially a machine-readable manifest that says “here’s what I can do, here’s how to talk to me, here’s my endpoint.” When a coordinator agent needs a contract parsed, it doesn’t need to know which agent handles contracts. It queries the card registry, finds an agent that advertises contract parsing capability, and routes accordingly. This is the same discovery pattern that microservices have used for a decade, applied to agent systems.
Layer 2 — JSON-RPC 2.0 for communication. A2A uses a protocol that’s been in production for 15 years and has implementations in every language anyone actually uses. No custom serialization format, no protobuf dependency, no gRPC requirement unless you want it. The Python agent calls the Go agent the way any RPC system works — structured request, structured response, standardized error handling. The protocol itself is boring, which is exactly what you want from infrastructure.
Layer 3 — Task state machine for lifecycle management. Each agent interaction is modeled as a task with defined states: pending, running, completed, failed, cancelled. The coordinator tracks task state across the pipeline, which means if the compliance check fails, it knows exactly where in the flow things broke and can retry from that point rather than starting the whole pipeline over.
The key insight here isn’t any individual layer. It’s that all three layers are protocol-level abstractions, not framework-level ones. You don’t need to use ADK to participate. Any system that speaks JSON-RPC and publishes an Agent Card can join the pipeline.
The Contract Review Example, Step by Step
The published pipeline does this sequence:
- A user uploads a contract. The coordinator (itself an ADK agent) receives the task.
- Coordinator checks Agent Cards, finds a Python agent advertising “contract parsing” capability.
- Python agent calls Gemini to extract structured data: parties, dates, obligations, termination clauses.
- Gemini returns the extraction. Python agent packages it as a structured JSON response.
- Coordinator routes the structured extraction to a Go agent advertising “compliance validation.”
- Go agent runs deterministic rules — no LLM involved — checking whether the extracted terms violate any of 47 compliance rules.
- Go agent returns a pass/fail with specific rule citations for any violations.
- Coordinator assembles the final report and returns it to the user.
Step 6 is the part that matters. The Go agent is pure logic: if-then rules, pattern matching, arithmetic checks. There’s no model hallucination risk because there’s no model. The Python agent handles the fuzzy NLP task (parsing unstructured legal language). The Go agent handles the precise compliance task (deterministic rule evaluation). Each agent does what its language and runtime are good at.
The RemoteA2aAgent Abstraction
ADK provides a class called RemoteA2aAgent that wraps any A2A-compatible service and presents it as a local sub-agent. From the coordinator’s perspective, the Go compliance validator looks the same as a local Python agent — same interface, same task model, same error handling.
This is where the design earns its keep. You can start with all agents running locally in the same process for development. Then you move the compliance agent to a separate Go service without changing any integration code. Then you swap the Python agent to use a different model — Claude instead of Gemini, a fine-tuned open-source model instead of an API — and the coordinator doesn’t notice.
This abstraction layer is what separates A2A from earlier multi-agent frameworks. In CrewAI or AutoGen, swapping the underlying model or runtime typically means touching agent definition code. With A2A, the Agent Card is the contract, and everything behind it is an implementation detail.
Why Breaking Up Monolith Prompts Matters
The blog post makes a point that’s worth repeating: breaking a single monolithic prompt into specialized micro-agents solves real problems that anyone building production AI systems has hit.
Context degradation. A monolithic prompt that handles contract parsing and compliance validation in one shot gets long. The model’s attention diffuses across too many instructions. By the time it gets to the compliance rules at the bottom of the prompt, it’s effectively forgotten the parsing instructions at the top. Splitting into agents means each model only needs to focus on one thing.
Blast radius. When a monolithic agent fails, you don’t know which part failed. Did the parsing go wrong? The validation? The formatting? You have to debug the entire pipeline. With multi-agent decomposition, the compliance agent returns a specific error code with the exact rule that was violated. The blast radius of any failure is contained to a single agent.
Testability. You can’t unit-test a monolithic prompt. You can only run it end-to-end and compare outputs. But the Go compliance agent is pure deterministic logic — you can write a test suite with known inputs and expected pass/fail outputs, run it in CI, and know with confidence that the compliance rules are correct. The Python parsing agent is harder to test deterministically because it uses an LLM, but you can at least test that its output schema matches what the Go agent expects.
Where This Gets Interesting
The cross-language angle is what caught my attention, but the protocol-first design is what makes it scalable. A2A doesn’t care what language your agents are written in, what models they use, or where they run. An agent could be a Python service calling Gemini in us-central1, a Go binary running on-prem calling a fine-tuned Llama model, a Rust service that doesn’t use any model at all and just runs calculations — and they all compose into the same pipeline through the same protocol.
This matters for enterprise adoption in a way that framework-specific orchestration doesn’t. Large organizations have heterogeneous infrastructure. They have Go services that were written five years ago before anyone was thinking about AI agents. They have compliance requirements that mean some logic must run on-prem. They have procurement processes that make adding new SaaS dependencies painful. A protocol-based approach means they can add AI capabilities to existing services incrementally, rather than rebuilding everything on a new framework.
I don’t think A2A is going to instantly replace every multi-agent framework. The framework approach (LangGraph, CrewAI) gives you more control and more customization at the cost of more complexity. But for teams whose problem isn’t “I need maximum control over my agent topology” but rather “I need my existing services to participate in an agent pipeline without rewriting them,” the protocol approach makes a lot more sense.
What’s Missing
The published example is a clean demo. Production has a way of finding the gaps.
Agent Card freshness. If the Go compliance agent gets updated with new rules, how does the coordinator know? The current Agent Card model is static — publish once, query repeatedly. A production system needs card versioning and invalidation so coordinators don’t route to stale agent definitions.
Partial failure recovery. The task state machine handles clean failures well (agent returns an error, coordinator retries or reports). It’s less clear how it handles the messy ones: the Python agent times out after 30 seconds but Gemini actually succeeded and the response arrives after the timeout. The coordinator has to handle idempotency and duplicate detection, and the docs don’t go deep on this.
Observability. When a pipeline with five agents produces a wrong result, you need to know which agent was responsible. The current design has task-level tracing but lacks distributed tracing across the full pipeline. Without it, debugging multi-agent failures turns into the same nightmare as debugging microservice failures before OpenTelemetry existed.
Security boundaries. The example runs all agents in a trusted environment. In a real deployment, the Go compliance agent might be running in a different VPC with different access controls than the Python parsing agent. The A2A protocol needs authentication and authorization between agents, and the current docs are light on how that works in production. Google’s internal infrastructure solves this with their own service mesh, but external adopters will need to layer on their own auth.
These are solvable problems — they’re the same problems every distributed system has had to solve — but they’re also the difference between a working demo and a working production system. The good news is the protocol is extensible enough that the community can fill these gaps without waiting for Google.
Should You Pay Attention?
If you’re building multi-agent pipelines and your agents are all in Python using the same framework, ADK and A2A probably aren’t for you. You’re already getting the isolation benefits within your framework of choice.
If you have existing services in multiple languages that you want to compose into agent pipelines, or if you’re building agent infrastructure that needs to be language-agnostic at the protocol level, this is worth a serious look. The code is open source. The protocol spec is public. You can run a proof of concept in an afternoon.
The bigger bet Google is making here is that agent infrastructure should look more like the internet (open protocols, heterogeneous implementations) than like an operating system (single-vendor APIs, homogeneous runtime). That’s the right bet for enterprise adoption. Whether the execution keeps up with the ambition is what we’ll find out over the next year.
Sources:
- Google Developers Blog — ADK + A2A cross-language multi-agent tutorial
- A2A Protocol Specification (GitHub: google/A2A)
- Google Agent Development Kit documentation
- JSON-RPC 2.0 Specification