Company RAG and data queries

Notion to Supabase pgvector live RAG synchronisation workflow

Short answer

This n8n workflow maintains a live RAG knowledge base for teams storing internal documentation in Notion. Whenever a page is updated, old embeddings for that page are removed from Supabase before the fresh text is token-split and re-indexed. Staff chat queries therefore retrieve only current documentation rather than conflicting historical versions.

Catalogue ID
#1527
Functional nodes
19
Connections
19
Trigger
chatTrigger, scheduleTrigger, notionTrigger
AI layer
AI-assisted
Business problem solved

Business problem solved

Many internal RAG prototypes break down after week one because Notion pages evolve while outdated embeddings pile up in the vector table. Retrieving two contradictory policy versions destroys team confidence in the assistant.

Trigger

A Notion trigger watches page edits, a schedule trigger runs periodic sweeps and a chat trigger serves team queries.

Connected systems

Connected systems

  • Notion
  • Supabase pgvector
  • OpenAI
  • Chat interface
  • Self-hosted n8n

Every workflow is deployed on your own server with documentation, a run log and an error queue.

Workflow steps

Workflow steps

  1. 01

    Notion page change capture

    Notion and scheduled triggers detect modified workspace pages and pull their updated blocks.

  2. 02

    Stale embedding removal

    Previous vector rows matching the edited page ID are deleted from Supabase before new chunks are written.

  3. 03

    Token splitting and pgvector upsert

    Updated page content is split by token count, embedded via OpenAI and stored cleanly in Supabase pgvector.

  4. 04

    Live retrieval Q&A

    Incoming chat questions retrieve matching chunks and summarise answers grounded solely in the current Notion pages.

Error queue and human approval

Error queue and human approval

Built-in state in the catalogue workflow

The verified catalogue workflow contains zero node-level error flags, while its explicit delete-old-embeddings step prevents stale-index drift by design.

Production layer added by ALTAI

During live deployment, ALTAI adds index-refresh failure alerts, a missing-source notification queue, workspace permission filters and a synchronisation run log.

Frequently asked

Notion to Supabase live RAG sync workflow Frequently asked questions

Depending on your configured Notion trigger and sweep interval, updated pages are purged and re-indexed within minutes.

Without deleting prior chunks, vector search returns both old and updated rules side by side and produces contradictory answers.

Yes. Integration permissions are scoped strictly to the exact Notion databases and pages approved during discovery.

Yes. We deploy against EU-hosted Supabase projects or a self-hosted PostgreSQL instance with pgvector.

Mert Can Gundogdu
The founder takes the call, not a sales team
Next step

We write the proposal after we have found the problem together

In a thirty-minute call we listen to how you work and talk through where time and customers are slipping away. If you do not need a digital fix, we will tell you that too.

30 minutes · no preparation needed

The call and the week of discovery are both free.Read the terms

Chat on WhatsApp