Skip to content

PGVector Store Node: Error inserting expected 1024 dimensions, not 256 when using self-hosted embedding model #21601

Description

@BillRaymond

Bug Description

I’m running a RAG workflow in self-hosted n8n and consistently receive this error from the Postgres PGVector Store node:

Error inserting: expected 1024 dimensions, not 256

My setup:

  • n8n self-hosted (v1.118.1)
  • Postgres 18 with pgvector extension
  • chunks table embedding column: vector(1024)
  • Embedding model: text-embedding-bge-m3 (running via LM Studio using OpenAI compatibility)
  • n8n node: Embeddings OpenAI (connected to LM Studio)
  • Dimensions explicitly set to 1024

Confirmed that:

  • The embedding output array has exactly 1024 floats (verified with length in a Function node)
  • Postgres column is vector(1024)
  • Yet n8n throws expected 1024, not 256 during insert.

Also confirmed that a basic HTTP POST will return a 1024 vector:

curl -X POST "http://my-lm-studio-server-using-openai-compatibility/v1/embeddings" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "text-embedding-bge-m3",
    "input": "My text to embed"
  }'

To Reproduce

  1. Create a Postgres (with PGVector) table that contains a field with an embedding vector (1024).
  2. Create a workflow that starts with a Set fields node and contains some text you want to embed. Output it as data
  3. Connect a Postgres PGVector Store node to the Set fields node
  • Credential to connect with: your-postgres-with-vector-database-connection
  • Operation mode: Insert Documents
  • Table name: the table you created in Step 1
  • Embedding batch size: 200 (default)
  1. Connect the Postgres PGVector Store node to Embeddings OpenAI (Embeddings)
  • Credential to connect with: An LM Studio server, which by default is compatible with OpenAI APIs
  • Model: text-embedding-bge-m3
  • Dimensions: 1024
  1. Connect the Postgres PGVector Store node to Default Data Loader (Document)
  • Type of data: JSON
  • Mode: Load Specific Data
  • Data: Text data from a previous node you want to embed
  • Text splitting: Custom
  1. Connect the Default Data Loader to the Token Splitter node
  • Chunk size: 800
  • Chunk overlap: 100
  1. Execute the workflow

Error: Problem in node ‘Postgres PGVector Store‘
Error inserting: expected 1024 dimensions, not 256

Refer to the Bug Description to note that a standard CURL POST test yields a 1024-dimensional response from the same endpoint, which is why I believe this to be an n8n bug.

Image Image

Expected behavior

The text embedding returns a 1024-dimensional response, just as with a standard POST event to the same URL.

Debug Info

Debug info

core

  • n8nVersion: 1.118.1
  • platform: docker (self-hosted)
  • nodeJsVersion: 22.21.0
  • nodeEnv: production
  • database: sqlite
  • executionMode: regular
  • concurrency: -1
  • license: enterprise (production)
  • consumerId: be538b36-658e-435e-8683-d734f810c123

storage

  • success: all
  • error: all
  • progress: false
  • manual: true
  • binaryMode: memory

pruning

  • enabled: true
  • maxAge: 336 hours
  • maxCount: 10000 executions

client

  • userAgent: mozilla/5.0 (macintosh; intel mac os x 10_15_7) applewebkit/537.36 (khtml, like gecko) chrome/142.0.0.0 safari/537.36
  • isTouchDevice: false

Generated at: 2025-11-06T00:33:00.432Z

Operating System

Debian GNU/Linux 13 (trixie)

n8n Version

1.118.1

Node.js Version

2.21.0

Database

SQLite (default)

Execution mode

main (default)

Hosting

self hosted

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions