{"id":40822,"date":"2025-10-09T18:19:59","date_gmt":"2025-10-09T16:19:59","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=40822"},"modified":"2026-04-09T09:37:35","modified_gmt":"2026-04-09T07:37:35","slug":"sql-server-2025-building-a-rag-shopping-assistant-with-t-sql","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\/","title":{"rendered":"SQL-Server 2025: Building a RAG Shopping Assistant with T-SQL"},"content":{"rendered":"<p>In this post, we continue our AI journey with SQL Server 2025 (Preview). In previous articles, I already showed how to call the GPT-4o chat-completion model in Azure directly from SQL Server to generate product descriptions, how to create and store embeddings for semantic search, and how to use the (preview) acceleration features for semantic search workloads. If you want to dive into any of those topics, check out the posts below:<\/p>\n\n\n<ul class=\"wp-block-list\">\n<li>Calling GPT-4o from SQL Server to generate product content: <a href=\"https:\/\/www.dbi-services.com\/blog\/lift-your-application-in-the-age-of-ai-with-sql-server-2025\/\">https:\/\/www.dbi-services.com\/blog\/lift-your-application-in-the-age-of-ai-with-sql-server-2025\/<\/a><\/li>\n\n\n\n<li>Generating &amp; storing embeddings in SQL Server 2025: <a href=\"https:\/\/www.dbi-services.com\/blog\/sql-server-2025-generate-data-embeddings-for-semantic-search\/\">https:\/\/www.dbi-services.com\/blog\/sql-server-2025-generate-data-embeddings-for-semantic-search\/<\/a><\/li>\n\n\n\n<li>Accelerating Semantic Search workloads with vector Indexes: <a href=\"https:\/\/www.dbi-services.com\/blog\/sql-server-2025-vector-indexes-semantic-search-performance\/\">https:\/\/www.dbi-services.com\/blog\/sql-server-2025-vector-indexes-semantic-search-performance\/<\/a><\/li>\n<\/ul>\n\n\n\n<p>In this post now, we will combine some of these functionalities to implement a simple RAG based shopping assistant with SQL Server 2025 (Preview).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-is-rag\">What is RAG?<\/h2>\n\n\n<p>But first of all I will introduce you in the concept of RAG. As you may already noticed in recent years, AI chat models are great. They are able to understand your prompts, they can perform reasoning to \u201cthink\u201d about what you ask them and they can provide you an individual answer. But the model alone is limited to the data on which it was trained on.<\/p>\n\n<p>So when I ask a chat model like GPT-5 a very general question like \u201cWhat is the capital of Australia?\u201d the model is able to answer this question without any problem because it\u2019s general knowledge and the model certainly came into touch with this knowledge through its training data. But when I ask the model something which is only known through access on specific ( usually private) data sources\u00a0 the model is not able to answer such a question at least not alone. For example\u00a0 when I ask the model how many vacation days\u00a0 I have left for this year\u00a0 the model\u00a0 is obviously not able to answer such a question because such information\u2019s are stored in\u00a0 company internal tools:<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"616\" height=\"443\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild1.png\" alt=\"\" class=\"wp-image-40823\" style=\"width:626px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild1.png 616w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild1-300x216.png 300w\" sizes=\"auto, (max-width: 616px) 100vw, 616px\" \/><\/figure>\n\n\n<p>This\u00a0 is the point where Retrieval\u00a0 Augmented Generation (RAG) comes into play. RAG is an approach that searches external data sources for information relevant to the user&#8217;s prompt. The retrieved data is then used to augment the generation process of the AI model, allowing it to produce a context-aware and more accurate response.<\/p>\n\n<p>And this is what we will implement within this blog post. We will build a simple chat service\u00a0 which will help the customers of the ShopAI Online Shop to find the product of their desire.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-rag-architecture\">RAG Architecture:<\/h2>\n\n\n<p>Let\u2019s take a look at the RAG\u00a0 architecture for our purpose.\u00a0 Therefore take a look at the\u00a0 schema below\u00a0 and on the numbers which are representing steps in the RAG-process:<\/p>\n\n\n<ol class=\"wp-block-list\">\n<li>The customer sends a prompt\u00a0 to the ShopAI chat service where he describes which product he or she is looking for.<\/li>\n\n\n\n<li>The prompt is taken by the chat service and is sent to the embedding\u00a0 model hosted on azure to generate\u00a0 and return an embedding for that prompt.<\/li>\n\n\n\n<li>The embedding of the customers prompt is then used to perform a semantic search on the products data in the ShopAI database.<\/li>\n\n\n\n<li>The Top N semantic matching products are then sent to the chat model hosted on Azure for augmenting the generation of the response for the customers prompt.<\/li>\n\n\n\n<li>The augmented response is then sent to the customer.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"944\" height=\"366\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild2.png\" alt=\"\" class=\"wp-image-40824\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild2.png 944w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild2-300x116.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild2-768x298.png 768w\" sizes=\"auto, (max-width: 944px) 100vw, 944px\" \/><\/figure>\n\n\n<p>We will be able to handle the whole data logic inside T-SQL with the latest features of SQL-Server 2025 (Preview).<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-preparing-the-ai-models\">Preparing the AI Models:<\/h2>\n\n\n<p>So far so good. Let\u2019s start now with the practical implementation of our vision.<\/p>\n\n<p>The AI models I\u2019m using are the gpt-4o-mini model for the chat completion tasks and the text-embedding-3-small model to create embeddings for the users prompt. Embeddings for product data are already persisted in our database (refer to the earlier blog for details). When generating embeddings for user queries, use the exact same embedding model and settings used for the stored data.<\/p>\n\n<p>To learn how to deploy an AI model in Azure you should also check out my previous blog posts where I\u2019m guiding you through the process. For this article my models are already deployed in Azure AI Foundry:<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"391\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild3.png\" alt=\"\" class=\"wp-image-40825\" style=\"width:800px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild3.png 770w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild3-300x152.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild3-768x390.png 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/figure>\n\n\n<p>To use now the models inside T-SQL we have to create first a database scoped credential for the chat completion model. You can do that with the following statement. You\u2019ll find the API key inside Azure AI Foundry (Check out the previous Blog posts for detailed instructions):<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nUse ShopAI\nGo\n-- Create database scoped credential:\nCREATE DATABASE SCOPED CREDENTIAL &#x5B;https:\/\/shopai-blog.openai.azure.com\/openai\/deployments\/gpt-4o-mini\/] \/* always youse an url which is more generic*\/\n    WITH IDENTITY = &#039;HTTPEndpointHeaders&#039;, secret = &#039;{&quot;api-key&quot;:&quot;YOUR-API-KEY&quot;}&#039;;\nGO\n\n<\/pre><\/div>\n\n<p>Then we will do the same for the embedding model:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nUse ShopAI\nGo\n-- Create database scoped credential:\nCREATE DATABASE SCOPED CREDENTIAL &#x5B; https:\/\/shopai-blog.openai.azure.com\/openai\/deployments\/text-embedding-3-small\/] \/* always youse an url which is more generic*\/\n    WITH IDENTITY = &#039;HTTPEndpointHeaders&#039;, secret = &#039;{&quot;api-key&quot;:&quot;YOUR-API-KEY&quot;}&#039;;\nGO\n\n<\/pre><\/div>\n\n<p>And then we will register our embedding model to be able to generate data embeddings with the T-SQL built in functions:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nUse ShopAI\n-- Create EXTERNAL MODEL\nCREATE EXTERNAL MODEL OpenAITextEmbedding3Small\nAUTHORIZATION dbo\nWITH (\n      LOCATION = &#039;https:\/\/shopai-blog.openai.azure.com\/openai\/deployments\/text-embedding-3-small\/embeddings?api-version=2023-05-15&#039;,\n      API_FORMAT = &#039;Azure OpenAI&#039;,\n      MODEL_TYPE = EMBEDDINGS,\n      MODEL = &#039;text-embedding-3-small&#039;,\n      CREDENTIAL = &#x5B;https:\/\/shopai-blog.openai.azure.com\/openai\/deployments\/text-embedding-3-small\/],\n      PARAMETERS = &#039;{&quot;Dimensions&quot;:1536}&#039;\n);\n\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-rag-stored-procedure\">RAG Stored Procedure:<\/h2>\n\n\n<p>As we have now an AI model for chat completion and one for generating data embeddings, we are now ready to write our code for processing the data logic. We will handle all the data logic and interaction with the AI models within a T-SQL stored procedure. I will explain the stored procedure I wrote for that in this chapter.<\/p>\n\n<p>We have two Input Parameters which is the <strong>@SearchText<\/strong> parameter and the <strong>@ChatHistory<\/strong> Parameter. The <strong>@SearchText<\/strong> parameter represents the input text which the user is giving to our shopping assistant and the <strong>@ChatHistory<\/strong> is representing the history of the conversation and is per default set to NULL. We will handle the history of the conversation outside of the stored procedure.<\/p>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"564\" height=\"170\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild4.png\" alt=\"\" class=\"wp-image-40826\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild4.png 564w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild4-300x90.png 300w\" sizes=\"auto, (max-width: 564px) 100vw, 564px\" \/><\/figure>\n\n\n<p>Then the stored procedure will generate an embedding of the user query which is stored in the <strong>@SearchText<\/strong> variable and it will perform an exact vector distance search based on the product catalog data and the user query. Then it stores the top 5 findings as a list of JSON objects with the attributes product name, product description and product price:<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"494\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild5.png\" alt=\"\" class=\"wp-image-40827\" style=\"width:840px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild5.png 770w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild5-300x192.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild5-768x493.png 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/figure>\n\n\n<p>In the next step the Stored procedure generates a prompt for the AI chat completion model without a previous chat history (in case the <strong>@ChatHistory<\/strong> parameter is NULL):<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"435\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild6.png\" alt=\"\" class=\"wp-image-40828\" style=\"width:840px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild6.png 770w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild6-300x169.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild6-768x434.png 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/figure>\n\n\n<p>If there is a previous chat history (the <strong>@ChatHistory<\/strong> parameter is not NULL) the stored procedure is generating a prompt which is also including the provided chat history data:<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"468\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild7.png\" alt=\"\" class=\"wp-image-40829\" style=\"width:840px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild7.png 770w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild7-300x182.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild7-768x467.png 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/figure>\n\n\n<p>And finally the stored procedure calls the API of the chat completion model with the generated prompt and returns\/selects the response from the model:<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"280\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild8.png\" alt=\"\" class=\"wp-image-40830\" style=\"width:840px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild8.png 770w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild8-300x109.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild8-768x279.png 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/figure>\n\n\n<p>The process of RAG isn\u2019t that complicated, right? To recap:<\/p>\n\n\n<ol class=\"wp-block-list\">\n<li>You take the user query and generate an embedding for it.<\/li>\n\n\n\n<li>You use that embedding to semantically search your relevant context data.<\/li>\n\n\n\n<li>You prompt a chat completion model, augmenting your prompt with the retrieved context.<\/li>\n<\/ol>\n\n\n<p>Of course, in practice things can get more complex but at a high level, that\u2019s the essence of how RAG works.<\/p>\n\n<p>Let\u2019s test the stored procedure with a sample user request and let\u2019s see if we get a nice answer back with some product recommendations:<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"212\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild9.png\" alt=\"\" class=\"wp-image-40831\" style=\"width:840px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild9.png 770w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild9-300x83.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild9-768x211.png 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/figure>\n\n\n<p>Not bad for some few lines of code. This is the text I got back for my request:<\/p>\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>Great choice! \ud83d\udc99 Here are some stylish blue t-shirts that you might love:\u00a0 1. **Nike V-Neck Tees (Blue)** &#8211; **21.20 CHF**\u00a0\u00a0\u00a0 (Thoughts: This tee is perfect for sunny days with its breathable fabric and flattering V-neck cut, making it a great choice for both comfort and style!)\u00a0 2. **Boohoo Graphic Tees (Blue)** &#8211; **20.86 CHF**\u00a0\u00a0\u00a0 (Thoughts: If you want to stand out, this tee features bold graphics and a vibrant color, ideal for expressing your unique personality during casual outings!)\u00a0 3. **Fast Retailing V-Neck Tees (Blue)** &#8211; **23.93 CHF**\u00a0\u00a0\u00a0 (Thoughts: This lightweight tee is designed for women who crave comfort and style, making it perfect for pairing with jeans or skirts for a chic summer look!)\u00a0 4. **Madewell V-Neck Tees (Blue)** &#8211; **58.35 CHF**\u00a0\u00a0\u00a0 (Thoughts: For a more premium option, this tee offers a refreshing hue and modern design that instantly elevates your casual attire while keeping you cool!)\u00a0 5. **Armani Exchange V-Neck Tees (Blue)** &#8211; **55.08 CHF**\u00a0\u00a0\u00a0 (Thoughts: If you&#8217;re looking for a touch of designer elegance, this tee is crafted for comfort and style, ensuring a flattering fit for warm days!)\u00a0 Let me know if you need more information or help with your purchase! \ud83d\ude0a<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-shop-assistant-web-app\">Shop Assistant Web app<\/h2>\n\n\n<p>So we have now a stored procedure which is able to generate context aware product recommendations. Now let\u2019s wrap that up in a better-looking front end.<\/p>\n\n<p>I\u2019m building that it in Python with Streamlit, a framework for quickly spinning up web apps, perfect for rapid prototyping. Make therefore sure that you have streamlit installed in your environment. So let\u2019s take a look at the python code.<\/p>\n\n<p>First I\u2019m importing the modules which we need for our ShopAI Assistant. This is \u201cpyodbc\u201d for interacting with our database, \u201cos\u201d to read environment variables from operating system, \u201cstreamlit\u201d itself, the \u201ctime\u201d module to work efficient with time data, the \u201cload_dotenv\u201d method to load our environment variables into the operating system and \u201cjson\u201d to work with json data:<\/p>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"420\" height=\"233\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild10.png\" alt=\"\" class=\"wp-image-40833\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild10.png 420w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild10-300x166.png 300w\" sizes=\"auto, (max-width: 420px) 100vw, 420px\" \/><\/figure>\n\n\n<p>Then I\u2019m creating a .env file in my project directory to store our environment variables, which are the Server and Instance Name where our ShopAI database is running on, a SQL user with a password to connect to the database (make sure the user exists and has the appropriate rights):<\/p>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"513\" height=\"200\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild11.png\" alt=\"\" class=\"wp-image-40834\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild11.png 513w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild11-300x117.png 300w\" sizes=\"auto, (max-width: 513px) 100vw, 513px\" \/><\/figure>\n\n\n<p>In my python code I then wrote a function as a wrapper around the SQL stored procedure:<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"315\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild12.png\" alt=\"\" class=\"wp-image-40836\" style=\"width:840px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild12.png 770w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild12-300x123.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild12-768x314.png 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/figure>\n\n\n<p>Then I\u2019m loading the environment variables from our file into the operating system and I\u2019m building our pyodbc connection string:<\/p>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"549\" height=\"270\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild13.png\" alt=\"\" class=\"wp-image-40837\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild13.png 549w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild13-300x148.png 300w\" sizes=\"auto, (max-width: 549px) 100vw, 549px\" \/><\/figure>\n\n\n<p>Then we continue with Streamlit. We start by initializing the first assistant message in the st.session_state variable, a built-in Streamlit object that stores session data such as the conversation history. After that, we loop through all messages in the session state and display them to the user. Finally, we wait for new user input through the chat input field, so the conversation can continue interactively.<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"163\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild14.png\" alt=\"\" class=\"wp-image-40838\" style=\"width:840px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild14.png 770w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild14-300x64.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild14-768x163.png 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/figure>\n\n\n<p>Next, we handle the user input. When the user enters a message, it\u2019s captured by <strong>st.chat_input()<\/strong>.<\/p>\n\n<p>We then check if there are already previous messages stored in <strong>st.session_state<\/strong>. If yes, we convert the chat history (except for the very first assistant message) into JSON format and store it in the variable <strong>chat_history<\/strong>. Otherwise, we set <strong>chat_history<\/strong> to None. We do this for handling the conversation history inside python and pass it to the SQL stored procedure.<\/p>\n\n<p>We will then construct the input parameters for our <strong>get_product_recommendation<\/strong> function and we store the parameters inside a tuple which we call &#8220;<strong>p&#8221;<\/strong>.<\/p>\n\n<p>Then we append and display the user prompt to the chat front end.<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"378\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild15.png\" alt=\"\" class=\"wp-image-40839\" style=\"width:840px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild15.png 738w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild15-300x154.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/figure>\n\n\n<p>Finally we invoke the SQL stored procedure through our python function and we will display the response from the AI model in a typing like manner:<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"326\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild23.png\" alt=\"\" class=\"wp-image-40855\" style=\"width:840px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild23.png 770w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild23-300x127.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild23-768x325.png 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-testing-the-shopai-assistant\">Testing the ShopAI assistant<\/h2>\n\n\n<p>We have now wrote a stored procedure for processing the data logic and interacting with the gpt embedding and chat completion model and we have a simple Streamlit app to handle the conversation history and for the front end.<\/p>\n\n<p>Let\u2019s test what we did. To start the Streamlit web app I simple run the command &#8220;streamlit run app.py2:<\/p>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"541\" height=\"190\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild24.png\" alt=\"\" class=\"wp-image-40857\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild24.png 541w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild24-300x105.png 300w\" sizes=\"auto, (max-width: 541px) 100vw, 541px\" \/><\/figure>\n\n\n<p>A browser window should open and you will be able to see the front end of the shopping assistant:<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"496\" height=\"427\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild18.png\" alt=\"\" class=\"wp-image-40842\" style=\"width:559px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild18.png 496w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild18-300x258.png 300w\" sizes=\"auto, (max-width: 496px) 100vw, 496px\" \/><\/figure>\n\n\n<p>Fine! let\u2019s ask him who he is and how he can helps us \u2026<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"498\" height=\"432\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild19.png\" alt=\"\" class=\"wp-image-40843\" style=\"width:570px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild19.png 498w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild19-300x260.png 300w\" sizes=\"auto, (max-width: 498px) 100vw, 498px\" \/><\/figure>\n\n\n<p>Looks like he knows his purpose\ud83d\ude09 let\u2019s see if he is able to find the products of our desire. I\u2019m looking for some sport shoes \u2026<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"523\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild20.png\" alt=\"\" class=\"wp-image-40844\" style=\"width:573px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild20.png 525w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild20-300x300.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild20-150x150.png 150w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/figure>\n\n\n<p>Awesome! We are getting a suitable response! The only weakness I see is, that we are getting twice the product \u201cNew Look Sneakers (Black)\u201d recommended but with different prices.<\/p>\n\n<p>But when looking at the data below it\u2019s actually not the fault of our assistant because we have this product two times in our product catalogue. Good point to see how data quality matters \ud83d\ude09:<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"616\" height=\"167\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild21.png\" alt=\"\" class=\"wp-image-40845\" style=\"width:721px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild21.png 616w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild21-300x81.png 300w\" sizes=\"auto, (max-width: 616px) 100vw, 616px\" \/><\/figure>\n\n\n<p>I\u2019m interested in the &#8220;Skechers Sneakers (Black)&#8221; but I\u2019m not fully convinced yet. Let\u2019s see if the assistant is doing a great job convincing me:<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"530\" height=\"528\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild22.png\" alt=\"\" class=\"wp-image-40846\" style=\"width:592px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild22.png 530w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild22-300x300.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild22-150x150.png 150w\" sizes=\"auto, (max-width: 530px) 100vw, 530px\" \/><\/figure>\n\n\n<p>Sounds good for my! I\u2019m totally convinced that these sneakers would perfectly match to my desire. Assistant you made a good job!<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-key-takeaways\">Key Takeaways<\/h2>\n\n\n<p>As you\u2019ve seen in this post, we were able to easily build an AI shopping assistant, with all the data processing and RAG logic running directly inside SQL Server 2025 (Preview)! We only used python for handling the conversation history and for a nice looking front end with Streamlit.<\/p>\n\n<p>If you are looking for more inspiration regarding this topic I can highly recommend you to visit the following GitHub page from Microsoft: <a href=\"https:\/\/github.com\/Azure-Samples\/azure-sql-db-chatbot\/\">https:\/\/github.com\/Azure-Samples\/azure-sql-db-chatbot\/<\/a><\/p>\n\n<p>Note that you will find all the code I wrote and explained in this blog on my GitHub: <a href=\"https:\/\/github.com\/HocineMechara\/ShopAI-AIAssistantBlog.git\">https:\/\/github.com\/HocineMechara\/ShopAI-AIAssistantBlog.git<\/a><\/p>\n\n<p>Let me know your thoughts on AI, and especially on RAG, in the comments section, I\u2019d be delighted to read your insights and discuss this topic further!<\/p>\n\n<p>Thanks for reading, Hocine \ud83d\ude09<\/p>","protected":false},"excerpt":{"rendered":"<p>In this post, we continue our AI journey with SQL Server 2025 (Preview). In previous articles, I already showed how to call the GPT-4o chat-completion model in Azure directly from SQL Server to generate product descriptions, how to create and store embeddings for semantic search, and how to use the (preview) acceleration features for semantic [&hellip;]<\/p>\n","protected":false},"author":145,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[99],"tags":[2810,1089,3678,3686,51],"type_dbi":[],"class_list":["post-40822","post","type-post","status-publish","format-standard","hentry","category-sql-server","tag-ai","tag-python","tag-rag","tag-rag-search-2","tag-sql-server"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>SQL-Server 2025: Building a RAG Shopping Assistant with T-SQL - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL-Server 2025: Building a RAG Shopping Assistant with T-SQL\" \/>\n<meta property=\"og:description\" content=\"In this post, we continue our AI journey with SQL Server 2025 (Preview). In previous articles, I already showed how to call the GPT-4o chat-completion model in Azure directly from SQL Server to generate product descriptions, how to create and store embeddings for semantic search, and how to use the (preview) acceleration features for semantic [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2025-10-09T16:19:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-09T07:37:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"616\" \/>\n\t<meta property=\"og:image:height\" content=\"443\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Hocine Mechara\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Hocine Mechara\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\\\/\"},\"author\":{\"name\":\"Hocine Mechara\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/29415d02bc1b50884796a01cf649951f\"},\"headline\":\"SQL-Server 2025: Building a RAG Shopping Assistant with T-SQL\",\"datePublished\":\"2025-10-09T16:19:59+00:00\",\"dateModified\":\"2026-04-09T07:37:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\\\/\"},\"wordCount\":2160,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2025\\\/10\\\/Bild1.png\",\"keywords\":[\"ai\",\"Python\",\"RAG\",\"RAG-Search\",\"SQL Server\"],\"articleSection\":[\"SQL Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\\\/\",\"name\":\"SQL-Server 2025: Building a RAG Shopping Assistant with T-SQL - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2025\\\/10\\\/Bild1.png\",\"datePublished\":\"2025-10-09T16:19:59+00:00\",\"dateModified\":\"2026-04-09T07:37:35+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/29415d02bc1b50884796a01cf649951f\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2025\\\/10\\\/Bild1.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2025\\\/10\\\/Bild1.png\",\"width\":616,\"height\":443},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL-Server 2025: Building a RAG Shopping Assistant with T-SQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/29415d02bc1b50884796a01cf649951f\",\"name\":\"Hocine Mechara\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f771f838feed0619485da1e42ae05d771dcb446e1f4785244582280315fa73c3?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f771f838feed0619485da1e42ae05d771dcb446e1f4785244582280315fa73c3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f771f838feed0619485da1e42ae05d771dcb446e1f4785244582280315fa73c3?s=96&d=mm&r=g\",\"caption\":\"Hocine Mechara\"},\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/hocinemechara\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"SQL-Server 2025: Building a RAG Shopping Assistant with T-SQL - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\/","og_locale":"en_US","og_type":"article","og_title":"SQL-Server 2025: Building a RAG Shopping Assistant with T-SQL","og_description":"In this post, we continue our AI journey with SQL Server 2025 (Preview). In previous articles, I already showed how to call the GPT-4o chat-completion model in Azure directly from SQL Server to generate product descriptions, how to create and store embeddings for semantic search, and how to use the (preview) acceleration features for semantic [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\/","og_site_name":"dbi Blog","article_published_time":"2025-10-09T16:19:59+00:00","article_modified_time":"2026-04-09T07:37:35+00:00","og_image":[{"width":616,"height":443,"url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild1.png","type":"image\/png"}],"author":"Hocine Mechara","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Hocine Mechara","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\/"},"author":{"name":"Hocine Mechara","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/29415d02bc1b50884796a01cf649951f"},"headline":"SQL-Server 2025: Building a RAG Shopping Assistant with T-SQL","datePublished":"2025-10-09T16:19:59+00:00","dateModified":"2026-04-09T07:37:35+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\/"},"wordCount":2160,"commentCount":0,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild1.png","keywords":["ai","Python","RAG","RAG-Search","SQL Server"],"articleSection":["SQL Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\/","url":"https:\/\/www.dbi-services.com\/blog\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\/","name":"SQL-Server 2025: Building a RAG Shopping Assistant with T-SQL - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild1.png","datePublished":"2025-10-09T16:19:59+00:00","dateModified":"2026-04-09T07:37:35+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/29415d02bc1b50884796a01cf649951f"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild1.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/10\/Bild1.png","width":616,"height":443},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-2025-building-a-rag-shopping-assistant-with-t-sql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"SQL-Server 2025: Building a RAG Shopping Assistant with T-SQL"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/29415d02bc1b50884796a01cf649951f","name":"Hocine Mechara","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f771f838feed0619485da1e42ae05d771dcb446e1f4785244582280315fa73c3?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f771f838feed0619485da1e42ae05d771dcb446e1f4785244582280315fa73c3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f771f838feed0619485da1e42ae05d771dcb446e1f4785244582280315fa73c3?s=96&d=mm&r=g","caption":"Hocine Mechara"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/hocinemechara\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/40822","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/145"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=40822"}],"version-history":[{"count":15,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/40822\/revisions"}],"predecessor-version":[{"id":40863,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/40822\/revisions\/40863"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=40822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=40822"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=40822"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=40822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}