Skip to content

Commit e615ad8

Browse files
authored
Merge pull request #21 from MicrosoftCloudEssentials-LearningHub/PoC-test
PoC test
2 parents 28a886f + 02f7e56 commit e615ad8

File tree

3 files changed

+28
-18
lines changed

3 files changed

+28
-18
lines changed

README.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Last updated: 2026-02-02
4343
- **Cart Manager**: Cart operations and checkout-oriented help
4444
- **Product Management Specialist**: Handles product-centric workflows and coordinates lookups across services
4545
- **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
46+
- **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
4747
- **Real persistent agents**: Uses Azure AI Foundry Agents with saved runtime IDs (OpenAI-style `asst_*`) provisioned during deployment
4848
- **Zero-touch deployment**: `terraform apply` provisions infra, ingests data, creates/updates agents, wires secrets/config, and deploys the Container Apps revision
4949
- **UI-visible diagnostics**: Correlated `error_id` responses and optional tracebacks via `A2A_DEBUG=true` for faster troubleshooting
@@ -72,7 +72,7 @@ This repo contains **two multi-agent implementations**:
7272
- **Intent routing**: classifies the user request and selects the primary domain (`src/services/handoff_service.py`)
7373
- **Handoff planning**: builds a multi-step sequence of which agents to call (`src/chat_app_multi_agent.py`)
7474
- **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)
75+
- **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
7676

7777
> A2A components included in this repo (optional server)
7878
@@ -137,27 +137,25 @@ graph TD
137137
1. **Infrastructure Provisioning**:
138138
- Creates Resource Group, Cosmos DB, MSFT Foundry, AI Search, Storage Account, Key Vault, and Container Registry (ACR).
139139
- Deploys AI Models (`gpt-4o-mini`, `text-embedding-3-small`).
140-
- Sets up A2A protocol infrastructure including event queues and monitoring.
140+
- 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.
141141

142142
> E.g Web App approach:
143143
144144
<img width="1859" height="900" alt="image" src="https://github.com/user-attachments/assets/cd24ab7f-5ddd-46de-b266-0d0a24c45803" />
145145

146146
2. **A2A Framework Deployment**:
147-
- Initializes the Agent-to-Agent protocol server components.
148-
- Sets up event queue system for inter-agent communication.
149-
- Configures agent discovery and registration services.
150-
- Deploys A2A monitoring and automation frameworks.
147+
- Includes an optional A2A-style server implementation under `src/a2a/` (routers, coordinator, in-memory event queue, monitoring helpers).
148+
- Note: the default deployed runtime uses `src/chat_app_multi_agent.py` (`/ws`). The A2A server endpoints are only available if you deploy/run the `src/a2a/main.py` entrypoint.
151149

152150
3. **Data Pipeline Execution**:
153151
- Sets up a Python virtual environment.
154-
- Ingests `product_catalog.csv` into Cosmos DB with A2A event notifications.
152+
- Ingests `src/data/updated_product_catalog(in).csv` into Cosmos DB.
155153

156154
> E.g Web App approach:
157155
158156
<https://github.com/user-attachments/assets/41bf0976-0ca8-47fe-a2fa-8750bcc6f848>
159157

160-
- Creates and populates an Azure AI Search index with vector embeddings through A2A coordination.
158+
- Creates and populates an Azure AI Search index with vector embeddings.
161159

162160
> E.g Web App approach:
163161
@@ -201,9 +199,13 @@ graph TD
201199
<https://github.com/user-attachments/assets/a1139528-6b37-4ac2-a1cb-771788ff45a4>
202200

203201
2. **Verify A2A Protocol Endpoints**:
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`
202+
- These endpoints are **only available if you deploy/run the A2A server entrypoint** (`src/a2a/main.py`).
203+
- A2A Chat API (HTTP): `https://<your-app-name>.azurecontainerapps.io/a2a/chat/message`
204+
- A2A Chat API (WebSocket): `wss://<your-app-name>.azurecontainerapps.io/a2a/chat/ws`
205+
- A2A Chat streaming: `https://<your-app-name>.azurecontainerapps.io/a2a/chat/stream`
206+
- A2A Chat stats: `https://<your-app-name>.azurecontainerapps.io/a2a/chat/stats`
206207
- Verify agent discovery: `https://<your-app-name>.azurecontainerapps.io/a2a/server/agents`
208+
- OpenAPI docs (FastAPI default): `https://<your-app-name>.azurecontainerapps.io/docs`
207209

