How to fix: Problem in node ‘Postgres PGVector Store‘

I’m building a workflow in n8n that extracts text from uploaded documents and sends it through the following flow:

  1. Extract and decode binary text.
  2. Split the text into smaller chunks using a Text Splitter.
  3. Generate embeddings using the “Embeddings Google Gemini2” node.
  4. Store the embeddings in a Postgres PGVector Store.

However, when the data reaches the Postgres PGVector Store node, I get this error:

Error inserting: vector must have at least 1 dimension


  1. Please check in logs if the embeddings were returned from your gemini embedding model, similar to the screenshot below:
  2. didn’t you by chance fiddle with multiple embedding models? Every model creates slightly different vector (differing in size), and n8n will create table for the embedding model you created first e.g. vector ( 1536). When you change embedding model and try to insert vector of different size, it won’t fit. I would drop (delete) the n8n_vectors table and try again.
1 Like
  1. my embedding show like this:

  1. I just removed n8n_vectors and executed flow again but the show still show the same

ok, so for whatever reason gemini vector response is invalid. Please compare to my response - it should be an array of arrays of decimal numbers. First, can you try using other embedding model?

This works for me (Check the example diagram in changed files) PostgreSQL with the PGvector extension for RAG: Added Docker Compose configuration by CodelineAtyab · Pull Request #33 · n8n-io/n8n-hosting · GitHub