Skip to content

Commit a9bf114

Browse files
authored
Merge pull request #20 from MicrosoftCloudEssentials-LearningHub/md-improved
markdowns improved
2 parents d2c0cb4 + 51895d3 commit a9bf114

3 files changed

Lines changed: 91 additions & 63 deletions

File tree

README.md

Lines changed: 76 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Costa Rica
55
[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/)
66
[brown9804](https://github.com/brown9804)
77

8-
Last updated: 2026-01-29
8+
Last updated: 2026-02-02
99

1010
----------
1111

@@ -21,8 +21,10 @@ Last updated: 2026-01-29
2121

2222
> E.g
2323
24-
<img width="1905" height="1086" alt="image" src="https://github.com/user-attachments/assets/5cd2776f-4606-45c2-9482-53ff2d4df74e" />
25-
24+
<div align="center">
25+
<img width="950" alt="image" src="https://github.com/user-attachments/assets/886cca9f-9630-4d5f-aca1-b4d37a42fa2d" style="border: 2px solid #4CAF50; border-radius: 5px; padding: 5px;"/>
26+
</div>
27+
2628
> [!IMPORTANT]
2729
> The deployment process typically takes 15-20 minutes
2830
>
@@ -32,51 +34,63 @@ Last updated: 2026-01-29
3234
3335
## Key Features
3436

35-
- **Enhanced A2A Protocol**: Agent-to-Agent communication with delegation patterns, specialized agent coordination, and factual data integration
36-
- **6-Agent Architecture**: Specialized AI agents with proper delegation through A2A protocol:
37+
- **Multi-agent chat orchestration (default runtime)**: WebSocket `/ws` chat app orchestrates multiple agents in a single conversation flow (routing + multi-step handoffs)
38+
- **6-Agent Architecture (real Azure AI Foundry agents)**:
3739
- **Cora (Shopper)**: Front-facing assistant for general customer queries
38-
- **Interior Design Specialist**: Design expertise and style recommendations
39-
- **Inventory Manager**: Stock availability and product lookup coordination
40-
- **Customer Loyalty**: Rewards management and discount optimization
41-
- **Cart Manager**: Shopping cart operations and checkout coordination
42-
- **Product Management Specialist**: Coordinates with Marketing Agent, Ranker Agent, and Product Information Plugin for comprehensive product services
43-
- **Specialized Agent Delegation**: Product Manager delegates marketing tasks to Marketing Agent and ranking tasks to Ranker Agent as appropriate
44-
- **Factual Data Plugin**: Product Information Plugin provides accurate product catalog data from predefined sources
45-
- **Real MSFT Foundry Agents**: Integrates with **MSFT Foundry** to create and host persistent agents with proper delegation patterns
46-
- **Zero-Touch Deployment**: A single [terraform apply](./terraform-infrastructure/README.md) command handles the entire lifecycle including enhanced A2A framework deployment
47-
- **A2A Task Coordination**: Advanced inter-agent task delegation with specialized expertise routing
48-
- **Data Pipeline Automation**: Automatically ingests product catalogs with comprehensive A2A event coordination
40+
- **Interior Design Specialist**: Design expertise and style recommendations
41+
- **Inventory Manager**: Stock availability + product lookup coordination
42+
- **Customer Loyalty**: Rewards and discount-related queries
43+
- **Cart Manager**: Cart operations and checkout-oriented help
44+
- **Product Management Specialist**: Handles product-centric workflows and coordinates lookups across services
45+
- **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)
46+
- **Factual data integration**: Uses **Azure AI Search** (vector/keyword retrieval) and **Azure Cosmos DB** (catalog/state) during workflows
47+
- **Real persistent agents**: Uses Azure AI Foundry Agents with saved runtime IDs (OpenAI-style `asst_*`) provisioned during deployment
48+
- **Zero-touch deployment**: `terraform apply` provisions infra, ingests data, creates/updates agents, wires secrets/config, and deploys the Container Apps revision
49+
- **UI-visible diagnostics**: Correlated `error_id` responses and optional tracebacks via `A2A_DEBUG=true` for faster troubleshooting
50+
- **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
4951

