- Home
- Resources
- Integrations
- Postgres PGVector Store
n8n Postgres PGVector Store nodeConfigure Postgres PGVector Store in n8n.
Your embeddings can live in the same Postgres database as the rest of your data. The n8n Postgres PGVector Store node writes documents into a PGVector table, reads ranked matches back, and hands that table to an AI agent as a tool. Two parameters, four modes.
Verified Trustpilot reviews · AI, automation & growth agency
What does the n8n Postgres PGVector Store node do?
PGVector is an extension of Postgresql, and this node is how n8n talks to the PGVector tables in that database. It inserts documents into a vector table, gets ranked documents back for a query, or exposes the table so a chain or an agent can read it. A vector table stores text next to its numeric representation, which is what makes similarity search possible.
The first pattern is the plain one. You place the node in the regular flow of a workflow, pick Insert Documents, and every item that reaches it lands in the table you named. Nothing else is involved: no agent, no chat. It is the ingestion half of a knowledge base, and you usually run it once per new document rather than on a schedule.
The second pattern answers questions. With Get Many, the node takes a search prompt and returns the best matching documents, ranked by similarity. Set Limit to 10 and you get the ten best rows. That output feeds whatever comes next, a summary step or a message sent through Slack.
The third pattern gives the table to an assistant. Retrieve Documents (As Tool for AI Agent) turns the store into a tool that an AI Agent can call on its own, using the Name and Description you write. A tool here is an add-on resource the model consults when it needs facts it does not have. The alternative shape, Retrieve Documents (As Vector Store for Chain/Tool), plugs into a Vector Store Retriever feeding a Question and Answer Chain, or into a Vector Store Question Answer Tool that summarizes results before the agent sees them.
When do you reach for something else? If you never query your documents by meaning, a vector table is the wrong tool and a normal Postgres table does the job. Documents still need to be turned into vectors before they are stored, so the model provider you choose, OpenAI or Google Gemini for instance, bills those API calls under its own terms while n8n adds nothing.
The known limits are worth stating plainly. This node has no trigger: something else has to start the workflow. It runs at version 1, and an older workflow may show fewer options. The page for the n8n review covers the platform side of the decision.
How do you connect n8n to your PGVector database?
- 01
Create the Postgres credential
Open the Credentials menu and add the Postgres credential: Host, Database, User, Password, Port, an SSL mode (Allow, Disable or Require) and an Ignore SSL Issues toggle. Create it once and reuse it in every workflow that touches the same database, so a password rotation is a single edit.
- 02
Point the node at a table
Fill in Table Name with the PGVector table you want to work in. If that table does not exist yet, the node creates it, which is convenient the first time and unforgiving later: a misspelling gives you a brand new empty table instead of an error. Type the name once, then reuse the same value across the insert workflow and the query workflow.
- 03
Pick the mode and run one item
Set Operation Mode to match what this copy of the node is for, then execute the workflow on a single item. Insert Documents shows you rows arriving. Get Many with a short Prompt shows you whether anything comes back ranked. Doing this before you wire the node to an agent keeps the debugging in one place instead of hidden behind a model call.
Which parameters does the node expose?
The Postgres PGVector Store node has 2 parameters. For each one: the node as you configure it in n8n, what the parameter changes, and our field notes.
Parameters index
Operation Mode
modeWhat you see in n8n
Notes & use cases
This selector decides what the node does with the table, and which fields appear below.
Key parameters
- Operation Mode:
insert(Insert Documents) writes documents in,load(Get Many) returns ranked documents for a query,retrieve(Retrieve Documents (As Vector Store for Chain/Tool)) exposes the store to AI nodes,retrieve-as-tool(Retrieve Documents (As Tool for AI Agent)) exposes it as a tool. - Prompt: required in Get Many, the search text ranked against the stored documents, often
{{ $json.question }}from the previous node. - Limit: how many top results come back.
- Name and Description: required in tool mode, they tell the model what the store holds.
insert for ingestion, another in load for questions.Table Name
tableNameWhat you see in n8n
Notes & use cases
Names the table the vectors are stored in. Every mode reads this field, and the node creates the table when it does not exist yet.
Key parameters
- Table Name: the PGVector table to store the vectors in, typed as a plain string or taken from the item with an expression such as
{{ $json.table }}when one workflow serves several datasets.
Need help automating Postgres PGVector Store with n8n?
A person reads every message.
Postgres PGVector Store and n8n: common questions
01Is the Postgres PGVector Store node included in n8n?
02What do you need for it to work?
03What are the limits of the node?
04What do you plug into the n8n Postgres PGVector Store node to start?
05n8n or Make for a PGVector knowledge base?
Get our weekly integration tips.
No spam. Unsubscribe anytime.


