Marco Minerva fa58e02709 Refactor and enhance config management
Refactored code to centralize configuration access through a single `AppSettings` instance in `ChatService` and `VectorSearchService`, improving maintainability and reducing verbosity. Introduced new configuration settings (`MaxTokensPerLine`, `MaxTokensPerParagraph`, `OverlapTokens`, `MaxChunksCount`) in `AppSettings.cs` and `appsettings.json` for enhanced flexibility in content processing. Adjusted existing settings usage (`MessageLimit`, `MessageExpiration`) to align with the new access method, and removed obsolete settings (`StoragePath`, `VectorDbPath`, `QueuePath`). These changes simplify the codebase, make the application more configurable and adaptable to different content characteristics, and allow for more controlled vector search operations.
2024-06-17 11:58:30 +02:00
2024-06-14 11:47:00 +02:00
2024-06-14 11:47:00 +02:00
2024-06-14 11:47:00 +02:00
2024-06-14 11:47:00 +02:00
2024-06-14 11:37:55 +02:00
2024-06-14 17:56:07 +02:00
2024-06-14 17:47:46 +02:00
2024-06-14 11:47:00 +02:00

SQL Database Vector Search Sample

A repository that showcases the Vector Support in Azure SQL Database to perform embeddings and RAG with Azure OpenAI.

Important

Usage of this application requires the Vector Support feature in Azure SQL Database, currently in EAP. See this blog post for more details.

The application is a Minimal API that exposes endpoints to load documents, generate embeddings and save them into the database as Vectors, and perform searches using Vector Search and RAG. Currently, only PDF files are supported. Vectors are used with Entity Framework Core using the EFCore.SqlServer.VectorSearch library. Embedding and Chat Completion are integrated with Semantic Kernel.

SqlServerVectorSearch

Setup

  • Create an Azure SQL Database on a server that has the Vector Support feature enabled.
  • Execute the Scripts.sql file to create the tables needed by the application.
  • Open the appsettings.json file and set the connection string to the database and the other settings required by Azure OpenAI.
  • Run the application and start importing your PDF documents.
Languages
C# 54.5%
HTML 32.7%
CSS 9.4%
JavaScript 2.5%
TSQL 0.9%