RAG with Azure AI Search

Nov 15 2024 · Python 3.12, Microsoft Azure, JupyterLab

Lesson 04: Azure AI Search with OpenAI Service

Demo

Episode complete

Play next episode

Next

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

In this demo, you’ll build a RAG app with Azure AI Search and Azure OpenAI. You’ll also learn how to tune some parameters to optimize your app.

Setting Up Your RAG App

To get started, you’ll need an LLM for your RAG. Head over to Azure OpenAI Studio, locate the Deployments button on the left menu, and follow the same steps as before to create a gpt-4o model. Choose a descriptive name for it, such as “gpt-4o”. You’ll use this as the value for the AZURE_DEPLOYMENT_MODEL variable soon.

Creating Embeddings and Search Index

Next, you create a search index client, configure a vector search, create a semantic search configuration, and finally, create an index on Azure AI Search.

Testing the RAG Prompt

Time to step through the final cell and build your RAG.

Troubleshooting and Optimizing Search Results

With the results, format them into a single string to be passed along with the RAG prompt to your LLM.

Running and Refining Your RAG App

It displays something similar to: “- Friends: This beloved sitcom follows the lives of six close-knit friends—Rachel, Ross, Monica, Chandler, Joey, and Phoebe—as they navigate life in New York City.”

See forum comments
Cinema mode Download course materials from Github
Previous: Instruction 01 Next: Instruction 02