- 417
Upsert Large Documents in a Vector Database Using Supabase and Notion
Discover how to efficiently upsert large documents into a vector store using Supabase and Notion in this n8n template, enhancing data management.
Discover how to efficiently upsert large documents into a vector store using Supabase and Notion in this n8n template, enhancing data management.
Who is this workflow for? This workflow enables the creation of a Retrieval-Augmented Generation (RAG) system using live data from Notion as a knowledge base. It automatically updates embeddings in a Supabase Vector Store whenever a Notion page is modified, ensuring that your RAG system remains current with the latest information..
A trigger node polls the Notion Database every minute to detect any updates. This manual polling approach ensures high accuracy and prevents missing changes between intervals.
Each updated Notion page is processed one after the other to maintain order and ensure consistency in the workflow.
The workflow searches the Supabase Vector Store using the Notion Page ID from the embedding metadata. If existing entries are found, they are deleted to avoid duplication.
All blocks from the updated Notion page are retrieved and concatenated into a single string, preparing the content for embedding.
The combined content is embedded into vectors. If necessary, the content is split into manageable chunks. Metadata, including the Notion Page ID, is attached to each embedding before storage in the Supabase Vector Store.
A simple Question and Answer Chain is integrated, allowing users to query the embedded content through a chat interface, leveraging the updated vector store for accurate responses.
Populate your Notion Database with relevant information. Use the integrated chat function to ask questions about the content. Any updates to Notion pages will be quickly reflected in the chat responses, ensuring that your queries are always based on the latest data.
This workflow automates the synchronization of Notion pages with a Supabase Vector Store, enabling the creation of a dynamic RAG system. By ensuring that embeddings are always up-to-date with the latest Notion data, it provides a reliable and efficient solution for managing and querying large knowledge bases.
Discover how to dynamically set credentials in n8n, enhancing automation with expressions and flexibility for seamless workflow integrations.
Safeguard your data using n8n's Crypto Node. Benefit from robust encryption, seamless integration, and user-friendly setup in your automation workflows.
Build efficient voice interactions using webhooks, memory management, OpenAI, Google Gemini, and ElevenLabs for a seamless AI-driven chat experience.
Help us find the best n8n templates
A curated directory of the best n8n templates for workflow automations.