Simplified Google A2A Protocol Implementation for Azure OpenAI
Google_AzureOpenAI_A2A-Simplified is an early-stage Python project in the AI payments / x402 ecosystem, focused on a2a, agent-to-agent, azure-openai, google-ai. It currently has 6 GitHub stars and 1 forks, and sits alongside related tools like strands-a2a-demo, openclaw-a2a-bridge, beam-protocol.
This project demonstrates an implementation of the Google Agent-to-Agent (A2A) protocol using Azure OpenAI models GPT 4.1, GPT-4.5 and o3-Mini.
The Agent-to-Agent (A2A) protocol is a standardized communication protocol defined by Google that enables autonomous AI agents to communicate, coordinate, and collaborate effectively. This demo showcases how different AI models can interact in a structured way using this protocol, leveraging Azure OpenAI services for the underlying intelligence.
The implementation provides multiple demo modes to demonstrate different aspects of agent communication and collaboration:
flowchart TD
%% Core Components
Schemas["schemas/base.py<br/>A2A Protocol Schemas"] --> BaseAgent["agents/base_agent.py<br/>Base Agent Class"]
Schemas --> ConvMgr["utils/conversation.py<br/>Conversation Manager"]
BaseAgent --> ModelAgents["agents/model_agents.py<br/>GPT45, GPT41, O3Mini Agents"]
%% Azure Integration
OpenAIAPI["models/openai_model.py<br/>Azure OpenAI API"] --> ModelImpl["models/model_implementations.py<br/>Model-Specific Implementations"]
ModelImpl --> ModelAgents
%% Demo Application
ModelAgents --> Demo["google_a2a_azure_demo.py<br/>Main Demo Application"]
ConvMgr --> Demo
%% Demo Modes
Demo --> |Standard Mode| TwoAgents["Two-Agent Communication"]
Demo --> |Collaborative Mode| ThreeAgents["Multi-Agent Workflow"]
Demo --> |Interactive Mode| UserAgent["Human-Agent Interaction"]
%% Message Flow Highlights
Agent1(["Research Specialist"]) -- "create_message()" --> Msg[["A2A Protocol Message"]]
Msg -- "receive_message()" --> Agent2(["Information Navigator"])
Agent2 -- "generate_response()" --> Resp[["Response Message"]]
Resp -- "add_to_conversation()" --> Conv[("Managed Conversation")]
%% Styling with standard, high-contrast colors
classDef core fill:#d4f1f9,stroke:#0275d8,stroke-width:2px,color:#000000
classDef azure fill:#e8f4f8,stroke:#5bc0de,stroke-width:1px,color:#000000
classDef demo fill:#ffeeba,stroke:#f0ad4e,stroke-width:2px,color:#000000
classDef flow fill:#dff0d8,stroke:#5cb85c,stroke-width:1px,color:#000000
class Schemas,BaseAgent,ConvMgr core
class OpenAIAPI,ModelImpl azure
class Demo,TwoAgents,ThreeAgents,UserAgent demo
class Agent1,Msg,Agent2,Resp,Conv flow
🔄 A2A Protocol Implementation
☁️ Azure OpenAI Integration
🚀 Demonstration Capabilities
💻 Developer Experience
├── agents/ # Agent implementations
│ ├── base_agent.py # Base agent class implementing A2A protocol
│ └── model_agents.py # Model-specific agent implementations
├── models/ # Model wrappers
│ ├── openai_model.py # Base Azure OpenAI model wrapper
│ └── model_implementations.py # Specific model implementations
├── schemas/ # A2A protocol schemas
│ └── base.py # Core schema definitions
├── utils/ # Utility functions
│ └── conversation.py # Conversation management
├── google_a2a_azure_demo.py # Google A2A protocol demo with Azure OpenAI
├── server.py # Simple A2A protocol server implementation
├── requirements.txt # Project dependencies
└── .env # Environment variables (API keys)
pip install -r requirements.txt
.env file in the project root directory with your Azure OpenAI API keys:# Azure OpenAI GPT 4.5 Configuration
AZURE_OPENAI_ENDPOINT_GPT45="https://your-resource-name.openai.azure.com"
AZURE_OPENAI_KEY_GPT45="your-api-key-here"
AZURE_OPENAI_MODEL_GPT45="gpt-4.5-preview"
AZURE_OPENAI_DEPLOYMENT_GPT45="gpt-4.5-preview"
AZURE_OPENAI_API_VERSION="2025-03-01-preview"
# Azure OpenAI GPT-O3 Mini Configuration
AZURE_OPENAI_ENDPOINT_O3_MINI="https://your-resource-name.openai.azure.com"
AZURE_OPENAI_KEY_O3_MINI="your-api-key-here"
AZURE_OPENAI_MODEL_O3_MINI="gpt-o3-mini"
AZURE_OPENAI_DEPLOYMENT_O3_MINI="gpt-o3-mini"
# Azure OpenAI GPT-4.1 Configuration (optional for collaborative mode)
AZURE_OPENAI_ENDPOINT_GPT41="https://your-resource-name.openai.azure.com"
AZURE_OPENAI_KEY_GPT41="your-api-key-here"
AZURE_OPENAI_MODEL_GPT41="gpt-4.1-preview"
AZURE_OPENAI_DEPLOYMENT_GPT41="gpt-4.1-preview"
# Logging Configuration (optional)
LOG_LEVEL="INFO" # Options: DEBUG, INFO, WARNING, ERROR, CRITICAL
LOG_FORMAT="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
Note: You can obtain these values from the Azure Portal under your Azure OpenAI resource. Make sure you have deployed the appropriate models in your Azure OpenAI resource.
This is the primary demo showcasing the Google A2A protocol implementation with Azure OpenAI models. It supports three different modes:
# Standard mode - demonstrates basic agent communication
python google_a2a_azure_demo.py --mode standard
# Collaborative mode - demonstrates multi-agent collaboration
python google_a2a_azure_demo.py --mode collaborative
# Interactive mode - allows user interaction with agents
python google_a2a_azure_demo.py --mode interactive
Demonstrates the core A2A protocol concepts between two agents (Research Specialist and Information Navigator). The agents exchange messages with both text and structured data parts, showcasing how different content types can be combined in A2A messages.
Shows three specialized agents (Research Specialist, Planning Strategist, Implementation Expert) working together on a complex problem. This demonstrates how the A2A protocol enables multi-agent collaboration by providing a standardized way for agents with different capabilities to build on each other's work.
Places the user in the conversation loop with A2A-compatible agents. This demonstrates how humans can interact with A2A agents, including special commands for requesting deeper analysis or multi-modal responses.
This implementation specifically integrates with Azure OpenAI services to provide:
While both A2A and MCP are designed to standardize AI interactions, they serve different purposes and operate at different levels:
The Model Context Protocol (MCP) is an open protocol developed by Anthropic that standardizes how applications provide context to LLMs and connect them to different data sources and tools. Often described as a "USB-C port for AI applications," MCP enables seamless integration between LLM applications and external data sources or services.
MCP follows a client-server architecture where:
| Feature | 🤝 A2A Protocol | 🔌 MCP Protocol |
|---|---|---|
| Purpose | Agent collaboration and workflow orchestration | Standardized context provision to LLMs |
| Architecture | Multi-agent communication framework | Client-server data access pattern |
| Focus | Agent capabilities, tasks, and artifacts | Resources, tools, and prompt templates |
| Use Case | Complex multi-agent coordination | Single LLM context enhancement |
| Complexity | Higher (agent orchestration, tasks, skills) | Lower (standardized data interfaces) |
A complementary approach might integrate both protocols:
This implementation demonstrates how A2A can be used as a higher-level protocol for agent coordination, while MCP-like patterns could be implemented within each agent to standardize how they access external data and tools.
You can extend this demo by:
MIT
This project is intended for educational purposes only. It demonstrates a simplified and more practical implementation of the Google Agent-to-Agent protocol using the latest Azure OpenAI models. This implementation is not affiliated with or endorsed by Google, and it may deviate from the official protocol specification in certain aspects to prioritize practical demonstrations and ease of understanding. The code showcases how the protocol can be adapted and implemented in real-world scenarios with Azure OpenAI services.
While efforts have been made to adhere to the core principles of the A2A protocol, this project focuses on practical applications rather than complete specification compliance. Users interested in the official protocol should refer to the Google A2A Repository and documentation.
Demo with multiple AI agents using A2A (agent-to-agent) with the Strands Agents SDK.
A2A protocol bridge plugin for OpenClaw — agent card, JSON-RPC endpoint, and remote agent tools
SMTP for AI agents. The open communication protocol for agent-to-agent communication. 🌊