Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

License

NotificationsYou must be signed in to change notification settings

Azure-Samples/azure-sql-db-vector-search

Repository files navigation

This repo hosts samples meant to help use the newNative Vector Support in Azure SQL DB feature. We illustrate key technical concepts and demonstrate how you can store and query embeddings in Azure SQL data to enhance your application with AI capabilities.

Prerequisites

To use the provided samples make sure you have the following pre-requisites:

  1. An Azure subscription - Create one for free

  2. Azure SQL Database - Create one for free

  3. Make sure you have an Azure OpenAI resource created in your Azure subscription.

  4. Azure Data Studio -Download for free to use the notebooks offline.SQL Server Management Studio is also an option if you don't want to use notebook offline.

  5. If you are going to clone this repository in your machine, make sure to have installed thegit-lfs extension:Git Large File Storage

  6. For testing DiskANN, at the moment, you need to use SQL Server 2025. See the announcement here:Announcing Public Preview of DiskANN in SQL Server 2025.

Samples

Getting Started

A simple getting started to get familiar with common vector functions is available here:Getting-Started

Embeddings

Learn how to get embeddings from OpenAI directly from Azure SQL using the sample available theEmbeddings/T-SQL folder.

Exact Vector Search

TheVector-Search example illustrates the implementation of Vector Similarity Search within an SQL database, highlighting the capabilities of semantic search. By leveraging vector representations of text, the system can identify reviews that share contextual similarities with a given search query, transcending the limitations of keyword exact matches. Additionally, it demonstrates the integration of Keyword Search to guarantee the inclusion of specific terms within the search outcomes.

Hybrid Search

The Python sample in theHybrid-Search folder shows how to combine Fulltext search in Azure SQL database with BM25 ranking and cosine similarity ranking to do hybrid search.

Retrieval Augmented Generation

The RAG pattern is a powerful way to generate text using a pre-trained language model and a retrieval mechanism. TheRetrieval Augmented Generation folder contains a sample that demonstrates how to use the RAG pattern with Azure SQL and Azure OpenAI, using Python notebooks.

Approximate Vector Search

TheDiskANN folder contains a sample that demonstrates how to use the newVECTOR_SEARCH function with DiskANN. The sample uses a subset of Wikipedia data to create a table with a vector column, insert data, and perform approximate nearest neighbor search using theVECTOR_SEARCH function.

This sample, at the moment, requires SQL Server 2025. See the announcement here:Announcing Public Preview of DiskANN in SQL Server 2025.

Hybrid Search

Using DiskANN together with FullText enables you to do hybrid search. TheDiskANN folder contains the file004-wikipedia-hybrid-search.sql that demonstrates how to use the the newVECTOR_SEARCH function along withFREETEXTTABLE to implement hybrid search with Reciprocal Rank Fusion (RRF) and BM25 ranking.

SQL Client

If you are using SQL Client directly in your applications, you can use theSqlClient folder to see how to use Native Vector Search in C#/.NET.

Entity Framework Core

If you are using .NET EF Core, you can use theEF-Core sample to see how to use the new vector functions in your application.

Semantic Kernel

Semantic Kernel is an SDK that simplifies the creation of enterprise AI-enabled applications. Details on support for SQL Server and Azure SQL as vectors stores are available in theSemanticKernel folder.

Resources

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp