VertexAI Embeddings
VertexAI Embeddings lets you turn text into numerical vectors that can be used for searching, clustering, or feeding into other AI models. It connects to Google Cloud’s Vertex AI service and returns a set of embeddings that represent the meaning of your input text.
How it Works
When you provide text, the component sends it to a Vertex AI embedding model (by default textembedding-gecko
). Vertex AI processes the text and returns a vector of numbers that captures its semantic content. The component can handle one piece of text at a time or many at once if you enable Mapping Mode. It also supports optional settings such as temperature, top‑k, and top‑p to fine‑tune the output.
Inputs
Mapping Mode
This component has a special mode called “Mapping Mode”. When you enable this mode using the toggle switch, an additional input called “Mapping Data” is activated, and each input field offers you three different ways to provide data:
- Fixed: You type the value directly into the field.
- Mapped: You connect the output of another component to use its result as the value.
- Javascript: You write Javascript code to dynamically calculate the value.
This flexibility allows you to create more dynamic and connected workflows.
Input Fields
- Credentials: JSON credentials file. Leave empty to fallback to environment variables
- Location: The Google Cloud region where Vertex AI is hosted (default:
us-central1
) - Mapping Mode: Enable mapping mode to process multiple data records in batch
- Max Output Tokens: Maximum number of tokens to return in the embeddings
- Max Retries: Number of times to retry the request if it fails
- Model Name: Name of the Vertex AI embedding model (default:
textembedding-gecko
) - N: Number of embeddings to generate per input text
- Project: The Google Cloud project ID
- Request Parallelism: How many requests to send in parallel when mapping multiple inputs
- Stop: Sequences that, if encountered, stop the generation early
- Streaming: Whether to stream the response back as it is generated
- Temperature: Controls randomness of the output (0.0 = deterministic)
- Top K: Limits the number of highest‑probability tokens considered
- Top P: Nucleus sampling probability threshold
Outputs
- Embeddings: A list of numerical vectors (Embeddings) that represent the input text. These can be used as inputs for similarity searches, clustering, or other downstream AI tasks.
Usage Example
- Add the VertexAI Embeddings component to your workflow.
- Upload your Google Cloud credentials file or leave the field empty if you have set the
GOOGLE_APPLICATION_CREDENTIALS
environment variable. - Set the Model Name to
textembedding-gecko
(or another supported model). - Connect the text input (e.g., a “Text” component that outputs a string).
- Run the workflow. The component will return an embeddings vector that you can feed into a similarity search or store in a vector database.
If you have many documents, enable Mapping Mode and connect a “List” component that outputs an array of texts. The VertexAI Embeddings component will automatically generate an embedding for each item in the list.
Related Components
- OpenAI Embeddings – Generates embeddings using OpenAI’s models.
- HuggingFace Embeddings – Uses Hugging Face transformer models for embeddings.
- Vector Store – Stores and queries embeddings in a vector database.
Tips and Best Practices
- Keep your credentials file secure; avoid sharing it publicly.
- Use Mapping Mode for batch processing to reduce API calls.
- Choose a model that balances speed and accuracy for your use case.
- Adjust
Max Output Tokens
andTemperature
to fine‑tune the embedding quality. - Monitor API usage to stay within your Google Cloud quota.
Security Considerations
- The Credentials file contains sensitive access keys. Store it in a secure location and restrict permissions.
- If you leave the credentials field empty, the component will use environment variables or the gcloud CLI credentials, which should also be protected.
- Avoid exposing the component’s output in public dashboards unless you have verified that the embeddings do not contain sensitive data.