AI Agents

Build an intelligent agent for document search via Supabase

33 nodes 192 106 Automatic trigger
Download

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. 1.Load and read documents uploaded through the chat interface
  2. 2.Split text into small segments and convert them to numerical embeddings
  3. 3.Store embeddings in Supabase with original document content
  4. 4.Receive user questions and search for the most relevant document segments
  5. 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

Document Default Data Loader Text Splitter OpenAI Supabase Split In Batches Chat Trigger Vector Store AI Agent

Details

Trigger Automatic trigger
Nodes 33
Apps 8
Views 192
Downloads 106

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (33)

/

Get All files

HTTP Request

#1

Default Data Loader

Document Default Data Loader

#2

Recursive Character Text Splitter

Text Splitter Recursive Character Text Splitter

#3

Extract Document PDF

Extract From File

#4

Embeddings OpenAI

OpenAI

#5

Create File record2

Supabase

#6

If

If

#7

Get All Files

Supabase

#8

Download

HTTP Request

#9

Loop Over Items

Split In Batches

#10

When clicking ‘Test workflow’

Manual Trigger

#11

Aggregate

Aggregate

#12

When chat message received

Chat Trigger

#13

OpenAI Chat Model1

OpenAI

#14

Embeddings OpenAI2

OpenAI

#15

OpenAI Chat Model2

OpenAI

#16

Vector Store Tool1

Tool Vector Store

#17

Switch

Switch

#18

Insert into Supabase Vectorstore

Vector Store Supabase

#19

Merge

Merge

#20

AI Agent

Agent

#21

Supabase Vector Store

Vector Store Supabase

#22

Sticky Note

Sticky Note

#23

Sticky Note1

Sticky Note

#24

Sticky Note2

Sticky Note

#25

Sticky Note3

Sticky Note

#26

Sticky Note4

Sticky Note

#27

Sticky Note5

Sticky Note

#28

Sticky Note9

Sticky Note

#29

Sticky Note7

Sticky Note

#30

Sticky Note6

Sticky Note

#31

Sticky Note8

Sticky Note

#32

Sticky Note10

Sticky Note

#33