5052
## About A2A Protocol
5153

52-
`A2A (Agent-to-Agent) Protocol is a standardized communication framework that enables multiple AI agents to collaborate and coordinate tasks seamlessly.`
54+
`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.
55+
56+
This repo contains **two multi-agent implementations**:
57+
58+
- **Default deployed chat runtime (what the Dockerfile runs)**: WebSocket `/ws` in `src/chat_app_multi_agent.py`, which routes requests and orchestrates **real Azure AI Foundry Agents** in a multi-step handoff sequence.
59+
- **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.
5360

5461
> What is A2A Protocol?
5562
56-
- **Agent-to-Agent Communication**: Structured messaging between multiple AI agents
57-
- **Task Coordination**: Agents can delegate tasks to specialized agents
58-
- **Event-Driven Architecture**: Real-time event handling for agent interactions
59-
- **Agent Discovery**: Automatic detection and registration of available agents
60-
- **Protocol Standardization**: Consistent API for inter-agent communication
63+
- **Agent-to-Agent Communication**: structured messaging between multiple agents
64+
- **Task Coordination**: agents can delegate tasks to specialized agents
65+
- **Event-Driven Architecture (optional)**: event handling for asynchronous workflows
66+
- **Agent Discovery (optional)**: enumerate/register available agents
67+
- **Protocol Standardization**: consistent message formats and APIs
6168

62-
> A2A Components in This Project:
69+
> How this repo implements multi-agent collaboration (default deployment)
6370
64-
- **Agent Execution Framework**: Manages multiple agent instances (`src/a2a/server/agent_execution.py`)
65-
- **Event System**: Handles inter-agent communication and delegation (`src/a2a/server/events/`)
66-
- **Task Coordination**: Advanced task delegation between specialized agents (`src/a2a/server/tasks.py`)
67-
- **Request Handlers**: Processes agent-to-agent requests with delegation routing (`src/a2a/server/request_handlers.py`)
68-
- **Coordinator Agent**: Orchestrates complex multi-agent workflows (`src/a2a/agent/coordinator.py`)
69-
- **Specialized Agents**: Marketing Agent, Ranker Agent with delegation patterns (`src/app/agents/`)
70-
- **Product Information Plugin**: Factual data source for product catalog (`src/app/agents/product_information_plugin.py`)
71-
- **API Endpoints**: RESTful and WebSocket APIs for enhanced agent communication (`src/a2a/api/`)
71+
- **WebSocket chat interface**: `/ws` endpoint served by `src/chat_app_multi_agent.py`
72+
- **Intent routing**: classifies the user request and selects the primary domain (`src/services/handoff_service.py`)
73+
- **Handoff planning**: builds a multi-step sequence of which agents to call (`src/chat_app_multi_agent.py`)
74+
- **Remote agent execution**: calls Azure AI Foundry Agents using the saved `asst_*` IDs (`src/app/agents/agent_processor.py`)
75+
- **Factual lookups**: uses Azure AI Search and Cosmos DB during workflows (called from the app runtime)
7276

73-
> A2A vs Traditional Multi-Agent Systems:
77+
> A2A components included in this repo (optional server)
7478
75-
- **Standardized Protocol**: Uses consistent message formats and APIs
76-
- **Scalable Architecture**: Easily add new agents without modifying existing ones
77-
- **Real-time Communication**: WebSocket support for instant agent interactions
78-
- **Event-Driven**: Asynchronous event handling for better performance
79-
- **Infrastructure Integration**: Full Terraform deployment with monitoring and automation
79+
- **A2A server entrypoint**: `src/a2a/main.py`
80+
- **A2A API routers**: `src/a2a/api/`
81+
- **Agent execution framework**: `src/a2a/server/agent_execution.py`
82+
- **Event system**: `src/a2a/server/events/`
83+
- **Task coordination**: `src/a2a/server/tasks.py`
84+
- **Request handlers**: `src/a2a/server/request_handlers.py`
85+
- **Coordinator**: `src/a2a/agent/coordinator.py`
86+
- **Agent implementations (examples)**: `src/app/agents/`
87+
- **Product catalog helper/plugin (if used)**: `src/app/agents/product_information_plugin.py`
88+
89+
> [!IMPORTANT]
90+
> A2A vs the default deployed chat runtime
91+
>
92+
> - **A2A server path**: event/task oriented framework under `src/a2a/` (only available if you deploy/run that server)
93+
> - **Default path**: `/ws` WebSocket chat + routing + sequential handoffs to real Foundry agents (no event queue required for the default flow)
8094
8195
## Architecture
8296

@@ -150,17 +164,17 @@ graph TD
150164
<https://github.com/user-attachments/assets/37c4a8cd-73e1-4392-8755-fb018481d8cb>
151165

152166
4. **Enhanced Agent Creation & A2A Registration**:
153-
- Installs the `azure-ai-projects` SDK and Microsoft Agent Framework.
154-
- Connects to MSFT Foundry for agent hosting.
155-
- Provisions 6 specialized agents with enhanced A2A protocol integration:
167+
- Installs the Azure AI SDKs (`azure-ai-projects` + `azure-ai-agents`) and authenticates via Entra ID.
168+
- Connects to MSFT Foundry / Agents API for agent hosting.
169+
- Provisions 6 specialized agents with enhanced A2A-style routing:
156170
- Core shopping agents (5) plus Product Management Specialist
157171
- Marketing Agent and Ranker Agent with delegation patterns
158172
- Product Information Plugin with predefined catalog data
159173
- Registers all agents with the enhanced A2A discovery service.
160174
- Configures delegation relationships between Product Manager and specialized agents.
161-
- Saves the unique Agent IDs, delegation endpoints, and A2A configuration to the `.env` file.
175+
- Saves the unique runtime Agent IDs (OpenAI-style `asst_*`), endpoints, and configuration to the `.env` file.
162176

163-
> E.g `Classic UI`
177+
> E.g `Web App approach`
164178
165179
<img width="1881" height="1000" alt="image" src="https://github.com/user-attachments/assets/59a9dcaf-9291-403c-b8b0-1195c1375aac" />
166180

@@ -170,26 +184,26 @@ graph TD
170184

171185
5. **Application Deployment**:
172186
- Builds the Docker container with A2A protocol support in the cloud (ACR Build).
173-
- Configures the Azure Web App with the generated Agent IDs, A2A endpoints, and credentials.
174-
- Deploys the container with A2A server components and restarts the app.
187+
- Deploys the container to Azure Container Apps (default) with the generated Agent IDs, endpoints, and credentials.
188+
- Updates the running revision so the app picks up the latest agent IDs and configuration.
175189

176190
## Verification
177191

178192
> After deployment completes, verify the system:
179193
180-
1. **Check the Web App**:
181-
- The Terraform output will provide the `application_url`.
182-
- Visit `https://<your-app-name>.azurewebsites.net`.
183-
- You should see the Zava chat interface with A2A protocol support.
194+
1. **Check the App**:
195+
- The Terraform output will provide the `chat_application_url`.
196+
- Visit `https://<your-app-name>.azurecontainerapps.io`.
197+
- You should see the Zava chat interface with multi-agent routing enabled.
184198

