documentdb-vector-search
Skill6 starsChanged 7 months agoMITView on GitHub
Vector search best practices for Azure DocumentDB using `cosmosSearch` — choosing between DiskANN / HNSW / IVF, creating indexes, tuning `lBuild` / `lSearch` / `maxDegree`, Product Quantization (up to 16,000 dims), half-precision (fp16) indexing, and normalizing embeddings for cosine similarity. Use when building RAG / semantic-search applications, creating a vector index, tuning recall/latency, or reducing vector-index memory footprint.
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- documentdb-azure-deploymentSkill
- documentdb-connectionSkill
- documentdb-data-modelingSkill
- documentdb-driverSkill
- documentdb-full-text-searchSkill
- documentdb-high-availabilitySkill
- documentdb-indexingSkill
- documentdb-local-deploymentSkill
- documentdb-mcp-setupSkill
- documentdb-monitoringSkill
- documentdb-natural-language-queryingSkill
- documentdb-query-optimizationSkill
- documentdb-query-optimizerSkill
- documentdb-securitySkill
- documentdb-shardingSkill
- documentdb-storageSkill
The file
Files
Vector Search — Azure DocumentDB (cosmosSearch)
Azure DocumentDB's native vector index type is cosmosSearch. Pick the sub-type by scale:
| Index sub-type | Scale sweet spot | Tier |
vector-diskann (recommended) | Up to 500k+ vectors | M30+ |
vector-hnsw | Up to ~50k vectors | M30+ |
vector-ivf | Under ~10k vectors | M10+ |
Similarity options: COS (cosine), L2 (Euclidean), IP (inner product).
Rules
- vector-choose-index-type — Prefer DiskANN for production; use HNSW up to 50k, IVF under 10k.
- vector-create-diskann-index — Create a
vector-diskannindex with correctdimensions,similarity,maxDegree, andlBuild. - vector-knn-query — Query with
$search+cosmosSearch; tunelSearchandk; combine with pre-filters. - vector-product-quantization — Shrink high-dimensional vectors (up to 16,000 dims) while preserving recall.
- vector-half-precision — Halve vector memory with fp16 indexing and minimal recall loss.
- vector-normalize-embeddings — Normalize embeddings when using cosine similarity; store model + dimensions alongside vectors.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

