Overview
This node generates vector embeddings using Google Gemini embedding models. It transforms input text into numerical vectors (embeddings) that capture semantic meaning, which can then be used for tasks like similarity search, clustering, classification, or retrieval in AI workflows.
Common scenarios where this node is beneficial include:
- Creating embeddings for documents to enable semantic search in a vector store.
- Generating query embeddings to find relevant documents based on semantic similarity.
- Using embeddings as features for machine learning tasks such as classification or clustering.
- Enhancing AI applications with custom dimensionality embeddings tailored to specific use cases.
For example, you might use this node to embed customer support tickets and then connect it to a vector database node to perform fast semantic search for similar issues.
Properties
| Name | Meaning |
|---|---|
| Connection Hint | Informational notice indicating the node can be connected to AI Vector Store nodes. |
| (Notice) | Reminder that different models use different embedding dimensionalities; users should ensure their vector store uses the same dimensionality. The default model uses 768-dimensional embeddings. |
| Model | The Google Gemini embedding model to use for generating embeddings. Users can specify any supported model name. |
| Options | Additional options to customize embedding generation: |
| - Dimensions | Number of dimensions for the output embeddings. Supported values: 256, 512, 768, 1024, 1536, 2048, 3072. Only supported by newer models since 2024. |
| - Task Type | The type of task the embedding will be used for, which can improve embedding quality. Options include: Classification, Clustering, Code Retrieval Query, Default (Unspecified), Fact Verification, Question Answering, Retrieval Document, Retrieval Query, Semantic Similarity. |
Output
The node outputs JSON data containing the generated embeddings as arrays of numbers representing the vector for each input text.
- For single inputs (queries), the output is a single array of numbers representing the embedding vector.
- For multiple inputs (documents), the output is an array of embedding vectors, one per input text.
The output JSON structure includes:
type: fixed string"embeddings".source: fixed string"google-gemini".info: metadata about the embedding including model name, dimensions, task type, and available methods.- The actual embedding vectors are numeric arrays under the response object returned by the node's methods.
No binary data output is produced by this node.
Dependencies
- Requires a valid API key credential for Google Generative Language API (referred generically as "an API key credential").
- The node makes HTTP POST requests to the Google Generative Language API endpoint for embeddings.
- No additional external dependencies beyond the configured Google API credentials and network access to Google's API endpoints.
Troubleshooting
- Missing API Key: If the Google API key is not provided or invalid, the node will throw an error indicating missing credentials. Ensure the API key is correctly set up in the node credentials.
- Unexpected Response Format: If the API response does not contain expected embedding data, an error will be thrown. This may indicate API changes or incorrect model names.
- Dimension Mismatch: If the requested embedding dimension does not match the returned embedding length, an error is raised. Verify that the chosen model supports the specified dimension.
- API Request Failures: Network issues or quota limits on the Google API may cause failures. Check API usage limits and network connectivity.
- Invalid Model Name: Using an unsupported or misspelled model name will result in errors from the API.