SQL-AI-samples: a catalogue of Azure SQL AI patterns, not a library you install
Samples using AI and Azure SQL DB
At a glance
- What is it?
- Azure-Samples/SQL-AI-samples is a collection of notebooks, T-SQL scripts and end-to-end demos for putting LLMs and vector search next to Azure SQL Database. Its value is in the patterns it shows; its cost is that you assemble the dependencies yourself.
- Who is it for?
- Adopt SQL-AI-samples if you are prototyping an Azure SQL AI feature and want a working reference for the specific pattern you need, such as the T-SQL RAG scripts, the LangChain NL2SQL notebooks or the MssqlMcp server. Do not adopt it if you want a supported library with a version number, a changelog and a compatibility matrix, because it is a samples repository and its top-level entries are folders of notebooks and scripts.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 164 days ago.
- What is it written in?
- Mainly HTML, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 14, 2026, and from our analysis. They are not legal advice.
Star history
- Azure-Samples/SQL-AI-samples333 ★ · +2
| Repository | 2026-09-15 | 2026-11-14 |
|---|---|---|
| Azure-Samples/SQL-AI-samples | 331 | 333 |
2 Stars in the last 60 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
What SQL-AI-samples actually is, and who it is written for
The README describes the repository as hosting samples that help design AI applications built on data from an Azure SQL Database. That is the whole scope. There is no package on a registry, no versioned release, and the recent releases field is empty. What you get instead is a set of directories: AzureSQLACSSamples, AzureSQLDatabase, AzureSQLFaiss, AzureSQLPromptFlowSamples, AgentMode and MssqlMcp, plus supporting files such as LICENSE, CONTRIBUTING.md, SECURITY.md and SUPPORT.md.
The audience is narrower than the topic suggests. These samples assume you already have an Azure SQL Database, and most of them assume an Azure OpenAI resource or an OpenAI key as well. The Prompt Flow sample goes further and expects Azure Cognitive Search and an Azure ML workspace. If you are evaluating whether to put embeddings in your database at all, this repository will not settle that argument. It shows how Microsoft's own teams wire the pieces together, which is useful when you have already decided to build on Azure SQL and need a concrete starting shape.
The primary language listed for the repository is HTML, which is a weak signal about the contents. The bulk of what the README describes is Python notebooks and T-SQL scripts, with a C# component in the MCP server sample. Treat the language field as metadata, not as a description of what you will be reading.
The three shapes of sample in this repository
The samples fall into recognisable categories, and knowing which one you are looking at saves time.
The first is the single-notebook demonstration. The Azure SQL plus Azure Cognitive Services sample is one notebook, AzureSQL_CogSearch_IntegratedVectorization.ipynb, that recommends products from a database of user reviews using Azure Cognitive Search for storage and retrieval. It leans on preview features of Cognitive Search, specifically automatic chunking and integrated vectorization of user queries. The Vanna.AI notebook is similar in shape: it uses the vanna Python package to generate SQL through a combination of retrieval and an LLM, and it covers connecting to a database and training the model.
The second is the T-SQL-first pattern. The Retrieval Augmented Generation sample is a step-by-step guide to doing RAG against data in Azure SQL, integrating with OpenAI from the database itself, so that a natural language question returns an answer from a GPT model grounded in your rows. The Content Moderation folder holds two T-SQL scripts that call Azure OpenAI Content Safety and Language AI. The Content Safety script returns a severity across four categories: violence, sexual, self-harm and hate. The Language AI script reports which PII it found, what category that PII belongs to, and redacts it in the original string. This is the most interesting category in the repository, because the logic lives in the database rather than in an application tier.
The third is the end-to-end application. Similar Content Finder, Session Conference Assistant, the Chainlit chatbot, the Semantic Kernel chatbot, the Azure SQL DB Vectorizer, the Redis vector search demo, the FAISS similarity search sample and the KMeans IVFFlat index builder each assemble a full application from Azure SQL plus other components. These are the samples that show architecture rather than a single technique, and they are also the ones with the most external dependencies.
Installing nothing: how to run your first sample
There is no install step for the repository as a whole. The README points to https://aka.ms/sql-ai as the project home, and each sample carries its own setup instructions in its own folder. The README does describe one shortcut for the LangChain notebooks: create a codespace on the repository, open a terminal, change into the LangChain directory and follow one of the notebooks.
The directory change is the only command the README gives explicitly, so that is the one to copy exactly:
cd AzureSQLDatabase/LangChainFrom that directory you open one of the two notebooks. They create a natural language to SQL agent against an Azure SQL Database, and they differ in which LLM they call: one uses Azure OpenAI, the other uses OpenAI. The README does not document the environment variables either notebook expects, so read the first cells of the notebook you chose before running anything.
For the MCP server sample, the README says it is a Model Context Protocol server for MSSQL databases built on the official MCP C# SDK. It does not give a build or run command in the top-level README, so the setup lives in the MssqlMcp folder. Expect a .NET toolchain there rather than Python.
If you want the database-side RAG pattern instead, the README links to a separate repository, Azure-Samples/azure-sql-db-chatbot, for the full walkthrough. Several samples in this repository are pointers to other repositories rather than code in this one, and that is worth knowing before you clone.
Where the samples stop and your work begins
The clearest limitation is dependency weight. The Prompt Flow sample requires Azure Cognitive Search, Azure OpenAI connections and an Azure ML workspace to deploy the flow as an endpoint. The Cognitive Services notebook depends on preview Cognitive Search capabilities, and preview features can change or be withdrawn. If your organisation restricts preview services, part of this repository is closed to you.
A second limitation is that samples are not maintained as products. The last push to the repository was on 2026-06-03, so the code is recent, but there is no release cadence and no compatibility statement. Nothing in the README tells you which version of the OpenAI SDK, LangChain, or the vanna package a given notebook was written against. When a notebook fails, the failure is usually a dependency drift problem, and the repository does not offer a pinned environment to fall back on.
A third limitation is scope. The vector samples cover several different storage strategies: vectors in Azure SQL, vectors in FAISS, vectors in Redis with Azure SQL as the source through Azure Functions, and a hand-built IVFFlat index using KMeans. That breadth is educational, but it means the repository does not tell you which one to pick. There is no comparison document in the README that weighs the options against each other.
Finally, if you need a supported connector with a support contract behind it, this is the wrong artefact. SUPPORT.md exists, but a samples repository is not a product, and the README frames everything as illustration rather than as a component you depend on.
How this differs from LangChain or Semantic Kernel on their own
The obvious alternative is to skip the repository and use the framework directly. LangChain and Semantic Kernel both ship their own getting-started samples, and the README acknowledges this by pointing to the LangChain website's Getting Started material while noting that this repository's version uses Azure SQL.
That difference is the entire point. A generic LangChain SQL agent sample targets SQLite or Postgres, and the SQL dialect, the connection handling and the vector type differ once you move to Azure SQL Database. The notebooks in AzureSQLDatabase/LangChain exist to close that gap, and the Semantic Kernel sample extends it to structured and unstructured data together. If you are already fluent in one of these frameworks and your target is Azure SQL, the framework's own samples will get you most of the way and this repository supplies the database-specific corrections.
The other alternative is to keep the logic out of the database. Most teams implement RAG in an application service: fetch rows, call the model, store vectors in a dedicated vector store. The T-SQL RAG and Content Moderation samples take the opposite position, calling OpenAI from inside Azure SQL. That is a real architectural difference, not a stylistic one. It removes a network hop and a service from your stack, and it moves the integration point into the database, where deployment, permissions and testing work differently. Whether that trade is good depends on how your team ships database changes.
Maintenance, licensing and what to check before you copy
The repository is licensed under MIT, which is permissive and places few restrictions on reuse. That licence covers the code in this repository. It does not cover the services the samples call: Azure OpenAI, Azure Cognitive Search, Azure ML, Azure Functions and Redis each carry their own terms and their own billing, and the MIT grant says nothing about them. This is not legal advice; if you plan to ship a derivative, confirm the terms of every service the sample touches.
The maintenance picture is straightforward. The last push was on 2026-06-03 and the repository is not archived. There are no releases, so there is no upgrade path in the usual sense: you upgrade by pulling the current state of main and re-reading the notebook or script you copied. If you forked a sample into your own codebase, that fork is now yours to maintain, and nothing upstream will notify you when an API it calls changes shape.
Before copying any sample, check the imports at the top of its notebook or script and pin them in your own environment. The repository does not do that for you.
Editorial conclusion
Adopt SQL-AI-samples if you are prototyping an Azure SQL AI feature and want a working reference for the specific pattern you need, such as the T-SQL RAG scripts, the LangChain NL2SQL notebooks or the MssqlMcp server. Do not adopt it if you want a supported library with a version number, a changelog and a compatibility matrix, because it is a samples repository and its top-level entries are folders of notebooks and scripts. Before you commit to a pattern, verify three things in the sample you picked: which Azure services it calls and whether you already have them, whether the notebook pins package versions or expects you to install current ones, and whether the SQL it runs targets Azure SQL Database or a broader SQL Server surface. That third check matters most for the vector samples, because the T-SQL RAG and content moderation scripts assume database-side calls that not every SQL Server deployment offers.
Frequently asked questions
Is SQL-AI-samples a package I can install with pip?
No. It is a repository of samples, notebooks and T-SQL scripts, and the README describes it as hosting samples rather than shipping a library. You copy the code you need into your own project and manage its dependencies yourself.
What is the MssqlMcp server in SQL-AI-samples?
It is a Model Context Protocol server for MSSQL databases, built using the official MCP C# SDK according to the README. It lives in the MssqlMcp folder of the repository.
Can I do retrieval augmented generation entirely inside Azure SQL Database with these samples?
Yes, that is what the Retrieval Augmented Generation T-SQL sample demonstrates. The README describes it as a step-by-step guide for asking natural language questions and getting answers from an OpenAI GPT model using data held in Azure SQL Database, with the integration happening from the database itself.
Which LLM providers do the SQL-AI-samples notebooks use?
The LangChain notebooks work with either Azure OpenAI or OpenAI, and the README notes the two notebooks differ on that choice. Several other samples, including the Content Moderation scripts and the Prompt Flow example, are built around Azure OpenAI and Azure Cognitive Services.
Do I need Azure Cognitive Search to use SQL-AI-samples?
Only for the samples that name it. The Cognitive Services notebook and the Prompt Flow sample both use Azure Cognitive Search, and the Prompt Flow one also expects an Azure ML workspace. The T-SQL RAG and LangChain samples do not require it.
How do I get started with SQL-AI-samples quickly?
The README suggests creating a codespace on the repository, opening a terminal, changing into the LangChain directory and following one of the notebooks there. That path avoids cloning and local setup, but you still need an Azure SQL Database and an LLM endpoint for the notebook to run.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/azure-samples-sql-ai-samples)Star history chart for your README
[](https://hysenlabs.com/projects/azure-samples-sql-ai-samples)Was this useful?