Retrieve data/chat from Supabase Vector Table for specific files

Hi,
Question: How do I restrict my chat to specific set of files on a file. The data is loaded in Supabase Vector Table. I am also inserting “file_name” as a tag in the metadata col. I have a function call match_document which is being called from node: supabase vector store. I am also using “vector store retrieve” to retrieve the file. I am getting the following: Unfortunately I do not have access to the file that was referenced, so I am unable to create the requested…

Details:
I am using the following to insert data in the vector table. This works fine. I am using a metadata tag “file_name” to insert the name of the file in the metadata.
I have table in metadata:-- Create a table to store your documents
create table documents (
id bigserial primary key,
content text, – corresponds to Document.pageContent
metadata jsonb, – corresponds to Document.metadata
embedding vector(1536) – 1536 works for OpenAI embeddings, change if needed
);

The following insert works in the vector database:

Here is the metadata with “file_name” tag:

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

I am using Version 1.32.2 self hosted on Linux, Docker and coolify
Database: supabase

The following node to populate vector table:

The execution to retrieve information for given file_name: Doesn’t work:

I figured it out. My problem was the file_name was referenced in the :AI chat agent. It should only be refenced in “supbase vector store”. this should be passed in as “metadata” to filter.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.