Overview
This node, named "Custom Embeddings," generates vector embeddings for text data by sending the input to a custom embedding server. It is designed to transform textual queries or documents into numerical vectors that can be used in various AI and machine learning applications such as semantic search, recommendation systems, or clustering.
Typical use cases include:
- Converting user queries into embeddings for similarity matching.
- Generating embeddings for documents to enable content-based retrieval.
- Integrating with custom embedding models hosted on a private API endpoint.
For example, you might input a sentence or paragraph, and the node will return its corresponding embedding vector from your custom embedding service.
Properties
| Name | Meaning |
|---|---|
| Node Type | Fixed hidden property set to "embedding" indicating the node's function type |
Output
The node outputs data on the ai_embedding output channel. The main output field is:
json: An array of embedding vectors (arrays of numbers). Each vector corresponds to an input text item processed by the node.
If multiple texts are embedded at once, the output will contain multiple embedding vectors in order.
No binary data output is produced by this node.
Dependencies
Requires access to a custom embedding API endpoint specified by:
- An API URL
- An API key credential for authorization
The node sends POST requests with JSON payloads containing the text to embed to the
/processpath of the API URL.The API response must return embedding vectors either as:
- An array of objects each containing an
embeddingarray, or - A direct array of numbers representing the embedding.
- An array of objects each containing an
The node depends on n8n's HTTP request helper and logging utilities.
Troubleshooting
Common issues:
- Incorrect API URL or missing/invalid API key will cause authentication or connection errors.
- Unexpected API response format may lead to failure in extracting embeddings.
- Network timeouts or server errors from the custom embedding service.
Error messages:
"Failed to generate embeddings: <error message>"indicates the node could not retrieve or parse embeddings from the API. Check API availability, credentials, and response format.- Logs include detailed info about which method was called and any error messages returned by the API.
Resolution tips:
- Verify the API URL and key are correctly configured in the node credentials.
- Ensure the custom embedding server conforms to the expected request and response structure.
- Review network connectivity and server logs if available.