Costa Rica
Last updated: 2025-12-04
Important
Disclaimer: This repository contains a demo of Zava AI Shopping Assistant, a multi-agent system implementing Agent-to-Agent (A2A) protocol for e-commerce. It features a fully automated "Zero-Touch" deployment pipeline orchestrated by Terraform, which provisions infrastructure, ingests data, creates specialized AI agents with delegation patterns in MSFT Foundry, and deploys the complete A2A application stack. Feel free to modify this as needed, it's just a reference. Please refer TechWorkshop L300: AI Apps and Agents, and if needed contact Microsoft directly: Microsoft Sales and Support for more guidance. There are tons of free resources out there, all eager to support!
E.g
Important
The deployment process typically takes 15-20 minutes
- Adjust terraform.tfvars values
- Initialize terraform with
terraform init. Click here to understand more about the deployment process - Run
terraform apply, you can also leverageterraform apply -auto-approve.
- Enhanced A2A Protocol: Agent-to-Agent communication with delegation patterns, specialized agent coordination, and factual data integration
- 6-Agent Architecture: Specialized AI agents with proper delegation through A2A protocol:
- Cora (Shopper): Front-facing assistant for general customer queries
- Interior Design Specialist: Design expertise and style recommendations
- Inventory Manager: Stock availability and product lookup coordination
- Customer Loyalty: Rewards management and discount optimization
- Cart Manager: Shopping cart operations and checkout coordination
- Product Management Specialist: Coordinates with Marketing Agent, Ranker Agent, and Product Information Plugin for comprehensive product services
- Specialized Agent Delegation: Product Manager delegates marketing tasks to Marketing Agent and ranking tasks to Ranker Agent as appropriate
- Factual Data Plugin: Product Information Plugin provides accurate product catalog data from predefined sources
- Real MSFT Foundry Agents: Integrates with MSFT Foundry to create and host persistent agents with proper delegation patterns
- Zero-Touch Deployment: A single terraform apply command handles the entire lifecycle including enhanced A2A framework deployment
- A2A Task Coordination: Advanced inter-agent task delegation with specialized expertise routing
- Data Pipeline Automation: Automatically ingests product catalogs with comprehensive A2A event coordination
A2A (Agent-to-Agent) Protocol is a standardized communication framework that enables multiple AI agents to collaborate and coordinate tasks seamlessly.
What is A2A Protocol?
- Agent-to-Agent Communication: Structured messaging between multiple AI agents
- Task Coordination: Agents can delegate tasks to specialized agents
- Event-Driven Architecture: Real-time event handling for agent interactions
- Agent Discovery: Automatic detection and registration of available agents
- Protocol Standardization: Consistent API for inter-agent communication
A2A Components in This Project:
- Agent Execution Framework: Manages multiple agent instances (
src/a2a/server/agent_execution.py) - Event System: Handles inter-agent communication and delegation (
src/a2a/server/events/) - Task Coordination: Advanced task delegation between specialized agents (
src/a2a/server/tasks.py) - Request Handlers: Processes agent-to-agent requests with delegation routing (
src/a2a/server/request_handlers.py) - Coordinator Agent: Orchestrates complex multi-agent workflows (
src/a2a/agent/coordinator.py) - Specialized Agents: Marketing Agent, Ranker Agent with delegation patterns (
src/app/agents/) - Product Information Plugin: Factual data source for product catalog (
src/app/agents/product_information_plugin.py) - API Endpoints: RESTful and WebSocket APIs for enhanced agent communication (
src/a2a/api/)
A2A vs Traditional Multi-Agent Systems:
- Standardized Protocol: Uses consistent message formats and APIs
- Scalable Architecture: Easily add new agents without modifying existing ones
- Real-time Communication: WebSocket support for instant agent interactions
- Event-Driven: Asynchronous event handling for better performance
- Infrastructure Integration: Full Terraform deployment with monitoring and automation
graph TD
User[User] <--> UI[Chat Interface]
UI <--> App[FastAPI Application]
App <--> A2A[A2A Protocol Server]
A2A <--> EventQueue[Event Queue]
A2A <--> Coordinator[A2A Coordinator]
Coordinator -->|A2A Protocol| Router{Agent Router}
Router -->|Task Delegation| Cora[Cora Agent]
Router -->|Design Tasks| Design[Interior Design Agent]
Router -->|Inventory Events| Inventory[Inventory Agent]
Router -->|Loyalty Tasks| Loyalty[Loyalty Agent]
Router -->|Cart Events| Cart[Cart Agent]
Router -->|Product Tasks| ProductMgr[Product Manager]
ProductMgr -->|Marketing Tasks| Marketing[Marketing Agent]
ProductMgr -->|Ranking Tasks| Ranker[Ranker Agent]
ProductMgr -->|Factual Data| Plugin[Product Info Plugin]
subgraph "A2A Communication"
EventQueue <--> Cora
EventQueue <--> Design
EventQueue <--> Inventory
EventQueue <--> Loyalty
EventQueue <--> Cart
EventQueue <--> ProductMgr
EventQueue <--> Marketing
EventQueue <--> Ranker
end
Inventory -->|Query| Search[Azure AI Search]
Inventory -->|Lookup| Cosmos[Cosmos DB]
Plugin -->|Catalog| PredefinedData[Product Catalog Data]
When you run
terraform apply, the following automated sequence occurs:
-
Infrastructure Provisioning:
-
A2A Framework Deployment:
- Initializes the Agent-to-Agent protocol server components.
- Sets up event queue system for inter-agent communication.
- Configures agent discovery and registration services.
- Deploys A2A monitoring and automation frameworks.
-
Data Pipeline Execution:
-
Sets up a Python virtual environment.
-
Ingests
product_catalog.csvinto Cosmos DB with A2A event notifications.E.g
Ingests.product_catalog.csv.into.Cosmos.DB.mp4
-
Creates and populates an Azure AI Search index with vector embeddings through A2A coordination.
E.g
Creates.and.populates.an.Azure.AI.Search.index.with.vector.embeddings.mp4
-
-
Enhanced Agent Creation & A2A Registration:
-
Installs the
azure-ai-projectsSDK and Microsoft Agent Framework. -
Connects to MSFT Foundry for agent hosting.
-
Provisions 6 specialized agents with enhanced A2A protocol integration:
- Core shopping agents (5) plus Product Management Specialist
- Marketing Agent and Ranker Agent with delegation patterns
- Product Information Plugin with predefined catalog data
-
Registers all agents with the enhanced A2A discovery service.
-
Configures delegation relationships between Product Manager and specialized agents.
-
Saves the unique Agent IDs, delegation endpoints, and A2A configuration to the
.envfile.E.g
-
-
Application Deployment:
- Builds the Docker container with A2A protocol support in the cloud (ACR Build).
- Configures the Azure Web App with the generated Agent IDs, A2A endpoints, and credentials.
- Deploys the container with A2A server components and restarts the app.
After deployment completes, verify the system:
-
Check the Web App:
-
The Terraform output will provide the
application_url. -
Visit
https://<your-app-name>.azurewebsites.net. -
You should see the Zava chat interface with A2A protocol support.
E.g
Also.you.can.get.the.information.from.the.web.app.-.App.Service.mp4
-
-
Verify A2A Protocol Endpoints:
- Check A2A Chat API:
https://<your-app-name>.azurewebsites.net/a2a/chat - Check A2A Server API:
https://<your-app-name>.azurewebsites.net/a2a/api/docs - Verify agent discovery:
https://<your-app-name>.azurewebsites.net/a2a/server/agents
- Check A2A Chat API:
-
Verify Enhanced Agent Architecture:
-
Go to the MSFT Foundry Portal.
-
Navigate to your project -> Build -> Agents.
-
You should see all 6 agents listed with enhanced A2A protocol integration:
- Core agents: Cora, Interior Design, Inventory, Loyalty, Cart Manager
- Product Management Specialist with delegation capabilities
E.g
Agents.and.LLMs.-.MSFT.Foundry.mp4
-
-
Test Enhanced A2A Interactions: For example:
- General: "Hi, who are you?" (Handled by Cora via A2A protocol)
- Inventory: "Do you have the classic leather sofa in stock?" (Routed through A2A to Inventory Agent)
- Design: "What colors of green paint do you have?" (A2A task delegation to Design Agent)
- Product Recommendations: "Recommend modern furniture for my living room" (Product Manager delegates to Marketing Agent)
- Product Comparisons: "Compare sectional sofas" (Product Manager delegates to Ranker Agent)
- Product Details: "What are the specifications of product SOFA-001?" (Product Manager uses Product Information Plugin)
- Multi-Agent: "Find a sofa, check reviews, and verify my loyalty points" (Complex A2A coordination across multiple specialized agents)
