⚠️ DISCLAIMER: THIS DEMO IS INTENDED FOR DEMONSTRATION PURPOSES ONLY. IT IS NOT INTENDED FOR USE IN A PRODUCTION ENVIRONMENT.⚠️ Important: A2A is a work in progress (WIP) thus, in the near future there might be changes that are different from what demonstrated here.
This sample highlights how to use the Agent2Agent (A2A) protocol for multi-agent collaboration where multiple agents, each written in a different programming language, seamlessly work together to accomplish a goal.
The sample also highlights the interoperability made possible by the A2A protocol, demonstrating how an agent can be easily swapped out for an equivalent agent written in a different programming language. This also permits step-by-step migration of complex systems.
The application features a content creation pipeline with a host agent that routes requests to the appropriate specialized agent:
- Host Agent (Python, Google ADK, A2A Python SDK): Acts as the central orchestrator for content creation, dynamically determining which agent to send a request to based on the task at hand.
- Content Planner Agent (Python, Google ADK, A2A Python SDK): Receives a high-level description of the content that's needed and creates a detailed content outline.
- Content Writer Agent (Java, Quarkus LangChain4j, A2A Java SDK): Generates an engaging piece of content using a content outline.
- Content Editor Agent (TypeScript, Genkit, A2A JS SDK): Proof-reads and polishes content.
Later in this sample, we'll swap out the Content Editor Agent for an equivalent agent written in Java that makes use of Quarkus LangChain4j and the A2A Java SDK. This demonstrates the flexibility that's made possible by the A2A protocol.
Before running the application locally, ensure you have the following installed:
- uv: The Python package management tool used in this project. Follow the installation guide: https://docs.astral.sh/uv/getting-started/installation/
- python 3.13 Python 3.13 is required to run a2a-sdk
cd samples/python/agents/content_plannerFollow the instructions in the content_planner README.md to start the Content Planner agent.
cd samples/java/agents/content_writerFollow the instructions in the content_writer README.md to start the Content Writer agent.
cd samples/js/src/agents/content-editorFollow the instructions in the content-editor README.md to start the Content Editor agent.
Open a new terminal and run the host agent server:
cd samples/python/hosts/content_creation
uv run .From your browser, navigate to http://0.0.0.0:8083.
Here are example questions:
- Create a LinkedPost about getting started with the Agent2Agent protocol
- Create a short, upbeat series of X posts about getting started with Java
We're going to swap out the Content Editor Agent written in TypeScript for an equivalent Content Editor Agent written in Java. This demonstrates how the A2A protocol enables language-agnostic interoperability.
cd samples/java/agents/content_editorFollow the instructions in the content_editor README.md to start the Content Writer agent.
cd samples/python/hosts/content_creation
uv run .Test using the UI
From your browser, navigate to http://0.0.0.0:8083.
Here are example questions:
- Create a LinkedIn post about getting started with the Agent2Agent protocol
- Create a short, upbeat series of X posts about getting started with Java
Important: The sample code provided is for demonstration purposes and illustrates the mechanics of the Agent-to-Agent (A2A) protocol. When building production applications, it is critical to treat any agent operating outside of your direct control as a potentially untrusted entity.
All data received from an external agent—including but not limited to its AgentCard, messages, artifacts, and task statuses—should be handled as untrusted input. For example, a malicious agent could provide an AgentCard containing crafted data in its fields (e.g., description, name, skills.description). If this data is used without sanitization to construct prompts for a Large Language Model (LLM), it could expose your application to prompt injection attacks. Failure to properly validate and sanitize this data before use can introduce security vulnerabilities into your application.
Developers are responsible for implementing appropriate security measures, such as input validation and secure handling of credentials to protect their systems and users.


