Google Generative AI Embeddings
This component lets you turn text into numerical vectors (embeddings) using Google’s Generative AI. These embeddings can be used for searching, clustering, or feeding into other AI models.
How it Works
When you add this component to your workflow, it connects to Google’s Gemini API.
- Credential – The component uses a Google Gemini API credential that you set up in Nappai’s credentials section.
- Model – You choose the model name (default is
models/text-embedding-004
). - Embedding – The component sends your text to Google, receives a 1536‑dimensional vector for each piece of text, and returns those vectors as the output.
The process is handled automatically; you only need to provide the text and the correct credential.
Inputs
This component requires a Google Gemini API credential.
- Configure the credential in Nappai’s Credentials section.
- Select that credential in the component’s Credential field.
Input Fields
- Model Name: The name of the Gemini model that will generate the embeddings.
The default value ismodels/text-embedding-004
. You can change it if you want to use a different model.
Outputs
- Embeddings: A list of numerical vectors (one vector per input text). These can be fed into a vector store, similarity search, or any other component that accepts embeddings.
Usage Example
-
Set up the credential
- Go to Credentials → Add Credential → choose Google Gemini API → enter your Google API Key.
- In the component, pick this credential from the Credential dropdown.
-
Configure the component
- Leave the Model Name as the default or change it to a different Gemini model.
- Connect the component’s Embeddings output to a Vector Store component.
-
Run the workflow
- The component will embed each piece of text you feed into it and store the resulting vectors in the vector store, ready for similarity search or other downstream tasks.
Related Components
- Vector Store – Store and retrieve embeddings for fast similarity queries.
- Similarity Search – Find the most similar items to a query vector.
- Google Gemini Chat – Generate conversational responses using Gemini; can use embeddings for context.
Tips and Best Practices
- Use the same model for all embeddings in a project to keep vector dimensions consistent.
- Batch size is limited to 100 texts per request; if you have more, let the component split them automatically.
- Keep the API key secure by storing it in Nappai’s credential manager and never hard‑coding it in your workflow.
- Monitor usage in the Google Cloud console to avoid unexpected charges.
Security Considerations
- The Google API Key is sensitive; store it only in Nappai’s credential manager.
- Ensure that only authorized users have access to the credential and the component.
- Review Google’s usage limits and billing to prevent accidental over‑use.