Skip to content

Commit 7a51067

Browse files
committed
August 21 Bug Fixes and Updates
1 parent 85ae504 commit 7a51067

35 files changed

+2672
-2426
lines changed

.devcontainer/devcontainer.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
"ghcr.io/devcontainers/features/node:1": {
1010
"version": "22.14"
1111
},
12-
"ghcr.io/devcontainers/features/azure-cli:1": {
13-
"installBicep": "true",
14-
"extensions": "rdbms-connect"
12+
"ghcr.io/devcontainers/features/azure-cli:1": {
13+
"installBicep": "true"
1514
},
1615
"ghcr.io/azure/azure-dev/azd:latest": {},
1716
"ghcr.io/rchaganti/vsc-devcontainer-features/azurebicep:1": {},
@@ -78,6 +77,5 @@
7877
]
7978
}
8079
},
81-
"postCreateCommand": "bash ./.devcontainer/entrypoint.sh",
82-
"postStopCommand": "docker stop arize-phoenix || true"
80+
"postCreateCommand": "bash ./.devcontainer/entrypoint.sh"
8381
}

.devcontainer/docker-compose.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,7 @@ services:
1111
networks:
1212
- agentic-net
1313

14-
arize-phoenix:
15-
container_name: arize-phoenix
16-
profiles: ["tracing"]
17-
build:
18-
context: ../arize-phoenix
19-
dockerfile: Dockerfile
20-
ports:
21-
- "6006:6006"
22-
- "4317:4317"
23-
volumes:
24-
- phoenix_data:/root/.phoenix/
25-
networks:
26-
- agentic-net
27-
2814
networks:
2915
agentic-net:
3016
name: agentic-net
3117
driver: bridge
32-
33-
volumes:
34-
phoenix_data:
35-
name: phoenix_data

.vscode/scripts/start-arize.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

.vscode/tasks.json

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,26 @@
22
"version": "2.0.0",
33
"tasks": [
44
{
5-
"label": "start-arize",
6-
"type": "shell",
7-
"command": "bash",
8-
"args": [
9-
".vscode/scripts/start-arize.sh"
5+
"label": "start-arize",
6+
"type": "shell",
7+
"command": "${workspaceFolder}/backend/.venv/bin/python",
8+
"args": ["-m", "phoenix.server.main", "serve"],
9+
"isBackground": true,
10+
"problemMatcher": {
11+
"pattern": [
12+
{
13+
"regexp": ".*",
14+
"file": 0,
15+
"message": 0,
16+
"line": 0
17+
}
1018
],
11-
"problemMatcher": []
19+
"background": {
20+
"activeOnStart": true,
21+
"beginsPattern": ".",
22+
"endsPattern": "."
23+
}
24+
}
1225
}
1326
]
1427
}

README.md