208210
3. **Verify Enhanced Agent Architecture**:
209211
- Go to the [MSFT Foundry Portal](https://ai.azure.com).
@@ -221,12 +223,9 @@ graph TD
221223
| Prompt | E.g Output |
222224
| --- | --- |
223225
| **General**: <br/> “Hi, who are you?” <br/> (Routed to **Cora**) | <img width="1142" height="950" alt="image" src="https://github.com/user-attachments/assets/72a60b47-dbd6-48b8-bff6-48ebd92fff48" /> |
224-
| **Inventory**: <br/> “Do you have the classic leather sofa in stock?” <br/> (Routed to **Inventory Manager**) | |
225-
| **Design**: <br/> “What colors of green paint do you have?” <br/> (Routed to **Interior Design Specialist**) | |
226-
| **Product Recommendations**: <br/> “Recommend modern furniture for my living room” <br/> (Routed to **Product Management Specialist**; may consult catalog/search depending on its prompt/tools) | |
227-
| **Product Comparisons**: <br/> “Compare sectional sofas” <br/> (Routed to **Product Management Specialist**; comparison is handled within that agent) | |
228-
| **Product Details**: <br/> “What are the specifications of product SOFA-001?” <br/> (Routed to **Product Management Specialist**; details are handled within that agent) | |
229-
| **Multi-Agent**: <br/> “Find a sofa, then verify my loyalty points, and add it to my cart” <br/> (Coordinated across **Product Management → Customer Loyalty → Cart Manager** via the app’s multi-step routing) | |
226+
| **Design**: <br/> “Recommend modern furniture for my living room” <br/> (Routed to **Interior Design Specialist**) | <img width="1167" height="963" alt="image" src="https://github.com/user-attachments/assets/5e602f08-06ca-4866-9892-ade211a3a413" /> |
227+
| **Product Comparisons**: <br/> “Compare sectional sofas” <br/> (Routed to **Product Management Specialist**; comparison is handled within that agent) | <img width="1208" height="836" alt="image" src="https://github.com/user-attachments/assets/0649f459-e8d5-4916-a442-4cbec9b85fa6" /> |
228+
| **Loyalty Details**: <br/> “Give me a summary of my loyalty account benefits” <br/> (Routed to **Customer Loyalty**) | <img width="1211" height="955" alt="image" src="https://github.com/user-attachments/assets/45dec561-4f9a-433e-a264-09af2bff4453" /> |
230229
231230
<!-- START BADGE -->
232231
<div align="center">

src/a2a/status_automation.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if () {
1111

1212
# Check automation endpoint
1313
try {
14-
= Invoke-RestMethod -Uri "https://zava-8e5461ee-app.azurewebsites.net/a2a/automation/status" -TimeoutSec 5
14+
= Invoke-RestMethod -Uri "https://zava-6a7d57fb-app.azurewebsites.net/a2a/automation/status" -TimeoutSec 5
1515
Write-Host "Automation Status: "
1616
} catch {
1717
Write-Host "Automation endpoint not accessible"

terraform-infrastructure/main.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,17 @@ resource "azurerm_search_service" "search" {
283283
identity { type = "SystemAssigned" }
284284
}
285285

286+
# Grant the current Terraform principal access to Search *data-plane* operations
287+
# (view/create indexes, query documents). Without this, the Azure Portal may not
288+
# show indexes even if they exist.
289+
resource "azurerm_role_assignment" "search_index_data_contributor_user" {
290+
scope = azurerm_search_service.search.id
291+
role_definition_name = "Search Index Data Contributor"
292+
principal_id = local.principal_id
293+
294+
depends_on = [azurerm_search_service.search]
295+
}
296+
286297
resource "azurerm_log_analytics_workspace" "law" {
287298
name = local.log_analytics_name
288299
location = var.location

0 commit comments

Comments
 (0)