Reference · Tools

Gemini Embeddings

Generate vector embeddings using Google Gemini embedding models.

Action AI v1

Gemini Embeddings turns text into a dense vector using Google's embedContent API, producing one embedding per input item in an output field you name. Task type matters: retrieval query, retrieval document, semantic similarity, classification and clustering each optimise the vector differently. Use it to build the index behind a semantic search, or to group similar tickets before routing them.

Node type
Action
Parameters
7
Outputs
Output, Error
Credentials
Google AI

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

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires Google AI credentials. See the Credentials Guide for setup instructions.

Parameters

ParameterTypeRequiredDefaultDescription
ModeloptionsNo(current default)The Gemini embedding model to use.
Options: the Gemini embedding models available to your workspace — pick one from the dropdown.
TextstringYesThe text to generate an embedding for. If empty, falls back to item.json.text. Supports expressions like {{ $json.chunk }}.
Task TypeoptionsNoRETRIEVAL_DOCUMENTThe 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)
TitlestringNoOptional title for the text. Only used when Task Type is RETRIEVAL_DOCUMENT. Supports expressions.
OptionscollectionNo{}Optional output settings.
— Response Field NamestringNoembeddingField name in the output JSON where the embedding vector will be placed.
Include InputbooleanNofalseWhether to include the original input item fields in the output alongside the embedding.
Max ConcurrencynumberNo10Maximum 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.

{
  "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:

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

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

{
  "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:

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

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes 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.

Frequently asked questions

Which task type should I pick?

Match it to the job: RETRIEVAL_DOCUMENT when embedding the corpus, RETRIEVAL_QUERY for the incoming search, and SEMANTIC_SIMILARITY, CLASSIFICATION or CLUSTERING for those tasks. Embedding documents and queries with the same type degrades retrieval quality.

Can I attach a title to a document?

Yes, for RETRIEVAL_DOCUMENT tasks. Supplying a title gives the model additional context about what the passage is, which generally improves the resulting vector for retrieval.

What does the node output?

A float vector per input item, written to a configurable output field. Failures route to the Error output, so one unembeddable item does not stop a batch part-way through an index build.

Does it embed one item at a time?

Yes — each input item produces one embedding call, so a large corpus is a large number of calls. Batch and rate-limit upstream if you are indexing thousands of documents.

Build with the Gemini Embeddings node

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need Google AI credentials first.

Open BusyBot

Last updated . Spotted something wrong? Tell us.