Costa Rica
Last updated: 2026-02-02
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!
List of References (Click to expand)
E.g Web App approach:
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.
- Multi-agent chat orchestration (default runtime): WebSocket
/wschat app orchestrates multiple agents in a single conversation flow (routing + multi-step handoffs) - 6-Agent Architecture (real Azure AI Foundry agents):
- Cora (Shopper): Front-facing assistant for general customer queries
- Interior Design Specialist: Design expertise and style recommendations
- Inventory Manager: Stock availability + product lookup coordination
- Customer Loyalty: Rewards and discount-related queries
- Cart Manager: Cart operations and checkout-oriented help
- Product Management Specialist: Handles product-centric workflows and coordinates lookups across services
- Intent routing + handoff planning: Classifies user intent and plans a multi-step sequence of agent calls (instead of a single “one agent answers everything” flow)
- Factual data integration (pipeline-first): Terraform runs pipelines that ingest the catalog into Azure Cosmos DB and build an Azure AI Search index; runtime lookups can be enabled/extended as needed
- Real persistent agents: Uses Azure AI Foundry Agents with saved runtime IDs (OpenAI-style
asst_*) provisioned during deployment - Zero-touch deployment:
terraform applyprovisions infra, ingests data, creates/updates agents, wires secrets/config, and deploys the Container Apps revision - UI-visible diagnostics: Correlated
error_idresponses and optional tracebacks viaA2A_DEBUG=truefor faster troubleshooting - Optional A2A server included:
src/a2a/contains an A2A-style server framework, but it is not the default Container Apps entrypoint unless you deploy it explicitly
A2A (Agent-to-Agent) Protocol is a standardized communication framework that enables multiple AI agents to collaborate and coordinate tasks seamlessly. Like a communication pattern for coordinating multiple agents through structured messages, delegation, and (optionally) event-driven workflows.
This repo contains two multi-agent implementations:
- Default deployed chat runtime (what the Dockerfile runs): WebSocket
/wsinsrc/chat_app_multi_agent.py, which routes requests and orchestrates real Azure AI Foundry Agents in a multi-step handoff sequence. - Optional A2A server implementation: an A2A-style server under
src/a2a/(routers, coordinator, event/task framework). Use this only if you deploy/run that entrypoint.
What is A2A Protocol?
- Agent-to-Agent Communication: structured messaging between multiple agents
- Task Coordination: agents can delegate tasks to specialized agents
- Event-Driven Architecture (optional): event handling for asynchronous workflows
- Agent Discovery (optional): enumerate/register available agents
- Protocol Standardization: consistent message formats and APIs
How this repo implements multi-agent collaboration (default deployment)
- WebSocket chat interface:
/wsendpoint served bysrc/chat_app_multi_agent.py - Intent routing: classifies the user request and selects the primary domain (
src/services/handoff_service.py) - Handoff planning: builds a multi-step sequence of which agents to call (
src/chat_app_multi_agent.py) - Remote agent execution: calls Azure AI Foundry Agents using the saved
asst_*IDs (src/app/agents/agent_processor.py) - Factual lookups (optional): Terraform creates/loads Cosmos DB and Azure AI Search data; the default chat runtime can be extended to query these sources during workflows
A2A components included in this repo (optional server)
- A2A server entrypoint:
src/a2a/main.py - A2A API routers:
src/a2a/api/ - Agent execution framework:
src/a2a/server/agent_execution.py - Event system:
src/a2a/server/events/ - Task coordination:
src/a2a/server/tasks.py - Request handlers:
src/a2a/server/request_handlers.py - Coordinator:
src/a2a/agent/coordinator.py - Agent implementations (examples):
src/app/agents/ - Product catalog helper/plugin (if used):
src/app/agents/product_information_plugin.py
Important
A2A vs the default deployed chat runtime
- A2A server path: event/task oriented framework under
src/a2a/(only available if you deploy/run that server) - Default path:
/wsWebSocket chat + routing + sequential handoffs to real Foundry agents (no event queue required for the default flow)
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:
-
Creates Resource Group, Cosmos DB, MSFT Foundry, AI Search, Storage Account, Key Vault, and Container Registry (ACR).
-
Deploys AI Models (
gpt-4o-mini,text-embedding-3-small). -
Sets up monitoring (Log Analytics + Application Insights). Optional A2A components (like an in-memory event queue) are part of the app codebase, not separate Azure resources.
E.g Web App approach:
-
-
A2A Framework Deployment:
- Includes an optional A2A-style server implementation under
src/a2a/(routers, coordinator, in-memory event queue, monitoring helpers). - Note: the default deployed runtime uses
src/chat_app_multi_agent.py(/ws). The A2A server endpoints are only available if you deploy/run thesrc/a2a/main.pyentrypoint.
- Includes an optional A2A-style server implementation under
-
Data Pipeline Execution:
-
Sets up a Python virtual environment.
-
Ingests
src/data/updated_product_catalog(in).csvinto Cosmos DB.E.g Web App approach:
Ingests.product_catalog.csv.into.Cosmos.DB.mp4
-
Creates and populates an Azure AI Search index with vector embeddings.
E.g Web App approach:
Creates.and.populates.an.Azure.AI.Search.index.with.vector.embeddings.mp4
-
-
Enhanced Agent Creation & A2A Registration:
-
Installs the Azure AI SDKs (
azure-ai-projects+azure-ai-agents) and authenticates via Entra ID. -
Connects to MSFT Foundry / Agents API for agent hosting.
-
Provisions 6 specialized agents with enhanced A2A-style routing:
- 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 runtime Agent IDs (OpenAI-style
asst_*), endpoints, and configuration to the.envfile.E.g
Web App approach
E.g
New Platform:
-
-
Application Deployment:
- Builds the Docker container with A2A protocol support in the cloud (ACR Build).
- Deploys the container to Azure Container Apps (default) with the generated Agent IDs, endpoints, and credentials.
- Updates the running revision so the app picks up the latest agent IDs and configuration.
After deployment completes, verify the system:
-
Check the App:
-
The Terraform output will provide the
chat_application_url. -
Visit
https://<your-app-name>.azurecontainerapps.io. -
You should see the Zava chat interface with multi-agent routing enabled.
E.g
Web App approachAlso.you.can.get.the.information.from.the.web.app.-.App.Service.mp4
-
-
Verify A2A Protocol Endpoints:
- These endpoints are only available if you deploy/run the A2A server entrypoint (
src/a2a/main.py). - A2A Chat API (HTTP):
https://<your-app-name>.azurecontainerapps.io/a2a/chat/message - A2A Chat API (WebSocket):
wss://<your-app-name>.azurecontainerapps.io/a2a/chat/ws - A2A Chat streaming:
https://<your-app-name>.azurecontainerapps.io/a2a/chat/stream - A2A Chat stats:
https://<your-app-name>.azurecontainerapps.io/a2a/chat/stats - Verify agent discovery:
https://<your-app-name>.azurecontainerapps.io/a2a/server/agents - OpenAPI docs (FastAPI default):
https://<your-app-name>.azurecontainerapps.io/docs
- These endpoints are only available if you deploy/run the A2A server entrypoint (
-
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
Web App approachAgents.and.LLMs.-.MSFT.Foundry.mp4
-
-
Test Multi-Agent Routing (UI):
Adjust as needed, this is just a base. For example:




