RAG on live data
Workflow Description
An intelligent retrieval-augmented generation system that ingests live data from Supabase and Notion, processes it through vector embeddings, and provides accurate answers to user queries using OpenAI's language models with real-time information retrieval.
How it works
- 1.Trigger workflow via Notion event or scheduled interval to fetch live data
- 2.Load documents and split them into semantically meaningful chunks using tokenization
- 3.Convert document chunks to vector embeddings via OpenAI and persist in Supabase vector store
- 4.Process user queries through chat interface with semantic similarity search across stored vectors
- 5.Generate precise, contextual answers using LLM Chain and optional summarization
Use cases
- Enable employees to ask natural language questions about company documents and policies updated in real-time
- Extract relevant information from large document databases and automatically answer complex queries
- Build AI-powered knowledge assistants that combine multiple data sources for comprehensive responses
Requirements
- OpenAI API keys for embeddings and language model access
- Active Supabase database with vector extension enabled
- Notion workspace with database access and API integration
- Documents in supported formats (PDF, Markdown, plain text)
Service Value
Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.
Apps Used
Details
How to Use
- 1.Click "Download Template"
- 2.Open your n8n dashboard
- 3.Go to Workflows > Import from File
- 4.Select downloaded file and configure credentials
Nodes Used (34)
Embeddings OpenAI
OpenAI
Token Splitter
Text Splitter Token Splitter
Loop Over Items
Split In Batches
Question and Answer Chain
Chain Retrieval Qa
Vector Store Retriever
Retriever Vector Store
OpenAI Chat Model
OpenAI
When chat message received
Chat Trigger
Schedule Trigger
Schedule Trigger
Sticky Note
Sticky Note
Limit
Limit
Limit1
Limit
Delete old embeddings if exist
Supabase
Get page blocks
Notion
Default Data Loader
Document Default Data Loader
Sticky Note1
Sticky Note
Input Reference
No Op
Notion Trigger
Notion
Get updated pages
Notion
Sticky Note23
Sticky Note
Sticky Note24
Sticky Note
Sticky Note25
Sticky Note
Sticky Note26
Sticky Note
Sticky Note27
Sticky Note
Sticky Note28
Sticky Note
Supabase Vector Store1
Vector Store Supabase
Sticky Note30
Sticky Note
Sticky Note31
Sticky Note
Supabase Vector Store
Vector Store Supabase
Sticky Note32
Sticky Note
Sticky Note29
Sticky Note
Sticky Note33
Sticky Note
Sticky Note34
Sticky Note
Sticky Note35
Sticky Note
Concatenate to single string
Summarize