# Embeddings (/integrations/embeddings)



{/* MANUAL-CONTENT-START:intro */}

An embedding represents text as a numeric vector. Compare vectors to search by meaning, group related text, or find near-duplicates.

The Embeddings block accepts a string or list of strings and returns one vector per input in the same order. Choose OpenAI, Google Gemini, Cohere, Mistral, OpenRouter, or an embedding model on your Ollama server. Dimension and task-type controls appear only for supported models.

## Input and model limits [#input-and-model-limits]

Compare vectors from the same model at the same size. Changing either requires re-embedding the text you intend to compare.

The block accepts at most 1,000 non-empty texts and 1,000,000 total characters per call. Provider model limits also apply. Text that exceeds the selected model's token limit is truncated with a server-log warning; chunk long documents before embedding when the full content matters.

## Ollama [#ollama]

Ollama requires no API key and adds no hosted embedding-provider charge. Your deployment's workflow billing still applies where enabled. Configure `OLLAMA_URL` to point to a server Sim can reach. Self-hosted Sim can use its local default; hosted Sim requires an explicitly configured server and returns an empty model list when none is configured.

The model picker reads installed models and filters out those reporting no embedding capability. When available, it shows the reported vector width. Older Ollama servers may list chat models or omit widths, but execution still requires an embedding-capable model with a reported width. Upgrade Ollama or select another model if width validation fails.

Ollama has no task-type or dimension control in this block. Sim uses the model's reported width; support for dimension overrides varies across Ollama versions and models.

## Knowledge base embeddings [#knowledge-base-embeddings]

Knowledge bases embed separately. Each base fixes an embedding model and vector width at creation from the supported knowledge base catalog. Use this block when a workflow needs to generate vectors itself.

{/* MANUAL-CONTENT-END */}

## Use the block [#usage-instructions]

Turn text into embedding vectors for semantic search, clustering, and similarity. Supports OpenAI, OpenRouter, Google Gemini, Cohere, and Mistral embedding models, plus embedding models on a self-hosted Ollama.

## Actions [#actions]

### OpenAI Embeddings [#openai-embeddings]

Generate embeddings from text using OpenAI's embedding models

#### Input [#input]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `input` | string | Yes | Text to embed, or an array of texts to embed in one call |
| `model` | string | No | Embedding model to use |
| `taskType` | string | No | What the embedding is for, when the model supports task conditioning: document, query, similarity, classification, or clustering |
| `dimensions` | number | No | Output dimensions, when the model supports truncation. Defaults to native. |
| `apiKey` | string | Yes | API key for the selected embedding provider |

#### Output [#output]

| Parameter | Type | Description |
| - | - | - |
| `embeddings` | json | Generated embedding vectors, one per input, in input order |
| `model` | string | Model used |
| `provider` | string | Provider used |
| `dimensions` | number | Dimensionality of each returned vector |
| `usage` | json | Token usage |
| ↳ `prompt_tokens` | number | Tokens in the input |
| ↳ `total_tokens` | number | Total tokens billed |

### OpenRouter Embeddings [#openrouter-embeddings]

Generate embeddings through OpenRouter

#### Input [#input-1]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `input` | string | Yes | Text to embed, or an array of texts to embed in one call |
| `model` | string | No | Embedding model to use |
| `taskType` | string | No | What the embedding is for, when the model supports task conditioning: document, query, similarity, classification, or clustering |
| `dimensions` | number | No | Output dimensions, when the model supports truncation. Defaults to native. |
| `apiKey` | string | Yes | API key for the selected embedding provider |

#### Output [#output-1]

| Parameter | Type | Description |
| - | - | - |
| `embeddings` | json | Generated embedding vectors, one per input, in input order |
| `model` | string | Model used |
| `provider` | string | Provider used |
| `dimensions` | number | Dimensionality of each returned vector |
| `usage` | json | Token usage |
| ↳ `prompt_tokens` | number | Tokens in the input |
| ↳ `total_tokens` | number | Total tokens billed |

### Gemini Embeddings [#gemini-embeddings]

Generate embeddings from text using Google's Gemini embedding models

#### Input [#input-2]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `input` | string | Yes | Text to embed, or an array of texts to embed in one call |
| `model` | string | No | Embedding model to use |
| `taskType` | string | No | What the embedding is for, when the model supports task conditioning: document, query, similarity, classification, or clustering |
| `dimensions` | number | No | Output dimensions, when the model supports truncation. Defaults to native. |
| `apiKey` | string | Yes | API key for the selected embedding provider |

#### Output [#output-2]

| Parameter | Type | Description |
| - | - | - |
| `embeddings` | json | Generated embedding vectors, one per input, in input order |
| `model` | string | Model used |
| `provider` | string | Provider used |
| `dimensions` | number | Dimensionality of each returned vector |
| `usage` | json | Token usage |
| ↳ `prompt_tokens` | number | Tokens in the input |
| ↳ `total_tokens` | number | Total tokens billed |

### Cohere Embeddings [#cohere-embeddings]

Generate embeddings from text using Cohere's embedding models

#### Input [#input-3]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `input` | string | Yes | Text to embed, or an array of texts to embed in one call |
| `model` | string | No | Embedding model to use |
| `taskType` | string | No | What the embedding is for, when the model supports task conditioning: document, query, similarity, classification, or clustering |
| `dimensions` | number | No | Output dimensions, when the model supports truncation. Defaults to native. |
| `apiKey` | string | Yes | API key for the selected embedding provider |

#### Output [#output-3]

| Parameter | Type | Description |
| - | - | - |
| `embeddings` | json | Generated embedding vectors, one per input, in input order |
| `model` | string | Model used |
| `provider` | string | Provider used |
| `dimensions` | number | Dimensionality of each returned vector |
| `usage` | json | Token usage |
| ↳ `prompt_tokens` | number | Tokens in the input |
| ↳ `total_tokens` | number | Total tokens billed |

### Mistral Embeddings [#mistral-embeddings]

Generate embeddings from text using Mistral's embedding models

#### Input [#input-4]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `input` | string | Yes | Text to embed, or an array of texts to embed in one call |
| `model` | string | No | Embedding model to use |
| `taskType` | string | No | What the embedding is for, when the model supports task conditioning: document, query, similarity, classification, or clustering |
| `dimensions` | number | No | Output dimensions, when the model supports truncation. Defaults to native. |
| `apiKey` | string | Yes | API key for the selected embedding provider |

#### Output [#output-4]

| Parameter | Type | Description |
| - | - | - |
| `embeddings` | json | Generated embedding vectors, one per input, in input order |
| `model` | string | Model used |
| `provider` | string | Provider used |
| `dimensions` | number | Dimensionality of each returned vector |
| `usage` | json | Token usage |
| ↳ `prompt_tokens` | number | Tokens in the input |
| ↳ `total_tokens` | number | Total tokens billed |

### Ollama Embeddings [#ollama-embeddings]

Generate embeddings on a self-hosted Ollama server

#### Input [#input-5]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `input` | string | Yes | Text to embed, or an array of texts to embed in one call |
| `model` | string | Yes | Embedding model pulled on the configured Ollama server |

#### Output [#output-5]

| Parameter | Type | Description |
| - | - | - |
| `embeddings` | json | Generated embedding vectors, one per input, in input order |
| `model` | string | Model used |
| `provider` | string | Provider used |
| `dimensions` | number | Dimensionality of each returned vector |
| `usage` | json | Token usage |
| ↳ `prompt_tokens` | number | Tokens in the input |
| ↳ `total_tokens` | number | Total tokens billed |