Lines changed: 69 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Explore how intelligent agents handle search, sentiment, memory, and personaliza
1414
- [Tool-Enabled Query Routing](#-smart-query-routing-via-tool-enabled-agent)
1515
- [Understanding What Queries Work](#-understanding-what-queries-work-and-why)
1616

17-
1817
## App Scenario: Personalized E-Commerce with GenAI Agents
1918

2019
**AgenticShop** is a GenAI-powered e-commerce demo that showcases how multi-agent systems and in-database intelligence can deliver personalized shopping experiences.
@@ -71,6 +70,7 @@ The following image shows the high-level architecture of the solution, highlight
7170
### 🏗️ Infrastructure Summary
7271

7372
The solution is deployed entirely within a single **Azure Resource Group** and uses the following core infrastructure:
73+
7474
- **Azure Container Apps Environment**
7575
- **Azure OpenAI**
7676
- **Azure Flexible PostgreSQL Server**
@@ -80,83 +80,101 @@ The solution is deployed entirely within a single **Azure Resource Group** and u
8080
## 🚀 Solution Accelerator Deployment
8181

8282
### 🧰 Prerequisites
83+
8384
The following are prerequisites for deploying this solution:
84-
1. [Azure Developer CLI](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/install-azd?tabs=winget-windows%2Cbrew-mac%2Cscript-linux&pivots=os-linux)
85-
2. [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli)
86-
3. [Azure CLI extension](https://learn.microsoft.com/en-us/cli/azure/azure-cli-extensions-overview) `rdbms-connect`
87-
4. An Azure account with an active subscription.
88-
5. [Powershell Core](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.5)
89-
6. Appropriate roles attached to user for solution deployment (`Contributor` role and `Role Based Admin Control Administrator` role for the subscription)
90-
7. [Git](https://git-scm.com/)
85+
86+
1. [Azure Developer CLI](https://learn.microsoft.com/azure/developer/azure-developer-cli/install-azd?tabs=winget-windows%2Cbrew-mac%2Cscript-linux&pivots=os-linux)
87+
2. [Azure CLI](https://learn.microsoft.com/cli/azure/install-azure-cli)
88+
3. An Azure account with an active subscription.
89+
4. [Powershell Core](https://learn.microsoft.com/powershell/scripting/install/installing-powershell?view=powershell-7.5)
90+
5. Appropriate roles attached to user for solution deployment (`Contributor` role and `Role Based Admin Control Administrator` role for the subscription)
91+
6. [Git](https://git-scm.com/)
9192

9293
### 🛠️ Deployment Steps
9394

9495
#### Clone the Repository
96+
9597
Clone the repository. Once done, navigate to the repository:
98+
9699
```sh
97100
git clone https://github.com/Azure-Samples/postgres-agentic-shop.git
98101
cd postgres-agentic-shop
99102
```
100103

101104
#### Log in to your Azure account
105+
102106
To log in to Azure CLI, use the following command. You can use the `--use-device-code` flag if the command fails.
107+
103108
```sh
104109
az login
105110
```
111+
106112
To log in to Azure Developer CLI, use this command. You can use the `--use-device-code` flag if the command fails.
113+
107114
```sh
108115
azd auth login
109116
```
110117

111118
#### Create a new Azure Developer environment
119+
112120
In the root of the project, execute the following command to create a new `azd` environment. Provide a name for your `azd` environment:
121+
113122
```sh
114123
azd env new
115124
```
116125

117-
#### Grant permissions to azd hook scripts
118-
If you are deploying the solution from **Windows**, run the following command to grant permissions to the current session to execute `pwsh` scripts located in the `azd-hooks` directory:
119-
```sh
126+
#### **Windows Users Only – Grant permissions to azd hook scripts**
127+
128+
> **⚠️ IMPORTANT:** This step is **only** required if you are deploying from **Windows**.
129+
> **Mac** and **Linux** users can skip this — nothing needs to be done.
130+
131+
If you are on **Windows**, run the following command in your current terminal session to allow execution of `pwsh` scripts located in the `azd-hooks` directory:
132+
133+
```powershell
120134
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
121-
```
122135
123-
If you are deploying the solution from **Unix-like environment on Windows OS** (for instance Cygwin, MinGW), grant the following permissions for execution of scripts in the `azd-hooks` directory:
124-
```sh
125-
pwsh -NoProfile -Command "Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass"
126136
```
127137

128138
#### Solution Deployment
129-
**NOTE** that this solution uses postgres authentication for creating connection to database. It is recommended to change the `ADMINISTRATOR_LOGIN_USER` and `ADMINISTRATOR_LOGIN_PASSWORD` parameters in `main.parameters.json` file in `infra` directory before deployment as best security practice.
130139

131-
1. Run the following command to provision the resources.
132-
```sh
133-
azd up
134-
```
135-
Once the above command is executed, the `azd` workflow prompts user to select the subscription for deployment, two locations (one for the solution accelerator resources and another for Azure OpenAI models), and the resource group to create.
140+
> **NOTE:** This solution uses PostgreSQL username/password authentication. During deployment, the admin login and password are **autogenerated** and written to your project’s `.env` file.
141+
> Keep your `.env` file out of version control.
142+
143+
1. Run the following command to provision the resources:
144+
145+
```sh
146+
azd up
147+
```
148+
149+
Once the above command is executed, the `azd` workflow prompts user to select the subscription for deployment, location and the resource group to create.
136150

137151
2. Make sure that you have enough Azure OpenAI model quota in the region of deployment. **The `azd` workflow automatically filters and shows the region where the Azure OpenAI quota is available.** The Azure OpenAI quota required for `GlobalStandard` **deployment type** for this solution is listed below. This configuration can be changed from the `main.parameters.json` file in the `infra` directory using the following parameters:
152+
138153
- **`GlobalStandard` GPT-4o:** 50K TPM - `AZURE_OPENAI_CHAT_DEPLOYMENT_CAPACITY`
139154
- **`GlobalStandard` text-embedding-3-small:** 70K TPM - `AZURE_OPENAI_EMBED_DEPLOYMENT_CAPACITY`
140-
If you have changed the above parameters from the `main.parameters.json` file, you **must change** the following configuration in `main.bicep` file so that the changes are reflected in automatic Azure OpenAI region filtering as well:
141-
```sh
142-
@metadata({
143-
azd: {
144-
type: 'location'
145-
usageName : [
146-
'OpenAI.GlobalStandard.gpt-4o, 50'
147-
'OpenAI.GlobalStandard.text-embedding-3-small, 70'
148-
]
149-
}
150-
})
151-
param openAILocation string
152-
```
155+
156+
If you have changed the above parameters from the `main.parameters.json` file, you **must change** the following configuration in `main.bicep` file so that the changes are reflected in automatic Azure OpenAI region filtering as well:
157+
158+
```sh
159+
@metadata({
160+
azd: {
161+
type: 'location'
162+
usageName : [
163+
'OpenAI.GlobalStandard.gpt-4o, 50'
164+
'OpenAI.GlobalStandard.text-embedding-3-small, 70'
165+
]
166+
}
167+
})
168+
169+
```
153170

154171
3. Before the `azd` workflow proceeds, checks are performed in the selected infra region and recommendations are generated on failure for following cases to ensure that the deployment is successful.
155-
- Azure Flexible Server for PostgreSQL SKU
172+
- Azure Flexible Server for PostgreSQL SKU [we recommend avoiding burstable instances as they might result in "Illegal Instruction" error in certain regions for vector queries]
156173
- Azure Container Apps quota
157174
- azd env name
158175

159-
4. After creating the resource group, the workflow prompts the user for the Azure Container Apps deployment. Input `yes` as shown below. The deployment might take some time and will provide progress updates in the terminal as well as on the Azure Portal.
176+
4. After creating the resource group, the workflow prompts the user for the Azure Container Apps deployment. Input `yes` as shown below -- this will build the docker images and deploy to Azure Container Apps. The docker image build can take 15+ mins.
177+
160178
```sh
161179
Do you want to deploy Azure Container Apps? (y/n): yes
162180
```
@@ -168,23 +186,27 @@ Once the deployment is complete, `azd` will output the **application URLs** for
168186
> **Note:** Make sure to **copy the frontend URL** displayed in the output and open it in your browser to access the application.
169187

170188
### 🧹 Tear Down
189+
171190
To destroy all the resources that have been created in the steps above, as well as remove any accounts deployed by the solution accelerator, use the following command:
191+
172192
```sh
173193
azd down --purge
174194
```
195+
175196
The `--purge` flag deletes all the accounts permanently.
176197

177198
### 🛟 Troubleshooting
178-
1. The troubleshooting guide for `azd cli` is [here](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/troubleshoot?tabs=Browser).
179-
2. A validation error occurs when unsupported characters, such as `_`, `#` etc. are used while initializing or creating a new environment or resources. Refer to [rules and restrictions](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules) for naming conventions.
199+
200+
1. The [troubleshooting guide](https://learn.microsoft.com/azure/developer/azure-developer-cli/troubleshoot?tabs=Browser) for `azd cli`.
201+
2. A validation error occurs when unsupported characters, such as `_`, `#` etc. are used while initializing or creating a new environment or resources. Refer to [rules and restrictions](https://learn.microsoft.com/azure/azure-resource-manager/management/resource-name-rules) for naming conventions.
180202
3. A scope error occurs when the user does not have appropriate permissions when deploying resources through `azd` workflow. Attach `Contributor` role and `Role Based Access Control Administrator` role to user permissions before deploying the solution accelerator.
181203
4. When `The resource entity provisioning state is not terminal. Please wait for the provisioning state to become terminal and then retry the request` error occurs, restart the deployment using the `azd up` command.
182204

183205
### 📝 Additional Notes
184206

185207
- Ensure all services are running and accessible at their respective ports.
186208
- If you encounter issues, check the logs for each service and verify your environment variables.
187-
- For troubleshooting Azure deployments, refer to the [Azure Developer CLI troubleshooting guide](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/troubleshoot).
209+
- For troubleshooting Azure deployments, refer to the [Azure Developer CLI troubleshooting guide](https://learn.microsoft.com/azure/developer/azure-developer-cli/troubleshoot).
188210
- Make sure Docker has sufficient resources allocated for smooth operation.
189211

190212
## 🤖 Multi-Agent Personalization Workflow
@@ -205,8 +227,9 @@ These agents are orchestrated via LlamaIndex’s `Workflow` module, providing tr
205227
### 🧬 Personalization & Memory
206228

207229
The system uses **mem0** to persist user preferences across sessions. This memory influences agent behavior in real time:
230+
208231
- Past interactions are retrieved at workflow start
209-
- New preferences (e.g., “I care about portability”) are stored dynamically
232+
- New preferences (e.g., “I want always see critical reviews about durability”) are stored dynamically
210233
- All memory is stored in the `mem0_chatstore` table in PostgreSQL
211234

212235
> Agent prompts can be modified in [`backend/src/agents/prompts.py`](backend/src/agents/prompts.py) to customize tone, structure, or output logic.
@@ -240,39 +263,31 @@ Experience how AgenticShop delivers tailored product suggestions through multi-a
240263

241264
![product-details](./assets/images/product-details.png)
242265

243-
244266
- On the top right is the **Agentic Flow** drawer which provides an under-the-hood look at the multi-agent flow. Open the **Agentic Flow** panel to inspect how each agent participates in this multi-agent flow. Note that all agents are not always triggered. For example, in this case the review agent is not triggered.
245267

246268
![personalization](./assets/images/personalization.png)
247269

248-
249270
- Now lets try a command to update our personalization. In the command bar input new preferences (e.g., "Show critical reviews about durability").
250271

251272
![reviews_summary_query](./assets/images/reviews_summary_query.png)
252273

253-
254274
- This will re-trigger the personalization workflow and update the product page with this new information.
255275

256276
![updated_personalization](./assets/images/updated_personalization.png)
257277

258-
259278
- Open the **Agentic Flow** panel to see confirm that the **Review Agent** has now been triggered.
260279

261280
![personalization_agents](./assets/images/personalization_agents.png)
262281

263-
264-
- To see persistent personalization in action, try entering a preference like:
265282
**"Always show me critical reviews about durability."**
266283
In case the memory is updated a "Memory updated" message is shown. This new information be stored in memory using **mem0**.
267284

268285
![memory-updated](./assets/images/memory-updated.png)
269286

270-
271287
- Now, open a different product whose personalization hasn’t been generated yet. You should see a new section highlighting **critical reviews about durability** as part of the personalized output.
272288

273289
![updated_preferences](./assets/images/updated_preferences.png)
274290

275-
276291
> ⚠️ Note: Personalizations are cached for performance. If a product’s personalization was generated *before* the new memory was saved, it may not reflect the updated preference. Personalization workflow typically takes **~10 seconds** to complete.
277292

278293
This walkthrough showcases how AgenticShop delivers a responsive, transparent, and memory-driven shopping experience.
@@ -303,7 +318,6 @@ This agent is equipped with **three tools**, each designed to handle a distinct
303318
Query (on a product detail page): `"Always show if red color is available in stock"`
304319
→ The agent invokes the `query_about_product` tool, launching the multi-agent personalization workflow.
305320

306-
307321
### 🛰️ Inspect Tool Execution
308322

309323
- Open the **Agentic Flow** panel to see how the system:
@@ -314,7 +328,6 @@ This agent is equipped with **three tools**, each designed to handle a distinct
314328

315329
![command-routing-agent](./assets/images/command-routing-agent.png)
316330

317-
318331
> ⚠️ If a sentiment-based query fails to map to a known feature or lacks reviews, the system gracefully falls back to a general vector search and displays a notice.
319332

320333
## 🔍 Understanding What Queries Work (and Why)
@@ -412,7 +425,8 @@ If no reviews discuss a feature for a product, it won’t affect the ranking—e
412425
Use the examples below to test how different tools behave:
413426

414427
### 🧍 Product-Specific Query Handling
415-
_(Used when you're on a product page)_
428+
429+
(*Used when you're on a product page*)
416430
417431
- "Show critical reviews about durability"
418432
- "Always show a summary of critical reviews"
@@ -421,7 +435,8 @@ _(Used when you're on a product page)_
421435
- "Always highlight the product’s availability in red"
422436
423437
### 🧭 Standard Vector Search
424-
_(General product discovery with semantic matching)_
438+
439+
(*General product discovery with semantic matching*)
425440
426441
- "Wireless headphones"
427442
- "Waterproof smartwatches"
@@ -430,7 +445,8 @@ _(General product discovery with semantic matching)_
430445
- "Smartwatches with step tracking"
431446
432447
### 💬 Sentiment-Aware Search
433-
_(Feature-based preference queries)_
448+
449+
(*Feature-based preference queries*)
434450
435451
- "Headphones with great noise cancellation"
436452
- "Smartwatches with accurate heart rate monitoring"

arize-phoenix/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM arizephoenix/phoenix:version-8.31.0
1+
FROM arizephoenix/phoenix:version-11.24.1
22

33
# Expose the ports Phoenix uses
44
EXPOSE 6006

0 commit comments

Comments
 (0)