diff --git a/Instructions/Labs/14-exercise-build-rag-application-postgresql-python.md b/Instructions/Labs/14-exercise-build-rag-application-postgresql-python.md index 5f5c59e..60d31be 100644 --- a/Instructions/Labs/14-exercise-build-rag-application-postgresql-python.md +++ b/Instructions/Labs/14-exercise-build-rag-application-postgresql-python.md @@ -87,7 +87,7 @@ This step guides you through using Azure CLI commands from the Azure Cloud Shell STATE=$(az cognitiveservices account show -g "$RG_NAME" -n "$AOAI" --query "properties.provisioningState" -o tsv) echo "provisioningState=$STATE" [ "$STATE" = "Succeeded" ] && break - sleep 10 + sleep 30 done #3 OpenAI deployments: embedding + chat @@ -139,7 +139,9 @@ You connect to the `ContosoHelpDesk` database on your Azure Database for Postgre 1. In the [Azure portal](https://portal.azure.com/), navigate to your newly created Azure Database for PostgreSQL server. -1. In the resource menu, under **Settings**, select **Databases** select **Connect** for the `ContosoHelpDesk` database. Selecting **Connect** doesn't actually connect you to the database; it simply provides instructions for connecting to the database using various methods. Review the instructions to **Connect from browser or locally** and use those instructions to connect using the Azure Cloud Shell. +1. In the resource menu, under **Settings**, select **Connect**, then select **ContosoHelpDesk** for the database. + +1. Expand the section **Connect from browser or locally** and use the command shown to connect using the Azure Cloud Shell. ![Screenshot of the Azure Database for PostgreSQL Databases page. Databases and Connect for the ContosoHelpDesk database are highlighted by red boxes.](media/14-postgresql-database-connect.png) @@ -357,7 +359,7 @@ On the GitHub repo you cloned, you can find the `app.py` file, which contains th 1. Review the libraries the application depends on. The main library you use for interacting with Azure OpenAI is `langchain_openai`. -1. our first function, `get_conn`, just creates a connection to the PostgreSQL database. This one is predefined for you. For the following three functions, replace the comments with actual code provided. +1. Our first function, `get_conn`, just creates a connection to the PostgreSQL database. This one is predefined for you. For the following three functions, replace the comments with actual code provided. 1. Replace the comment **# Retrieve top-k rows by cosine similarity (embedding must be present)** with the following script: @@ -537,3 +539,4 @@ Additionally, you explored how to optimize query performance using vector indexe Finally, you learned about the importance of monitoring and fine-tuning your application over time. As user queries evolve and the dataset expands, you need to revisit your indexing strategy, prompt design, and overall architecture to maintain optimal performance and accuracy. + diff --git a/Instructions/Labs/14-exercise-implement-graph-rag.md b/Instructions/Labs/14-exercise-implement-graph-rag.md index 692e309..3b41f6e 100644 --- a/Instructions/Labs/14-exercise-implement-graph-rag.md +++ b/Instructions/Labs/14-exercise-implement-graph-rag.md @@ -86,7 +86,7 @@ This step guides you through using Azure CLI commands from the Azure Cloud Shell STATE=$(az cognitiveservices account show -g "$RG_NAME" -n "$AOAI" --query "properties.provisioningState" -o tsv) echo "provisioningState=$STATE" [ "$STATE" = "Succeeded" ] && break - sleep 10 + sleep 30 done #3 OpenAI deployments: embedding + chat @@ -138,7 +138,9 @@ You connect to the `ContosoHelpDesk` database on your Azure Database for Postgre 1. In the [Azure portal](https://portal.azure.com/), navigate to your newly created Azure Database for PostgreSQL server. -1. In the resource menu, under **Settings**, select **Databases** select **Connect** for the `ContosoHelpDesk` database. Selecting **Connect** doesn't actually connect you to the database; it simply provides instructions for connecting to the database using various methods. Review the instructions to **Connect from browser or locally** and use those instructions to connect using the Azure Cloud Shell. +1. In the resource menu, under **Settings**, select **Connect**, then select **ContosoHelpDesk** for the database. + +1. Expand the section **Connect from browser or locally** and use the command shown to connect using the Azure Cloud Shell. ![Screenshot of the Azure Database for PostgreSQL Databases page. Databases and Connect for the ContosoHelpDesk database are highlighted by red boxes.](media/14-postgresql-database-connect.png) @@ -432,7 +434,9 @@ Let's create the nodes from the company policies data. ```sql -- Disable pagination for better output readability \pset pager off + ``` + ```sql -- Upsert the policy nodes SELECT public.policy_graph_upsert(policy_id, title, department, category, policy_text) FROM public.company_policies @@ -515,7 +519,9 @@ So far you added the nodes for policies, departments, categories, and topics. It ```sql -- Disable pagination for better output readability \pset pager off + ``` + ```sql -- BELONGS_TO SELECT public.create_policy_link_in_policies_graph(policy_id, 'Department', department, 'BELONGS_TO') FROM public.company_policies; @@ -700,3 +706,5 @@ In this exercise, you used a small graph to add structure to retrieval. Instead To apply the methods discussed here on your own data, start small. Pick a few entities and relationships that matter, link them to your rows, use a short `openCypher` query to fetch candidate `ids`, then apply vector ranking. Tighten or relax the filters as needed, swap in other concepts, and keep the workflow in SQL so it's straightforward to maintain. + + diff --git a/Instructions/Labs/media/14-postgresql-database-connect.png b/Instructions/Labs/media/14-postgresql-database-connect.png index a30d9a8..7d3189b 100644 Binary files a/Instructions/Labs/media/14-postgresql-database-connect.png and b/Instructions/Labs/media/14-postgresql-database-connect.png differ