Tei embeddings provider node for n8n AI integrations
npm install n8n-nodes-tei-embeddings/embeddings POST endpoint - send one string or an array of strings via the input field
embedding (special type for n8n AI integration)
ai_embedding (for AI integration)
supplyData() - provides embedding functionality to parent nodes
bash
npm install n8n-nodes-tei-embeddings
`
2. Restart n8n
3. Configure Credentials (see Credentials section below)
$3
1. Clone the repository:
`bash
git clone https://github.com/AgnimaGocran/n8n-nodes-tei-embeddings.git
cd n8n-nodes-tei-embeddings
`
2. Install dependencies:
`bash
npm install
`
3. Build the project:
`bash
npm run build
`
๐ Credentials
$3
Configure connection to your API service:
- Host (required) - address of your API server (default: http://10.24.10.153)
- Port (required) - port of API server (default: 8081)
- API Key (optional) - key for authentication
๐ Node Parameters
$3
This node has no configurable parameters as it's designed to work as an embedding provider for other nodes.
๐ก Usage Examples
$3
1. Add a Vector Store node (e.g., Supabase Vector Store).
2. In the Vector Store node, look for the Embedding connection.
3. Select Tei Embeddings Node from the dropdown.
4. Configure your credentials.
5. The Vector Store will automatically use your Tei Embeddings service.
$3
`bash
curl -X POST http://10.24.10.153:8081/embeddings \
-H "Content-Type: application/json" \
-d '{"input": "Hello, world!"}'
`
Response:
`json
[
{
"object": "list",
"data": [
{
"object": "embedding",
"embedding": [
0.02621444,
-0.014602257,
-0.07529701,
-0.057053782,
0.07777279,
-0.03792118,
-0.003740206,
0.10274578,
0.07138724
],
"index": 0
}
],
"model": "intfloat/multilingual-e5-small",
"usage": {
"prompt_tokens": 4,
"total_tokens": 4
}
}
]
`
Embedding array truncated for brevity.
$3
`bash
curl -X POST http://10.24.10.153:8081/embeddings \
-H "Content-Type: application/json" \
-d '{"input": ["First document", "Second document"]}'
`
Response Highlights:
- The API returns a top-level array with object: "list" entries.
- Each entry contains a data array with embedding objects for each provided text.
- usage.prompt_tokens reflects the total tokens used for the batch.
๐๏ธ Project Structure
`
n8n-nodes-tei-embeddings/
โโโ nodes/
โ โโโ Embedding/ # Tei Embeddings sub-node
โ โโโ Embedding.node.ts # Sub-node implementation
โ โโโ embedding.svg # Node icon
โโโ credentials/
โ โโโ EmbeddingApi.credentials.ts # API credentials
โโโ dist/ # Compiled JavaScript files
โโโ examples/ # Usage examples
โโโ package.json # Project configuration
โโโ tsconfig.json # TypeScript configuration
โโโ README.md # This file
`
๐ง Development
$3
`bash
Install dependencies
npm install
Build the project
npm run build
Build with icon copying
npm run build
`
$3
The project centers around a single Tei Embeddings node that implements the INodeType interface with type: 'embedding'. The node provides its embedding implementation through supplyData() so it can be reused by AI and Vector Store nodes without additional configuration.
API Endpoint
$3
Generates embeddings for one or more texts via the Tei service.
Request Body:
`json
{
"input": "Single text or an array of texts"
}
`
Response:
`json
[
{
"object": "list",
"data": [
{
"object": "embedding",
"embedding": [0.026, -0.014, -0.075, -0.057, 0.077],
"index": 0
}
],
"model": "intfloat/multilingual-e5-small",
"usage": {
"prompt_tokens": 4,
"total_tokens": 4
}
}
]
`
Embedding array truncated for brevity.
๐งช Testing
$3
1. Check API availability:
`bash
curl -X GET http://10.24.10.153:8081/health
`
2. Test embedding generation:
`bash
curl -X POST http://10.24.10.153:8081/embeddings \
-H "Content-Type: application/json" \
-d '{"input": ["hello", "hi"]}'
`
$3
1. Create a new workflow
2. Add "Tei Embeddings Node"
3. Configure Credentials
4. Test with simple text
๐ง Troubleshooting
$3
1. "Host and port are required"
- Check Credentials settings
- Ensure Host and Port are specified
2. "Connection refused"
- Check API server availability
- Ensure port is open
3. "Invalid response from API"
- Check API response format
- Ensure API returns correct structure
$3
Enable logging in n8n for debugging:
`bash
n8n start --log-level debug
``