tei-embeddings

Tei embeddings provider node for n8n AI integrations

Package Information

Downloads: 2 weeklyย /ย 10 monthly
Latest Version: 1.0.2
Author: 24auru&AgnimaGocran

Documentation

n8n Tei Embeddings Node

Version
Downloads

n8n Tei Embeddings Node - embedding provider for n8n AI nodes that proxies requests to your Tei embeddings service.

โœจ Features

  • ๐Ÿ’  Tei Embeddings sub-node - provides embeddings for AI models and Vector Store nodes
  • ๐Ÿ”Œ Custom API Integration - point the node to your Tei instance
  • ๐Ÿ“ก Single /embeddings POST endpoint - send one string or an array of strings via the input field
  • ๐Ÿ“Š Streaming-friendly output parsing - handles Tei list responses automatically
  • โš™๏ธ Configurable Host and Port through Credentials
  • ๐Ÿ“ Logging and Error Handling
  • ๐ŸŽจ Modern UI with conditional parameter display

๐ŸŽฏ Node Type

Tei Embeddings Node (Sub-node)

  • Purpose: Embedding provider for AI models and Vector Store nodes
  • Type: embedding (special type for n8n AI integration)
  • Inputs: None (sub-node)
  • Outputs: ai_embedding (for AI integration)
  • Method: supplyData() - provides embedding functionality to parent nodes

๐Ÿš€ Installation

For n8n 1.0+

  1. Install the package:

    npm install n8n-nodes-tei-embeddings
    
  2. Restart n8n

  3. Configure Credentials (see Credentials section below)

For Development

  1. Clone the repository:

    git clone https://github.com/AgnimaGocran/n8n-nodes-tei-embeddings.git
    cd n8n-nodes-tei-embeddings
    
  2. Install dependencies:

    npm install
    
  3. Build the project:

    npm run build
    

๐Ÿ”‘ Credentials

EmbeddingApi

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

Tei Embeddings Node

This node has no configurable parameters as it's designed to work as an embedding provider for other nodes.

๐Ÿ’ก Usage Examples

Example 1: Using the Tei Embeddings Node with a Vector Store

  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.

Example 2: Single Text Request to /embeddings

curl -X POST http://10.24.10.153:8081/embeddings \
  -H "Content-Type: application/json" \
  -d '{"input": "Hello, world!"}'

Response:

[
  {
    "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.

Example 3: Multiple Texts Request to /embeddings

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

Building the Project

# Install dependencies
npm install

# Build the project
npm run build

# Build with icon copying
npm run build

Project Architecture

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

POST /embeddings

Generates embeddings for one or more texts via the Tei service.

Request Body:

{
  "input": "Single text or an array of texts"
}

Response:

[
  {
    "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

API Testing

  1. Check API availability:

    curl -X GET http://10.24.10.153:8081/health
    
  2. Test embedding generation:

    curl -X POST http://10.24.10.153:8081/embeddings \
      -H "Content-Type: application/json" \
      -d '{"input": ["hello", "hi"]}'
    

Testing in n8n

  1. Create a new workflow
  2. Add "Tei Embeddings Node"
  3. Configure Credentials
  4. Test with simple text

๐Ÿ”ง Troubleshooting

Common Issues

  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

Logs

Enable logging in n8n for debugging:

n8n start --log-level debug

Useful Links

๐Ÿค Contributing

We welcome contributions to the project! Please:

  1. Fork the repository
  2. Create a branch for new feature
  3. Make changes
  4. Create Pull Request

๐Ÿ“„ License

MIT License - see LICENSE file for details.

โ€ Author

24auru - GitHub


Version: 0.1.2
Last Updated: December 2025

Discussion