Skill 2.1.3
Store and retrieve embeddings and execute vector similarity search for semantic retrieval
Key Concepts
Vector search is enabled on the account with the EnableNoSQLVectorSearch capability. Each container that stores vectors has a vector embedding policy naming the path, data type (float32, float16, int8 or uint8), dimensions and distance function (cosine, the default, dot product or Euclidean), and an indexing policy with a vector index. A flat index gives exact results up to 505 dimensions; quantizedFlat and diskANN handle up to 4,096 dimensions and need at least 1,000 vectors to take effect. The vector path is excluded from the regular index.
A query computes similarity with the VectorDistance system function and must use TOP N, for example SELECT TOP 5 c.title, VectorDistance(c.embedding, @q) AS score FROM c ORDER BY VectorDistance(c.embedding, @q), where @q is the query embedding produced by the same model as the stored embeddings. A WHERE clause or partition key narrows the candidates, which improves both relevance and cost.