<!-- BusyBot node reference — https://busybot.net/tools/gemini-embeddings/ -->

> Node: Gemini Embeddings (`gemini_embeddings`) · Action · v1
> Category: AI · Credentials: Google AI (`googleAi`)
> Updated: 2026-08-16

# Gemini Embeddings

> Generate vector embeddings using Google Gemini embedding models.

## Overview

Gemini Embeddings uses the embedContent API to generate dense vector representations of text via Google AI. Supports the Gemini embedding models with configurable task types (RETRIEVAL_QUERY, RETRIEVAL_DOCUMENT, SEMANTIC_SIMILARITY, CLASSIFICATION, CLUSTERING). Optionally accepts a title for RETRIEVAL_DOCUMENT tasks. Each input item produces a float embedding vector placed in a configurable output field.

**Category:** AI  
**Tool Name:** `gemini_embeddings`  
**Version:** 1

**Appearance:** Icon: `gemini` | Color: `#ffffff`

## Node Type

**Action** — processes input items and produces output

## Input / Output

| Direction | Port(s) |
|-----------|--------|
| Input | `Input` |
| Output | `Output`, `Error` |

## Credentials

This tool requires **Google AI** credentials.
See the [Credentials Guide](https://busybot.net/credentials/google-ai/) for setup instructions.

### Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Model | `options` | No | (current default) | The Gemini embedding model to use. |
| | | | | Options: the Gemini embedding models available to your workspace — pick one from the dropdown. |
| Text | `string` | Yes | — | The text to generate an embedding for. If empty, falls back to item.json.text. Supports expressions like {{ $json.chunk }}. |
| Task Type | `options` | No | `RETRIEVAL_DOCUMENT` | The downstream task type to optimize the embedding for. |
| | | | | Options: `RETRIEVAL_QUERY` (optimize for search query matching), `RETRIEVAL_DOCUMENT` (optimize for document indexing), `SEMANTIC_SIMILARITY` (optimize for comparing text similarity), `CLASSIFICATION` (optimize for text classification tasks), `CLUSTERING` (optimize for grouping similar texts) |
| Title | `string` | No | — | Optional title for the text. Only used when Task Type is RETRIEVAL_DOCUMENT. Supports expressions. |
| Options | `collection` | No | `{}` | Optional output settings. |
| — Response Field Name | `string` | No | `embedding` | Field name in the output JSON where the embedding vector will be placed. |
| Include Input | `boolean` | No | `false` | Whether to include the original input item fields in the output alongside the embedding. |
| Max Concurrency | `number` | No | `10` | Maximum number of items to process concurrently. |

## Output Data

One embedding per input item, and one output item per input item. The vector lands on the field named by **Response Field Name** (`embedding` by default), with `model` beside it. The rest of the input item JSON is dropped unless **Include Input** is on; binary data on the input item is forwarded unchanged.

```json
{
  "embedding": [0.0123, -0.0456, 0.0789],
  "model": "the embedding model that was used"
}
```

- The vector is a plain array of floats at the model's native length. Nothing else about the call is returned — there is no usage block on this node.
- Turn **Include Input** on when you are writing vectors to a store and need the source text or an ID to travel with them.
- Index and query with matching task types: embed your corpus with `RETRIEVAL_DOCUMENT` and the incoming question with `RETRIEVAL_QUERY`. Vectors written under mismatched task types still compare, but retrieval quality drops.

Reference the result downstream by expression, e.g. `{{ $json.embedding }}`.

## Usage Examples

- Generate embeddings for document chunks using Gemini
- Embed search queries with RETRIEVAL_QUERY task type
- Create document embeddings with title metadata
- Vectorize text for semantic similarity comparison
- Embed content for classification downstream tasks

## Example Configuration

Embed the text field of each incoming item for indexing:

```json
{
  "type": "gemini_embeddings",
  "parameters": {
    "text": "{{ $json.text }}",
    "taskType": "RETRIEVAL_DOCUMENT"
  }
}
```

Index document chunks with a title, keeping the source fields for the vector store:

```json
{
  "type": "gemini_embeddings",
  "parameters": {
    "text": "{{ $json.chunkText }}",
    "taskType": "RETRIEVAL_DOCUMENT",
    "title": "{{ $json.documentTitle }}",
    "includeInput": true,
    "maxConcurrency": 10
  }
}
```

Embed an incoming question before a similarity lookup, under a field name the store expects:

```json
{
  "type": "gemini_embeddings",
  "parameters": {
    "text": "{{ $json.userQuestion }}",
    "taskType": "RETRIEVAL_QUERY",
    "options": {
      "responseFieldName": "queryVector"
    }
  }
}
```

### Error Handling

| Mode | Behavior |
|------|----------|
| **stop** | Halts workflow on first error |
| **continue** | Skips failed items, passes successful ones through |
| **errorPort** | Routes failed items to Error output port |

## Tips

Gemini Embeddings converts text into dense vector representations using a Google AI Gemini embedding model via the embedContent API. Use this tool when your workflow requires semantic search, document retrieval, similarity ranking, classification, or clustering and needs text transformed into a numerically comparable format. Each input item produces a float embedding vector placed in a configurable output field, with processing failures routed to the error output.