This hands on lab explores how to use the new public preview of Azure SQL's Native Vector Support with Semantic Kernel and Entity Framework Core to build a retrieval augmented generation (RAG) app.
Many experienced .NET developers are using Azure SQL for their day-to-day work on business applications. As these developers begin to retool and pick up new Generative AI skills, up until recently they have been disappointed with having to adopt and learn a new database just to store vector embeddings. As of November 6, 2024 Azure SQL announced the public preview of native vector support. This means .NET developers can now focus on getting hands on learning, prototyping and building GenAI apps using Azure SQL as the database to put their embeddings.
NOTE: as of the writing of this lab, the Native Vector Support is in Public Preview.
Developing applications that have Generative AI functionality tend follow a 33/33/33 rule:
- 1/3 of the develop time is spent focusing on data preparation
- 1/3 of the time is spent on the actual Generative AI logic
- 1/3 of the time is regular .NET application development
This lab starts with creating and configuring an Azure SQL database. You then get started with the .NET code. We provide a minimal console application for a starting point. The first phase is to create the database tables, configure the model to use the new VECTOR type, then create the code to ingest the PDF we will use for the test data. The second phase you will build out the application logic using Semantic Kernel and Entity Framework Core to retrieve similar data (performing a similarity search in Azure SQL) to use in a RAG chat bot loop. By the end you'll have a chat bot which you can use to ask the test data questions in natural language.
- Experience working with the Azure Portal
- Basic knowledge of creating resources in Azure
- Experience working with Entity Framework Core migrations
- Basic knowledge of Semantic Kernel and its concepts
- Azure Subscription - you can create a Free account if you don't have one.
- Ability to create a new Azure SQL Server and DB
- Ability to create Azure Open AI resource and deployments
- Git
- VS Code (Visual Studio will work but right now the steps are written for VS Code)
- Entity Framework Core .NET Core CLI tools
- SQL Server Management Studio
- Create an Azure SQL DB and configure the application to use Vector search using Entity Framework Core
- Implement code to ingest PDF's into the Azure SQL DB along with their vector embeddings
- Configure and create Semantic Kernel plugins to search the database
- Use all the above to build a chat bot to answer questions from PDF contents