AI_EMBED

functiondeferredAI & ML

docs.snowflake.com ↗

String & binary functions

Creates an embedding vector from text or an image. Embeddings are abstract numerical representations of the features of a piece of text or an image that can be used to determine the degree of similarity between pieces of text or images, which can be used for semantic search, clustering, classification, and other tasks. The following table shows the regions where you can use the AI_EMBED function for text and images:

Syntax

AI_EMBED( <model> , <input> )

Parameters

NameRequiredDescription
modelrequiredA string specifying the vector embedding model to be used to generate an embedding. For text, you can provide the following values: snowflake-arctic-embed-l-v2.0 snowflake-arctic-embed-l-v2.0-8k nv-embed-qa-4 multilingual-e5-large voyage-multilingual-2 snowflake-arctic-embed-m-v1.5 snowflake-arctic-embed-m e5-base-v2 For images, you can provide only the following value: voyage-multimodal-3 Supported models might have different costs. Bring-your-own model: Open preview Alternatively, specify the name of a Snowpark Container Services model inference service that hosts your own sentence-transformer model. These services support text input only; FILE and PROMPT inputs aren’t supported. For prerequisites, availability, and access requirements, see Bring-your-own model for AI_EMBED.
inputrequiredThe string or image (as a FILE object) to generate an embedding from. Images must be: In JPEG, WEBP, PNG, or BMP format No more than 10 MB in size No more than 8,000 x 8,000 pixels

Returns

An embedding vector of type VECTOR derived from the input text or image.

Access control requirements

You must use a role that has been granted the SNOWFLAKE.CORTEX_USER database role or the SNOWFLAKE.CORTEX_EMBED_USER database role to call this function. See Cortex LLM privileges for more information on granting one of these privileges. For models deployed as Snowpark Container Services model inference services, see Access control requirements.

Limitations

- Snowflake AI functions don’t work on FILE objects created from files in the following kinds of stages: Internal stages with encryption mode TYPE = 'SNOWFLAKE_FULL' - External stages with any customer-side encrypted mode, such as AWS_CSE or AZURE_CSE. - User stage - Table stage - Stage with double-quoted names Note AI_EMBED is the updated version of EMBED_TEXT_1024 and EMBED_TEXT_768. For the latest functionality, use AI_EMBED.

Legal notices

Refer to Snowflake AI and ML.

Known gaps

Parts not fully supported, and recorded divergences from Snowflake.