Overview
This node integrates with the Voyage AI service to generate vector embeddings from text documents. Embeddings are numerical representations of text that capture semantic meaning, useful for tasks like search, recommendation, clustering, and natural language understanding.
Common scenarios include:
- Converting large sets of documents into embeddings for similarity search.
- Generating query embeddings to find relevant documents in a database.
- Using domain-specific models (e.g., finance, law, code) to create more accurate embeddings tailored to specialized content.
For example, you could input customer support tickets and generate embeddings to cluster similar issues or build a semantic search engine over your knowledge base.
Properties
Name | Meaning |
---|---|
Model | The specific Voyage AI model to use for generating embeddings. Options: voyage-3, voyage-3-large, voyage-3-lite, voyage-code-2, voyage-code-3, voyage-finance-2, voyage-law-2, voyage-multilingual-2 |
Options | Additional configuration options: |
Base URL | Override the default API base URL (default: https://api.voyageai.com/v1) |
Batch Size | Maximum number of documents sent per request (max 2048, default 512) |
Dimensions | Number of dimensions for the embeddings vector. Supported values: 256, 512, 1024, 2048 (only some models support this) |
Strip New Lines | Whether to remove new line characters from input text before embedding (default: true) |
Timeout | Maximum time allowed for each API request in seconds (-1 means no timeout) |
Output
The node outputs an ai_embedding
output containing the generated embeddings in JSON format. Each embedding is a numeric vector representing the semantic content of the input text.
If binary data were supported, it would typically represent serialized embeddings or related metadata, but this node focuses on JSON embeddings only.
Dependencies
- Requires an API key credential for the Voyage AI service.
- By default, connects to the Voyage AI API at
https://api.voyageai.com/v1
, but this can be overridden via the "Base URL" option. - Uses the
@langchain/community/embeddings/voyage
library internally to interact with the API.
Troubleshooting
- API Authentication Errors: Ensure the provided API key credential is valid and has permissions to access the Voyage AI embeddings endpoint.
- Timeouts: If requests take too long, adjust the "Timeout" property or check network connectivity.
- Unsupported Dimensions: Some models do not support all embedding dimension sizes; verify compatibility when changing the "Dimensions" option.
- Batch Size Limits: Sending too many documents in one batch may cause errors; reduce the batch size if encountering request failures.
- Input Formatting: If embeddings seem off, try toggling "Strip New Lines" to clean input text.
Links and References
- Voyage AI Documentation
- LangChain Community - Voyage Embeddings (for underlying library reference)