workflows.fit
Back to n8n workflows
n8n templateFreeBy Taiwo Hassan

Sync PostgreSQL data to a Pinecone vector knowledge base using Gemini embeddings

PostgreSQL Auto-Discovery to Pinecone Vector Knowledge Base Turn existing PostgreSQL databases into AI-searchable Pinecone vector knowledge bases without manually defining every table and column. This template discove...

DevelopmentCore NodesData & StorageManual TriggerSchedule TriggerSetPostgres
Loading interactive preview...

Template notes

PostgreSQL Auto-Discovery to Pinecone Vector Knowledge Base

Turn existing PostgreSQL databases into AI-searchable Pinecone vector knowledge bases without manually defining every table and column.

This template discovers your PostgreSQL schema, selects text-rich tables, builds readable embedding documents from rows, generates Google Gemini embeddings, upserts vectors into Pinecone, and tracks per-table sync state for incremental indexing.

It also includes a companion semantic search webhook workflow that embeds a user query, queries Pinecone, and returns source row metadata for RAG and AI assistant use cases.

Features

- Dynamic PostgreSQL schema discovery using informationschema. - No hard-coded schema, table, or column names. - Primary key detection. - Timestamp column detection for incremental sync. - Text-rich column detection for embedding. - Default sensitive-column exclusion. - Configurable allowed schemas, allowed tables, excluded tables, excluded columns, and max rows per table. - Google Gemini embeddings with gemini-embedding-001. - Pinecone upsert using namespaces. - Per-table sync state stored in n8n workflow static data. - Fail-fast error behavior so PostgreSQL, Gemini, or Pinecone errors stop execution. - Companion semantic search webhook for testing RAG retrieval.

Architecture

The main workflow runs through these stages: