Embeddings

An embedding turns a piece of text into a list of numbers that captures its meaning. Two texts that mean similar things get similar numbers, so you can compare meaning directly instead of matching keywords. That is what powers semantic search, grouping related items, and spotting near-duplicates that are worded differently.

The Embeddings block generates those numbers using OpenAI, Google Gemini, Cohere, or Mistral. Pick a provider, pick one of its models, pass in text, and get a vector back — one vector per input, in the order you supplied them. You can embed a single string or a list of strings in one call.

Models differ in what they are good at and what they cost. text-embedding-3-small is the cost-efficient general choice, gemini-embedding-001 gives the highest retrieval quality, embed-v4.0 handles multilingual content, and codestral-embed is tuned for source code. Some models also let you trade vector size against quality, and some accept a task type so the vector is conditioned for how it will be used — the block only offers those controls for the models that actually support them.

Two things worth knowing before you build on it. Vectors are only comparable when they come from the same model at the same size, so changing either means re-embedding everything you intend to compare. And input longer than the model's limit is shortened to fit rather than rejected, with a warning in the run, so chunk long documents yourself when the tail matters.

Sim's knowledge bases embed separately, at a fixed vector width and from a smaller set of models. This block is for embedding text yourself inside a workflow.

Usage Instructions

Turn text into embedding vectors for semantic search, clustering, and similarity. Supports OpenAI, Google Gemini, Cohere, and Mistral embedding models.

Actions

OpenAI Embeddings

Generate embeddings from text using OpenAI's embedding models

Input

ParameterTypeRequiredDescription
inputstringYesText to embed, or an array of texts to embed in one call
modelstringNoEmbedding model to use
taskTypestringNoWhat the embedding is for, when the model supports task conditioning: document, query, similarity, classification, or clustering
dimensionsnumberNoOutput dimensions, when the model supports truncation. Defaults to native.
apiKeystringYesAPI key for the selected embedding provider

Output

ParameterTypeDescription
embeddingsjsonGenerated embeddings
modelstringModel used
providerstringProvider used
dimensionsnumberDimensionality of each vector
usagejsonToken usage

Gemini Embeddings

Generate embeddings from text using Google's Gemini embedding models

Input

ParameterTypeRequiredDescription
inputstringYesText to embed, or an array of texts to embed in one call
modelstringNoEmbedding model to use
taskTypestringNoWhat the embedding is for, when the model supports task conditioning: document, query, similarity, classification, or clustering
dimensionsnumberNoOutput dimensions, when the model supports truncation. Defaults to native.
apiKeystringYesAPI key for the selected embedding provider

Output

ParameterTypeDescription
embeddingsjsonGenerated embeddings
modelstringModel used
providerstringProvider used
dimensionsnumberDimensionality of each vector
usagejsonToken usage

Cohere Embeddings

Generate embeddings from text using Cohere's embedding models

Input

ParameterTypeRequiredDescription
inputstringYesText to embed, or an array of texts to embed in one call
modelstringNoEmbedding model to use
taskTypestringNoWhat the embedding is for, when the model supports task conditioning: document, query, similarity, classification, or clustering
dimensionsnumberNoOutput dimensions, when the model supports truncation. Defaults to native.
apiKeystringYesAPI key for the selected embedding provider

Output

ParameterTypeDescription
embeddingsjsonGenerated embeddings
modelstringModel used
providerstringProvider used
dimensionsnumberDimensionality of each vector
usagejsonToken usage

Mistral Embeddings

Generate embeddings from text using Mistral's embedding models

Input

ParameterTypeRequiredDescription
inputstringYesText to embed, or an array of texts to embed in one call
modelstringNoEmbedding model to use
taskTypestringNoWhat the embedding is for, when the model supports task conditioning: document, query, similarity, classification, or clustering
dimensionsnumberNoOutput dimensions, when the model supports truncation. Defaults to native.
apiKeystringYesAPI key for the selected embedding provider

Output

ParameterTypeDescription
embeddingsjsonGenerated embeddings
modelstringModel used
providerstringProvider used
dimensionsnumberDimensionality of each vector
usagejsonToken usage

On this page