How Amazon RDS for SQL Server is Utilized as a Vector Data Store in a Generative AI Use Case

How Amazon RDS for SQL Server is Utilized as a Vector Data Store in a Generative AI Use Case

Generative artificial intelligence (AI) has captured the interest of many, with the integration of generative capabilities into customer-facing services becoming essential. This advancement in AI has evolved from machine learning and deep learning models, with the leap to generative AI made possible by foundation models like Amazon Bedrock. Retrieval augmented generation (RAG) is a popular technique for providing context in generative AI solutions, using vector embeddings to transform data and enable similarity searches.

Amazon Relational Database Service (RDS) for SQL Server is a reliable and efficient database service that can serve as a vector data store for generative AI use cases. By modeling vectors as relational tables within a SQL Server database, and utilizing built-in optimizations like SIMD and AVX-512, cosine similarity calculations can be implemented as user-defined functions.

In a demonstration using Amazon RDS for SQL Server as a vector data store, a generative AI use case involving similarity search was showcased. By storing embeddings close to domain-specific datasets, the process of combining them with metadata becomes simplified and maintaining up-to-date embeddings becomes easier.

The solution architecture involved Amazon RDS for SQL Server, Amazon SageMaker, and Amazon Bedrock, specifically the Amazon Titan G1 Text Embedding Model. The workflow included transforming a user question into a vector embedding using the Amazon Titan model and then running a similarity search against vector embeddings in the database to provide relevant responses.

Setting up the solution architecture involved creating an Amazon RDS for SQL Server database instance and configuring a SageMaker Notebook. The process included installing required libraries, setting up an IAM role for security, and making API calls to vectorize user prompts and conduct similarity searches.

The results demonstrated how the solution could effectively provide relevant responses based on cosine distance calculations between user prompts and stored data vectors. The solution showcased the power of RAG in enhancing generative AI responses by incorporating domain-specific information with foundation models.

Authors of this solution include Joshua Jin, Camilo Leon, Sudarshan Roy, and Barry Ooi, who specialize in database benchmarking, solutions architecture, database migration, and cloud data platform design, respectively. Their expertise and contributions played a crucial role in developing and showcasing this generative AI solution using Amazon RDS for SQL Server as a vector data store.

Article Source
https://aws.amazon.com/blogs/database/a-generative-ai-use-case-using-amazon-rds-for-sql-server-as-a-vector-data-store/