Build an intelligent agent for document search via Supabase
Workflow Description
Automation that loads documents, splits them into chunks, converts them to OpenAI embeddings, and stores them in Supabase to enable a smart agent to search and answer user questions based on uploaded document content.
How it works
- 1.Load and read documents uploaded through the chat interface
- 2.Split text into small segments and convert them to numerical embeddings
- 3.Store embeddings in Supabase with original document content
- 4.Receive user questions and search for the most relevant document segments
- 5.Generate intelligent answers using OpenAI based on retrieved documents
Use cases
- Create a smart assistant that answers employee questions based on company policies and internal documentation
- Build a semantic search engine that retrieves the most relevant document sections for customer inquiries
Requirements
- OpenAI API key for generating embeddings and responses
- Supabase account with a database configured to store embeddings
- Proper application authentication and access to the chat interface
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 (33)
Get All files
HTTP Request
Default Data Loader
Document Default Data Loader
Recursive Character Text Splitter
Text Splitter Recursive Character Text Splitter
Extract Document PDF
Extract From File
Embeddings OpenAI
OpenAI
Create File record2
Supabase
If
If
Get All Files
Supabase
Download
HTTP Request
Loop Over Items
Split In Batches
When clicking ‘Test workflow’
Manual Trigger
Aggregate
Aggregate
When chat message received
Chat Trigger
OpenAI Chat Model1
OpenAI
Embeddings OpenAI2
OpenAI
OpenAI Chat Model2
OpenAI
Vector Store Tool1
Tool Vector Store
Switch
Switch
Insert into Supabase Vectorstore
Vector Store Supabase
Merge
Merge
AI Agent
Agent
Supabase Vector Store
Vector Store Supabase
Sticky Note
Sticky Note
Sticky Note1
Sticky Note
Sticky Note2
Sticky Note
Sticky Note3
Sticky Note
Sticky Note4
Sticky Note
Sticky Note5
Sticky Note
Sticky Note9
Sticky Note
Sticky Note7
Sticky Note
Sticky Note6
Sticky Note
Sticky Note8
Sticky Note
Sticky Note10
Sticky Note