azuresql-db-rag

A guide for storing text or other content as numerical representations called embeddings, then finding similar items in a local Azure SQL Database container. Retrieval-augmented generation, or RAG, retrieves relevant stored information for an AI response.

In plain words
What is it for?
Use it for semantic search, finding similar documents, chatbot retrieval, and top-k nearest-neighbor queries.
Why use it?
It lets an application keep embeddings and perform similarity searches in the database without a separate vector database.

Skill for Claude CodeCodex

Part of the azure-sql-database-container plugin — 17 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/microsoft/azure-sql-database-container/azuresql-db-rag
Any agent
npx skills add microsoft/azure-sql-database-container --skill azuresql-db-rag
Clone the repo
git clone --depth 1 https://github.com/microsoft/azure-sql-database-container

Made for: Claude Code, Codex.

Or install azure-sql-database-container, the plugin that ships this one along with the rest of its 17 skills.

Per session 186 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,897 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00186 $0.02897
Opus 5 $0.00093 $0.01448
Sonnet 5 $0.00037 $0.00579
Haiku 4.5 $0.00019 $0.00290

Measured 3d ago against content hash 19fd806da41c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

azuresql-db-rag scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

r = requests.post(EMBED_URL, json={"model": EMBED_MODEL, "prompt": text})
skills/azuresql-db-rag/SKILL.md · 235 lines

How it starts

The opening of the file, as written. The whole thing — 235 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Local vector search and RAG on the Azure SQL Database container

Store embeddings and run similarity search directly in the Azure SQL Database engine using the native VECTOR(n) type and VECTOR_DISTANCE. No separate vector store needed.

Identity (read this first)

This targets the Azure SQL Database engine running locally in a container, NOT the SQL Server image. Confirm with:

SELECT SERVERPROPERTY('EngineEdition');  -- 5
SELECT SERVERPROPERTY('Edition');        -- 'SQL Azure'

If you were about to pull mcr.microsoft.com/mssql/server, stop: that is the wrong image. Use the image below instead.

  • Image: sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io/azure-sql/db-dev:latest (x64, linux/amd64; private preview registry, sign in first with docker login sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io). Registry and tag are provisional during Private Preview.
  • On a non-x64 host, add --platform linux/amd64.
  • For the full container lifecycle, readiness, and connection model, see the azuresql-db-container skill. The minimal facts you need are inlined below.

The three rules that bite (inlined from the hub)

  1. The engine does NOT auto-create databases on connect. You must CREATE DATABASE appdb on a master connection before connecting with Database=appdb.
  2. Avoid USE to switch databases. In a user-database session (the Azure-faithful context where you develop), USE returns Msg 40508, exactly as in Azure SQL Database in the cloud. A master connection is a provisioning provisioning session where the Azure statement filter is not enforced, so USE appears to work there, but master is for provisioning only, not application work. Always select the target database in the connection string (Database=appdb, or -d appdb for sqlcmd).
  3. A master connection is for provisioning only. Do real work on appdb.

Standard connection string (use User Id=/Password=/Database=, never Uid=/Pwd=):

Server=localhost,1433;Database=appdb;User Id=sa;Password=YourStr0ng_Passw0rd;TrustServerCertificate=true

Read the full file on GitHub · 235 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 235 lines · 186 tokens per session scan A 19fd806da41c

Subscribe to this mod's changes

azuresql-db-rag is a skill published in the GitHub repository microsoft/azure-sql-database-container (16 stars, last pushed yesterday), licensed MIT. It adds 186 tokens to every session and 2,897 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

cli-anything-chromadb

Command-line interface for ChromaDB - A stateless CLI for managing vector database collections, documents, and semantic search. Designed for AI agents and automation via the ChromaDB HTTP API v2.

HKUDS/CLI-Anything · 47 tokens

pgvector-semantic-search

Use this skill for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search. Trigger when user asks to: Store or search vector embeddings in PostgreSQL Set up semantic search, similarity search, or nearest neighbor search Create HNSW or IVFFlat indexes for vectors…

timescale/pg-aiguide · 190 tokens

postgres-hybrid-text-search

Use this skill to implement hybrid search combining BM25 keyword search with semantic vector search using Reciprocal Rank Fusion (RRF). Trigger when user asks to: Combine keyword and semantic search Implement hybrid search or multi-modal retrieval Use BM25/pgtextsearch with pgvector together Implement RRF (Reciprocal…

timescale/pg-aiguide · 162 tokens

byted-bytehouse-hybrid-search

ByteHouse 混合检索 Skill,支持全文检索 + 向量检索,结合 RRF 重排算法实现更精准的检索结果。当用户需要在ByteHouse数据库中进行全文检索 + 向量检索,结合 RRF 重排算法实现更精准的检索结果时,使用此Skill。.

bytedance/agentkit-samples · 79 tokens

digoal

Portable digital employee distilled from digoal's personal blog for PostgreSQL, PolarDB, DuckDB, AI+database, vector/RAG, database operations, source-code reading, technical content creation, open-source community strategy, and "德说" style strategic analysis. Use when asked to answer as 德哥/digoal, mine a local…

digoal/blog · 151 tokens

qdrant-clients-sdk

Qdrant provides client SDKs for various programming languages, allowing easy integration with Qdrant deployments.

qdrant/skills · 28 tokens