anaksor-ocr
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…
An n8n workflow that reads the PDF and text files in a Supabase storage bucket, stores their text as OpenAI embeddings in a Supabase table, and gives you a chat agent that answers from them.
Chat with the PDF and text files in a Supabase bucket is an n8n workflow in the Productivity category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.
Test button and chat message
It has two starting points:
Chat answers drawn from your bucket’s PDF and text files, with each file recorded once and its text stored as vectors
What you need before you start.
Embeddings and chat
Runs text-embedding-3-small to turn each piece into a vector, and two chat models for the agent and its knowledge tool.
NeedsOpenAI API key
Storage, tables and vectors
Holds the bucket, lists and downloads its files, records each file in a table and stores and searches the vectors.
NeedsYour project’s URL and a secret key, with a bucket, two tables and a match function
Checked by Mindket on 13 Nov 2026
This n8n workflow lets you chat with the files in a Supabase storage bucket. Its first half reads the bucket. It lists the files, skips any that a files table already records, downloads the rest and pulls the text out of PDFs and plain text files. The text is cut into pieces of 500 characters, and OpenAI turns each piece into an embedding stored in a Supabase table. Its second half is a chat agent with a knowledge tool that searches those pieces and answers from what it finds. Twenty-two nodes do the work, beside nine sticky notes.
Teams that keep contracts, manuals or reports in Supabase storage and want to ask about them in plain words, and that already run a Supabase project. Skip it if your files are Word documents or images, or if people without n8n should use the chat. It opens only inside the n8n editor.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Operations | Office managers | Ask what a stored contract says about renewal | A manager asks when notice is due before a lease ends. |
| Customer support | Support leads | Search product manuals kept in a bucket | A lead asks which models a warranty note covers. |
| Legal | Paralegals | Look up a clause across stored PDFs before opening each one | A paralegal asks which agreements set a data retention period. |
| Education | Course teams | Let staff question lecture notes and handouts | A coordinator asks where a syllabus fixes the assessment dates. |
You need solid n8n for this one: a Supabase project with a bucket and two tables, a vector function and six nodes pointed at your Supabase credential.
Any n8n that can reach Supabase and OpenAI will run it. The text of every file ends up in your Supabase project, and the chat answers inside n8n.
files table and the vector table all live in one projectWhen chat message received and set its authenticationDownload saves a zip with workflow.json and Mindket’s setup notes in your downloads folder. Build the Supabase side first.
| Need | Detail |
|---|---|
| n8n | On n8n Cloud or on a server of your own |
| Supabase | A project with a storage bucket named private, a table files with name and storage_id columns, and a table documents with a match_documents function |
| OpenAI | An API key. The embeddings use text-embedding-3-small, and the chat models take their node’s default |
| Files | PDFs or plain text files in the bucket |
workflow.json.files table and the documents table with its match_documents function. The vectors are 1536 numbers long, the size text-embedding-3-small returns.Get All Files, Create File record2, Insert into Supabase Vectorstore and Supabase Vector Store. In the HTTP nodes Get All files and Download, pick the Supabase credential type and the same credential.<YOUR_SUPABASE_PROJECT_REF> in the address with your project reference, the part before .supabase.co. If your bucket has another name, change private in both.Embeddings OpenAI, Embeddings OpenAI2, OpenAI Chat Model1 and OpenAI Chat Model2.When clicking ‘Test workflow’ and check that files and documents gain rows.Supabase Vector Store, replace <YOUR_FILE_ID> with the id of a row in files to answer from that one file, or remove the metadata filter to search every file.Run the first half whenever you add files. It reads only files that files does not list yet. Then ask the chat about them. The agent calls its knowledge tool, which returns the 8 closest pieces, and answers from those.
| To change | Where |
|---|---|
| Which files are read | The two rules in Switch |
| Piece size | chunkSize 500 and chunkOverlap 200 in Recursive Character Text Splitter |
| Pieces per question | topK, 8, in Vector Store Tool1 |
| The embedding model | text-embedding-3-small in both embedding nodes, which must match |
| The chat agent | The models in OpenAI Chat Model1 and OpenAI Chat Model2, and the tool’s name and description |
An office manager puts two lease PDFs and a text file of building rules in the bucket. She runs the first half once, then asks the chat when notice is due before a lease ends.
Each file gets a row in files, and the pieces of its text go into documents with the row’s id as file_id. The agent searches for the 8 closest pieces and answers from them. Check any date or figure against the file before you act on it.
If you are new. n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. The upper band, Scenario 1, fills the knowledge base. The lower band, Scenario 2, is the chat. Start with one small file and check that its text lands in documents before you ask anything.
For experts. A loop handles one file at a time, and If decides a file is new by looking for its storage_id in the rows Aggregate collected.
| Node | What it does | What to know |
|---|---|---|
Get All files | POSTs to the bucket’s list endpoint with a limit of 100 and an offset of 0, sorted by name | Only the first 100 files are seen |
Get All Files | Reads the files table with n8n’s default limit of 50 rows | Past 50 rows, older files look new and are added again |
If | Lets a file through when it is not in files and is not .emptyFolderPlaceholder | Other files return to the loop |
Switch | txt for a download with no file extension in its binary data, pdf for a PDF | Any other type matches neither rule, so the loop stops |
Default Data Loader | Reads data or text and stamps each piece with the row’s id as file_id | The chat’s metadata filter uses that field |
Only PDFs and plain text files are meant to pass, and two limits cap how many files it keeps straight.
gpt-5-mini in n8n’s repository on 12 November 2026. OpenAI’s deprecations page, read that day, gives 14 January 2027 as the shutdown of gpt-4o and gpt-4o-mini, with gpt-6-luna as the replacement. If your n8n offers an older default, pick a model in each nodeSwitch, so nothing returns to the loop and the run stops with later files unread. Keep to PDFs and textGet All Files has Return All off, so n8n reads 50 rows of files. Turn on Return All in that nodefiles and its pieces in documents first<YOUR_FILE_ID> replaced, the chat sees one file. Remove the filter to search every fileAn n8n workflow in two halves. The first reads the PDF and text files in a Supabase storage bucket, cuts their text into
pieces and stores each piece as an OpenAI embedding in a Supabase table. The second is a chat agent that searches those
pieces and answers from them.
workflow.json: the workflow as n8n exports it, 31 nodes, nine of them sticky notes. It holds no credential. Six notesREADME.md: these notes.Get All files and Download held the address of their author's Supabase project. It now reads<YOUR_SUPABASE_PROJECT_REF>.supabase.co.Supabase Vector Store filtered on one file's id from its author's database. It now reads <YOUR_FILE_ID>.private, holding PDFs or plain text files.files with the text columns name and storage_id.documents and a match_documents function, set up the way n8n's Supabase vector store expects. The table hascontent, metadata and embedding columns, and the embedding is 1536 numbers long, the size text-embedding-3-smallworkflow.json.files table and the documents table with its function in Supabase.Get All Files,Create File record2, Insert into Supabase Vectorstore and Supabase Vector Store. In Get All files andDownload, which are HTTP requests, pick the Supabase credential type and the same credential.Get All files and Download, replace <YOUR_SUPABASE_PROJECT_REF> in the address with your project reference,.supabase.co. If your bucket has another name, change private in both addresses.Embeddings OpenAI, Embeddings OpenAI2, OpenAI Chat Model1 andOpenAI Chat Model2.When clicking ‘Test workflow’, then check thatfiles and documents gained rows.Supabase Vector Store, replace <YOUR_FILE_ID> with the id of a row in files to answer from that one file, orScenario 1, the files:
Get All Files reads the files table and Aggregate folds its rows into one list.Get All files asks Supabase Storage for the bucket's file list, 100 files at most, sorted by name.Loop Over Items takes one file at a time. If lets it through when no row in files has its storage_id and its.emptyFolderPlaceholder. A file that fails goes back to the loop.Download fetches the file. Switch sends a download with no file extension in its binary data, a text file, downtxt output, and a PDF down the pdf output through Extract Document PDF. Merge joins the two.Create File record2 adds the file to files. Insert into Supabase Vectorstore then stores its text. `Default Data reads data for a text file or text for a PDF and stamps each piece with the row's id as file_id`.Recursive Character Text Splitter cuts the text into pieces of 500 characters that overlap by 200, andEmbeddings OpenAI turns each into a vector. The loop then moves on.Scenario 2, the chat:
When chat message received takes your message. AI Agent answers it, with OpenAI Chat Model1 as its model.Vector Store Tool1, is named knowledge_base. It searches Supabase Vector Store throughEmbeddings OpenAI2 and returns the 8 closest pieces, and OpenAI Chat Model2 reads them for the tool.Switch.chunkSize and chunkOverlap in Recursive Character Text Splitter.topK in Vector Store Tool1.text-embedding-3-small in both embedding nodes. Keep them the same, and keep the table's vectorOpenAI Chat Model1 and OpenAI Chat Model2, and the tool's name and description.gpt-5-mini in n8n's repository ongpt-4o andgpt-4o-mini, with gpt-6-luna as the replacement. If your n8n offers an older default, pick a model in each node.Switch, so nothing returns to the loop and the run stops with later files unread.Get All files sees the first 100 files in the bucket. Get All Files has Return All off, so n8n reads only 50files. Past 50 rows, older files look new and are added again. Turn on Return All in that node.files and its pieces in documents first.documents.NOTICE.md 628 B README.md 6 KB workflow.json 19 KB
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…
Qwen · Kit
Qwen2.5-7B-Instruct as GGUF files in eight quantization sizes, to chat with locally through llama.cpp. For people who want a capable 7.6B model on their own co…
ACE-Step · Kit
Generates music from text with a 4B diffusion decoder, 50 steps and guidance control, aiming for higher audio quality than the base. For creators with a GPU of…
op7418 · Skill
Skill that makes single-file HTML slide decks, slide illustrations and platform covers in two visual styles, with a presenter mode for rehearsal. For speakers…
zarazhangrui · Skill
Builds HTML presentations from scratch or from a PowerPoint file and shows visual style previews to pick from, for people who want web slides with no CSS or Ja…
iptv-org · Kit
Collects publicly available live TV channels from many countries into playlists that any video player with live streaming can open. Made for viewers and for de…