Overview
This node converts input text into embedding vectors using Amazon's Titan Text Embeddings models. It is designed to generate numerical vector representations of text, which are useful in various AI and machine learning applications such as semantic search, recommendation systems, natural language understanding, and clustering.
Typical use cases include:
- Transforming textual data into embeddings for similarity comparison.
- Preparing text inputs for downstream AI models that require vectorized inputs.
- Enhancing search relevance by indexing documents with their embeddings.
For example, you can input a product description and obtain its embedding vector to find similar products based on semantic content rather than exact keyword matches.
Properties
| Name | Meaning |
|---|---|
| Input Text | The text string to convert into an embedding vector. |
| Model | The embedding model to use. Options: "Titan Text Embeddings v2" or "Titan Text Embeddings v1". |
Output
The node outputs JSON data containing the original input fields plus the following additional fields:
embedding: An array of numbers representing the embedding vector generated from the input text._embeddingModel: The identifier of the embedding model used._embeddingDimension: The length (dimensionality) of the embedding vector._originalText: The original input text that was converted.
Example output JSON structure:
{
"inputText": "example text",
"embedding": [0.123, -0.456, ...],
"_embeddingModel": "amazon.titan-embed-text-v2:0",
"_embeddingDimension": 768,
"_originalText": "example text"
}
The node does not output binary data.
Dependencies
- Requires an AWS API key credential with permissions to access the Amazon Bedrock service.
- Uses the AWS SDK client for Bedrock Runtime to invoke the embedding model.
- The AWS region can be set via the environment variable
AWS_REGION; defaults tous-east-1if not set.
Troubleshooting
- Missing Input Text: If the input text is empty or only whitespace, the node throws an error stating "Input text is required." Ensure the input text property is populated.
- Embedding Extraction Failure: If the response from the embedding service does not contain a valid embedding array, an error "Failed to extract embedding from response" is thrown. This may indicate issues with the model invocation or service availability.
- Credential Issues: Errors related to AWS credentials typically mean the API key is missing, invalid, or lacks necessary permissions. Verify the configured AWS credentials.
- Region Configuration: If the AWS region is incorrect or not set, the node may fail to connect. Set the
AWS_REGIONenvironment variable appropriately.
The node supports continuing on failure if enabled, allowing partial processing of multiple items.