Registry / ai-ml / n8n-nodes-postgres-vector-store-tool

n8n-nodes-postgres-vector-store-tool

JSON →
library0.7.1jsnpmunverified

n8n community node for AI agent Postgres/pgvector vector store tool with vector search and custom SQL capabilities. Version 0.7.1 provides flexible querying beyond basic similarity search, supporting custom SQL mode for JOINs, filters, aggregation, row-level security, and hybrid search. Actively maintained on GitHub with TypeScript types included. Differentiates from built-in n8n Vector Store Tool by allowing full SQL control while still using embedding nodes.

npm install n8n-nodes-postgres-vector-store-tool
INSTALL
IMPORT
SIG · N8N-NODES-POSTGRES
N
n8n-nodes-postgres-vector-store-tool
ai-mljavascriptv0.7.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
✓ import PostgresVectorStoreTool from 'n8n-nodes-postgres-vector-store-tool'
✗ const PostgresVectorStoreTool = require('n8n-nodes-postgres-vector-store-tool')
ESM-only package; default export is the node class.
PostgresVectorStoreTool
✓ import { PostgresVectorStoreTool } from 'n8n-nodes-postgres-vector-store-tool'
✗ const { PostgresVectorStoreTool } = require('n8n-nodes-postgres-vector-store-tool')
Named export identical to default; also exported for TypeScript.
type PostgresVectorStoreToolOptions
✓ import type { PostgresVectorStoreToolOptions } from 'n8n-nodes-postgres-vector-store-tool'
✗ import { PostgresVectorStoreToolOptions } from 'n8n-nodes-postgres-vector-store-tool' (if using at runtime)
TypeScript type import only; not a runtime value.

Shows how to install and configure the Postgres Vector Store Tool in n8n, including both regular and custom SQL modes.

import PostgresVectorStoreTool from 'n8n-nodes-postgres-vector-store-tool'; // Register the node with n8n // In your n8n workflow, the node appears as 'Postgres Vector Store Tool' // Configure connection: host, port, database, user, password (use credentials in n8n) // Choose mode: // Regular Retrieval: set tableName, vectorColumnName, contentColumnName, metadataColumnName, topK // Custom SQL: provide SQL query with $1 placeholder for embedding vector // Example custom SQL: // SELECT content, metadata, 1 - (embedding <=> $1) AS similarity // FROM documents // WHERE user_id = 'user123' // ORDER BY embedding <=> $1 // LIMIT 10 // The embedding is automatically passed from the connected embedding node // Output is JSON array in the 'text' field: [{"text": "...", "metadata": {...}}]
Debug
Known issues
gotchaThe 'Execute Step' button does not work for AI Tool nodes in n8n. This is a platform limitation, not a bug.
fix
Use Chat Trigger and AI Agent to test; do not rely on Execute Step.
affects: all
gotchaCustom SQL mode requires the embedding vector as $1; misuse may cause runtime errors if the query doesn't include $1.
fix
Ensure your SQL includes $1 exactly once for the embedding.
affects: all
gotchaRegular Retrieval mode defaults assume column names 'embedding', 'text', 'metadata'; if your table uses different names, configure Options.
fix
Set vectorColumnName, contentColumnName, metadataColumnName in options to match your schema.
affects: all
deprecatedNo breaking changes reported yet; version <1.0 may introduce breaking changes.
fix
Pin version or update carefully; check changelog before upgrading.
affects: <1.0
Errors
Common errors & fixes
Error: Cannot find module 'n8n-nodes-postgres-vector-store-tool'
Package not installed or n8n custom node path not configured.
fix
Install via npm: npm install n8n-nodes-postgres-vector-store-tool. For manual install, use npm link or copy to ~/.n8n/custom.
Error: column "embedding" does not exist
Default column name 'embedding' does not match actual column name.
fix
Set the correct vector column name in node options (vectorColumnName).
Error: relation "documents" does not exist
Table name specified does not exist in database.
fix
Check table name spelling and schema (e.g., public.documents).
Error: operator does not exist: text <=> unknown
Custom SQL uses <=> operator without casting the vector parameter.
fix
Ensure $1 is cast to vector type: embedding <=> $1::vector
Upgrade
Version history
0.7.1latest on npm
Audit
Dependencies
n8n-workflowrequiredPeer dependency required for n8n node compatibility.
Agent activity
15 hits · last 30 days
node
8
Resources
n8n-nodes-postgres-vector-store-tool — npm install n8n-nodes-postgres-vector-store-tool · libregistry