QuestionQ8

Implement AI capabilities in database solutions

You have an Azure SQL database containing a table named dbo.Products. dbo.Products has three columns named Embedding, Category, and Price. The Embedding column is defined as VECTOR(1536).

You use AI_GENERATE_EMBEDDINGS and VECTOR_SEARCH to enable semantic search and apply additional filters to two columns named Category and Price.

You plan to change the embedding model from text-embedding-ada-002 to text-embedding-3-small. Existing rows already have embeddings in the Embedding column.

You need to implement the model change. Applications must be able to use VECTOR_SEARCH without runtime errors.

What should you do first?

Explanation

All persisted document embeddings must be regenerated with text-embedding-3-small before applications query with embeddings generated by that model. Similarity search requires stored vectors and query vectors from the same embedding model so that they represent the same semantic space. Both models support 1,536-dimensional output, so VECTOR(1536) remains compatible. Microsoft also recommends rebuilding a vector index after a near-complete embedding replacement, but indexing is not the first required action.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!