185-
> E.g `Classic UI`
199+
> E.g `Web App approach`
186200
187201
<https://github.com/user-attachments/assets/a1139528-6b37-4ac2-a1cb-771788ff45a4>
188202

189203
2. **Verify A2A Protocol Endpoints**:
190-
- Check A2A Chat API: `https://<your-app-name>.azurewebsites.net/a2a/chat`
191-
- Check A2A Server API: `https://<your-app-name>.azurewebsites.net/a2a/api/docs`
192-
- Verify agent discovery: `https://<your-app-name>.azurewebsites.net/a2a/server/agents`
204+
- Check A2A Chat API: `https://<your-app-name>.azurecontainerapps.io/a2a/chat`
205+
- Check A2A Server API: `https://<your-app-name>.azurecontainerapps.io/a2a/api/docs`
206+
- Verify agent discovery: `https://<your-app-name>.azurecontainerapps.io/a2a/server/agents`
193207

194208
3. **Verify Enhanced Agent Architecture**:
195209
- Go to the [MSFT Foundry Portal](https://ai.azure.com).
@@ -198,19 +212,19 @@ graph TD
198212
- Core agents: Cora, Interior Design, Inventory, Loyalty, Cart Manager
199213
- Product Management Specialist with delegation capabilities
200214

201-
> E.g `Classic UI`
215+
> E.g `Web App approach`
202216
203217
<https://github.com/user-attachments/assets/3c562ccd-cff3-4a30-b9f8-44111fb71113>
204218

205-
4. **Test Enhanced A2A Interactions**: `Adjust as needed, this is just a base`. For example:
206-
- **General**: "Hi, who are you?" (Handled by Cora via A2A protocol)
207-
- **Inventory**: "Do you have the classic leather sofa in stock?" (Routed through A2A to Inventory Agent)
208-
- **Design**: "What colors of green paint do you have?" (A2A task delegation to Design Agent)
209-
- **Product Recommendations**: "Recommend modern furniture for my living room" (Product Manager delegates to Marketing Agent)
210-
- **Product Comparisons**: "Compare sectional sofas" (Product Manager delegates to Ranker Agent)
211-
- **Product Details**: "What are the specifications of product SOFA-001?" (Product Manager uses Product Information Plugin)
212-
- **Multi-Agent**: "Find a sofa, check reviews, and verify my loyalty points" (Complex A2A coordination across multiple specialized agents)
213-
219+
4. **Test Multi-Agent Routing (UI)**: `Adjust as needed, this is just a base`. For example:
220+
- **General**: Hi, who are you?” (Routed to **Cora**)
221+
- **Inventory**: Do you have the classic leather sofa in stock? (Routed to **Inventory Manager**)
222+
- **Design**: What colors of green paint do you have?” (Routed to **Interior Design Specialist**)
223+
- **Product Recommendations**: Recommend modern furniture for my living room” (Routed to **Product Management Specialist**; may consult catalog/search depending on its prompt/tools)
224+
- **Product Comparisons**: Compare sectional sofas” (Routed to **Product Management Specialist**; comparison is handled within that agent)
225+
- **Product Details**: What are the specifications of product SOFA-001?” (Routed to **Product Management Specialist**; details are handled within that agent)
226+
- **Multi-Agent**: Find a sofa, then verify my loyalty points, and add it to my cart” (Coordinated across **Product Management → Customer Loyalty → Cart Manager** via the app’s multi-step routing)
227+
214228
<!-- START BADGE -->
215229
<div align="center">
216230
<img src="https://img.shields.io/badge/Total%20views-1416-limegreen" alt="Total views">

TROUBLESHOOTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,12 @@ $env:AZURE_LOG_LEVEL = "DEBUG"
308308
python pipelines/script.py
309309
```
310310

311+
**App (UI error details)**: Include traceback details in WebSocket error payloads.
312+
313+
```powershell
314+
$env:A2A_DEBUG = "true"
315+
```
316+
311317
**Terraform**:
312318

313319
```bash

terraform-infrastructure/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,20 @@ Costa Rica
55
[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/)
66
[brown9804](https://github.com/brown9804)
77

8-
Last updated: 2026-01-29
8+
Last updated: 2026-02-02
99

1010
----------
1111

1212
> This approach focuses on `setting up the required infrastructure via Terraform`. It allows for source control of not only the solution code, connections, and setups `but also the infrastructure itself`.
1313
14+
> When `Container App approach`:
15+
16+
<img width="1911" height="989" alt="image" src="https://github.com/user-attachments/assets/6aec05ba-f9ea-4c95-86a8-c8e41d54331d" />
17+
18+
<img width="1520" height="748" alt="image" src="https://github.com/user-attachments/assets/625710b8-c23f-4c0d-9ba2-32d3c8d807ed" />
19+
20+
> When `Web App approach`:
21+
1422
<div align="center">
1523
<img src="https://github.com/user-attachments/assets/77546e62-0cbe-4bb3-9581-1c2d8cfb4f70" alt="Centered Image" style="border: 2px solid #4CAF50; border-radius: 5px; padding: 5px;"/>
1624
</div>

0 commit comments

Comments
 (0)