{"slug": "build-cross-language-multi-agent-team-with-googles-agent-development-kit-and-a2a", "title": "Build Cross-Language Multi-Agent Team with Google’s Agent Development Kit and A2A", "summary": "Google's Agent Development Kit (ADK) and the Agent2Agent (A2A) protocol enable a cross-language multi-agent system where a Python agent using Gemini extracts contract terms and a Go agent validates compliance, solving the problem of integrating agents built in different languages without rewriting services.", "body_md": "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.\n\nThis 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.\n\nIn 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)](https://adk.dev/).\n\nAlong the way, you'll learn three architectural patterns that separate production multi-agent systems from single-language demos:\n\nThe complete source code is available on [GitHub](https://github.com/GoogleCloudPlatform/generative-ai/tree/main/agents/adk/contract-compliance-pipeline).\n\nMost 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:\n\nThe 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.\n\nThe 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.\n\nA2A solves three fundamental problems:\n\nThe 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.\n\nHere is the Agent Card the Go compliance service exposes at ‘/.well-known/agent.json’:\n\n```\n// go-compliance-agent/internal/agentcard/card.go\nfunc GetCard() AgentCard {\n\tagentURL := os.Getenv(\"AGENT_URL\")\n\tif agentURL == \"\" {\n\t\tagentURL = \"http://localhost:8888\"\n\t}\n\n\treturn AgentCard{\n\t\tName:        \"Security Compliance Validator\",\n\t\tDescription: \"Go-based validation engine that checks vendor contracts against corporate compliance policy rules.\",\n\t\tVersion:     \"1.0.0\",\n\t\tSupportedInterfaces: []AgentInterface{\n\t\t\t{\n\t\t\t\tURL:             agentURL,\n\t\t\t\tProtocolBinding: \"JSONRPC\",\n\t\t\t\tProtocolVersion: \"1.0\",\n\t\t\t},\n\t\t},\n\t\tCapabilities: Capabilities{\n\t\t\tExtendedAgentCard: false,\n\t\t},\n\t\tDefaultInputModes:  []string{\"application/json\"},\n\t\tDefaultOutputModes: []string{\"application/json\"},\n\t\tSkills: []Skill{\n\t\t\t{\n\t\t\t\tID:          \"contract_compliance_check\",\n\t\t\t\tName:        \"Contract Compliance Check\",\n\t\t\t\tDescription: \"Validates extracted contract fields against corporate policy rules.\",\n\t\t\t\tTags:        []string{\"compliance\", \"contract\", \"validation\"},\n\t\t\t\tExamples: []string{\n\t\t\t\t\t\"Check this contract for compliance violations\",\n\t\t\t\t\t\"Validate vendor agreement terms against policy\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}\n```\n\nThe 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.\n\nHere is how easily this cross-language team is assembled using the ADK in Python and a standard HTTP server in Go.\n\nBefore 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.\n\nEach step in our compliance pipeline maps to a specific checkpoint:\n\n```\nclass ComplianceStep(str, Enum):\n    INGESTED = \"INGESTED\"                     # Contract uploaded, awaiting extraction\n    EXTRACTED = \"EXTRACTED\"                    # Fields parsed by Gemini\n    COMPLIANCE_PENDING = \"COMPLIANCE_PENDING\"  # Sent to Go agent, awaiting result\n    COMPLIANCE_COMPLETE = \"COMPLIANCE_COMPLETE\"# Go agent returned verdict\n    MANUAL_REVIEW = \"MANUAL_REVIEW\"           # Timeout or error, routed to human\n    REVIEW_READY = \"REVIEW_READY\"             # Report generated, violations found\n    APPROVED = \"APPROVED\"                      # All checks passed\n```\n\nThe 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.\n\nUsing 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.\n\n``` python\n# python-extraction-agent/app/agent.py\nfrom google.adk.agents import Agent, SequentialAgent\nfrom google.adk.agents.remote_a2a_agent import RemoteA2aAgent\nfrom google.adk.models import Gemini\n\n# Sub-Agent 1: Ingests & extracts details using LLM reasoning\nextractor_agent = Agent(\n   name=\"extractor_agent\",\n   model=Gemini(model=\"gemini-3.5-flash\"),\n   instruction=\"You are a Legal Data Extraction Agent. Extract contract fields: value, contractor, dates, insurance...\",\n   tools=[read_contract_text, save_extracted_fields, classify_risk_level]\n)\n\n# Sub-Agent 2: Go A2A Compliance Service wrapped as a local agent\ncompliance_agent = RemoteA2aAgent(\n   name=\"compliance_agent\",\n   agent_card=GO_AGENT_CARD_URL,\n   description=\"Validates extracted contract fields against corporate policies.\"\n)\n\n# Sub-Agent 3: Generates the final audit summary report\nreport_agent = Agent(\n   name=\"report_agent\",\n   model=Gemini(model=\"gemini-3.5-flash\"),\n   instruction=\"Generate the final compliance report and Markdown summary.\",\n   tools=[generate_summary_report]\n)\n\n# Coordinator: Chains them together sequentially\nroot_agent = SequentialAgent(\n   name=\"contract_compliance_coordinator\",\n    description=\"Orchestrates contract parsing, A2A compliance validation, and final reporting in sequence.\",\n   sub_agents=[extractor_agent, compliance_agent, report_agent],\n)\n```\n\nOn 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.\n\nHere's the simplified flow (the [full implementation](https://github.com/GoogleCloudPlatform/generative-ai/tree/main/agents/adk/contract-compliance-pipeline/go-compliance-agent) is in the repository):\n\n```\n// Simplified pseudo-code — see GitHub repository for full implementation\n\nfunc HandleJSONRPC(w http.ResponseWriter, r *http.Request) {\n    var req JSONRPCRequest\n    json.NewDecoder(r.Body).Decode(&req)\n\n    // Extract contract details from the A2A message\n    var details compliance.ContractDetails\n    extractContractFromMessage(req.Params, &details)\n\n    // Run deterministic policy checks\n    result := compliance.CheckCompliance(details, policy)\n\n    // Return verdict as a JSON-RPC response\n    writeJSONRPCResult(w, req.ID, result)\n}\n```\n\nThe complete pipeline ships as an open source application you can deploy and extend. The [repository](https://github.com/GoogleCloudPlatform/generative-ai/tree/main/agents/adk/contract-compliance-pipeline) includes a full-featured operations cockpit served by the FastAPI service.\n\nMulti-agent orchestration isn't just about chaining prompts; it's about building robust, cross-language distributed systems.\n\nBy 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.\n\nReady to run this yourself?", "url": "https://wpnews.pro/news/build-cross-language-multi-agent-team-with-googles-agent-development-kit-and-a2a", "canonical_source": "https://developers.googleblog.com/build-cross-language-multi-agent-team-with-google-agent-development-kit-and-a2a/", "published_at": "2026-06-23 23:59:35.254208+00:00", "updated_at": "2026-06-23 23:59:37.195384+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "ai-infrastructure", "large-language-models", "developer-tools"], "entities": ["Google", "Agent Development Kit", "Agent2Agent", "Gemini", "GitHub", "Python", "Go"], "alternates": {"html": "https://wpnews.pro/news/build-cross-language-multi-agent-team-with-googles-agent-development-kit-and-a2a", "markdown": "https://wpnews.pro/news/build-cross-language-multi-agent-team-with-googles-agent-development-kit-and-a2a.md", "text": "https://wpnews.pro/news/build-cross-language-multi-agent-team-with-googles-agent-development-kit-and-a2a.txt", "jsonld": "https://wpnews.pro/news/build-cross-language-multi-agent-team-with-googles-agent-development-kit-and-a2a.jsonld"}}