AI & Data Published September 15, 2026 Generative AI applications are only as useful as the data they can reach. Retrieval-augmented generation (RAG) addresses this by retrieving relevant content from your own systems and passing it to a large language model (LLM) together with the user's question, so answers are grounded in current, authorized business data rather than only in the model's training data. Until recently that usually meant adding a separate vector database. With SQL Server 2025, much of that capability is available inside the database engine many organizations already run. What is new in SQL Server 2025 VECTOR data type - stores embeddings (arrays of numbers that represent the meaning of text or images) in an optimized binary format. VECTOR_DISTANCE - calculates cosine, Euclidean or dot-product distance for exact nearest-neighbor search. Vector indexes and VECTOR_SEARCH - approximate nearest-neighbor search based on DiskANN for large data sets. At general availability these were released as preview features, so check the current documentation before relying on them in production. Model integration - external model definitions and embedding functions let T-SQL call an embedding model (for example Azure OpenAI or a locally hosted model) through a secured REST endpoint. Native JSON type and regular expressions - useful for storing model responses and cleaning text before it is embedded. A typical RAG flow on SQL Server Split documents or records into chunks of a few hundred words. Generate an embedding for each chunk and store it in a VECTOR column alongside the source key, permissions and metadata. When a user asks a question, embed the question and find the closest chunks using VECTOR_DISTANCE or VECTOR_SEARCH, combined with normal WHERE clauses for security and filtering. Send the retrieved text and the question to the LLM, and return the answer with references to the sources. The advantage of doing this in the database is that the retrieval step can use the same row-level security, backups, high availability and auditing as the rest of your data. What DBAs should plan for Storage and memory: a 1,536-dimension float32 embedding is about 6 KB per row. Millions of chunks add up quickly, so size storage and buffer pool accordingly. Refresh pipelines: embeddings must be regenerated when source content changes. Change tracking or CDC plus a scheduled job is a common pattern. Security: keep API keys in database scoped credentials, restrict which principals can call external endpoints, and never let retrieval bypass the user's data permissions. Cost and latency: calls to hosted models are billed per token. Cache embeddings and batch updates rather than embedding on every request. Testing: measure retrieval quality with real questions before tuning the model prompt - poor retrieval is the most common cause of poor answers. Is a dedicated vector database still needed? For many line-of-business applications with up to tens of millions of vectors, keeping vectors next to the relational data is simpler and more secure. Very large, high-throughput semantic search workloads may still benefit from specialized services such as pgvector on PostgreSQL, Amazon OpenSearch, Azure AI Search or dedicated vector databases. The right answer depends on volume, latency, existing skills and governance requirements. AVRIN helps organizations evaluate these options, prepare their data, and build secure RAG solutions on SQL Server, PostgreSQL and cloud AI platforms.