Supabase Vector Store filtering by specific ID

Hi,
I have a question related to Supabase and using AI Agent, to use the vector store as knowledge base.
I followed the tutorial on youtube,

and got everything working.

But maybe its my lack of understanding these kinda databases or I am missing something.

Actually, as far as I understand, I create one table. In the example its “documents”.
In that table I now store all the data I want and the AI Agent (in the youtube video its the Question and Answer Chain), will use that as knowledge base.

Now - I have a website with listings. Each listing has its specific information.
So I gonna store these data as JSON in a new row and get:
ID, Content, metadata and embedding as keys.
Now - I actualy only want to use that specific knowledgebase, related to a listing.
So I thought, I can filter the rows by another ID that I called listing_id.
So each document, even when its splitted into more than one row, would have a listing_id that only contains the listing related knowledge base.

When using the normal supabase nodes to update, edit, delete, add etc, I can choose the listing_id.
But when using the “Supabase Vector Store”, I can only choose the table.
That means, it would always use all the knowledge in that table.

I could now add a key and value to the metadata, that contains the specific listing_id.
But that also means, it must run through all these metadata, to see, where I have that ID.

is there something I am missing or just dont understand, how these type of database work?

I can add “Query Name” and “Metadata” as options.
Or would I create a new table for each listing?
As far as I understand, that is not best practice, right?

Thank you very much,
Markus

  • **n8n version: 1.50.1 **
  • **Database: SQLite **
  • **n8n EXECUTIONS_PROCESS setting: main **
  • **Running n8n via:Docker **
  • **Operating system: Win 11 **
1 Like

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:

Hey @sant0s,

That should work with the metadata filter. How did you get on? Do you wanna share your progress? :eyes:

1 Like

Hi ria.
At the moment I am indeed using the metadata filter. Means, when storing the embeddings, I also store relevant metadata like post id and relations, to filter the query.
Especially with the question and answer chain it works really good.
I am probably doing something wrong calling { functions } with an agent, since the probability that something is not found is high while using question and answer chain node always gives me the correct answers.
So I am using a combination of question and answer chain to feed that to an agent.

I still have to totally understand, how to store and especially update supabase, since the content may change over time.

You have more useful information on that?
Thank you for your answer btw :blush:

1 Like

man how you using the metadata filter ? i’m trying to use , but always the question and answer don’t give to me any results ;/

Hi. Does it give results in general?

I managed to solve the problem, it was a lack of attention, I was referencing the wrong db

2 Likes

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