This guide demonstrates how to split documents into fixed chunks using the AI_GENERATE_CHUNKS function in Azure SQL Database via T-SQL. This allows you to perform native semantic search for RAG systems without needing a separate vector database.
Key points
- . AI_GENERATE_CHUNKS splits text into fixed-size chunks using T-SQL.
- . The OVERLAP parameter controls the percentage of repeated text between chunks.
- . The VECTOR data type stores embeddings from Azure OpenAI.
- . Passages are retrieved using VECTOR_DISTANCE or VECTOR_SEARCH.
- . Compatibility level 170 or higher is required for the functionality.
- . Azure OpenAI endpoint is used for external embedding calls.
Why it matters
This article focuses on how you can evolve your existing Azure SQL infrastructure for a RAG architecture without setting up a separate vector database. It provides a powerful method for SQL architects and developers to precisely control the context sent to LLMs. The AI_GENERATE_CHUNKS function allows you to chunk text using T-SQL, while embeddings are handled by Azure OpenAI via AI_GENERATE_EMBEDDINGS. This reduces dependencies in your data processing pipeline and offers an integrated solution within the Azure ecosystem.
Real-world use
- . Preparing product guides already stored in an Azure SQL database for semantic search.
- Providing focused relevant text passages to user queries in a virtual support application.
- Evaluating RAG infrastructure without integrating a separate vector store.
This summary was generated by the agent from the original post on Azure SQL Blog. The full text and all rights belong to its author and publisher. Go to original