Embeddings Google Vertex Extended (GKE WLI) icon

Embeddings Google Vertex Extended (GKE WLI)

Use Google Vertex AI Embeddings with output dimensions support

Overview

This node generates text embeddings using Google Vertex AI's embedding models, with extended support for specifying output dimensions. It is designed to convert input text into numerical vector representations that can be used in various AI and machine learning tasks such as semantic search, document retrieval, classification, clustering, and similarity comparisons.

Common scenarios where this node is beneficial include:

  • Creating vector representations of documents or queries for use in vector databases or AI-powered search engines.
  • Generating embeddings for downstream machine learning tasks like clustering or classification.
  • Enhancing natural language understanding by converting text into fixed-size numeric vectors.

Practical example:

  • You have a collection of customer feedback texts and want to find similar feedback entries quickly. This node can generate embeddings for each feedback text, which you then store in a vector database for fast similarity searches.

Properties

Name Meaning
Model Name The specific Google Vertex AI embedding model to use (e.g., text-embedding-004, text-multilingual-embedding-002). See Google Vertex AI Embeddings documentation.
Output Dimensions Number of dimensions for the output embeddings. Set to 0 to use the model's default dimensionality. Only supported by certain models like text-embedding-004.
Options Additional options including:
- Region: The geographic region where the model is deployed (default: us-central1).
- Task Type: The intended task for the embeddings, selectable from:
  • Retrieval Document
  • Retrieval Query
  • Semantic Similarity
  • Classification
  • Clustering

Output

The node outputs an object containing embeddings generated from the input text(s). The main output field is:

  • json: An array of numeric vectors representing the embeddings for each input text item. Each embedding corresponds to the input text transformed into a high-dimensional vector space suitable for AI tasks.

The node does not output binary data.

Dependencies

  • Requires access to Google Cloud services with appropriate authentication via an API key or OAuth token that grants permission to use Google Vertex AI.
  • Uses Google Auth Library to obtain access tokens for calling Google APIs.
  • Calls either an internal Vertex Gemini API endpoint or the official Google Vertex AI API endpoint depending on the model.
  • Requires network connectivity to Google Cloud endpoints or the internal Vertex Gemini service.

Troubleshooting

  • API Authentication Errors: If the node fails to authenticate, ensure that the provided API credentials have the necessary permissions and are correctly configured in n8n.
  • Model Not Found or Unsupported: Using an unsupported model name or one that does not support output dimension customization may cause errors. Verify the model name against Google’s documentation.
  • API Request Failures: Network issues or incorrect region settings can cause request failures. Confirm the region matches where your model is deployed.
  • Rate Limits or Quotas: Exceeding Google Cloud API quotas will result in errors. Monitor usage and apply for quota increases if needed.
  • Error Messages: The node surfaces errors from the Google Vertex AI API or the internal Vertex Gemini API with status codes and messages. Review these messages to identify issues such as invalid parameters or service unavailability.

Links and References

Discussion