Supabase Vector Store doesn't filter

I’m building a chatbot that recommend prdoucts from my data base.

I made a Supabase Vector Store wich stores the products and embed them.
The Vector Store contain id, content, metadata and the rest of the fields like price, duration…

Whenever the user write something like: I want a product for less than 100€ I want the Vector Store to filter but that seems to not happen.

Does someone know how i could make the Supabase Vector Store to filter when some questions are asked?

Dear @saurajan , I think you just need to inhance the prompt of your AI agent, and tell him what it has to do.

Plus specify the tool vector database you have attach.

In this way, it’s going to properly visit the vector database and going to solve out your problem.

Happy to help…

For your case, you can do some adjustment with the AI Agent system instructions, perhaps you can explicitly tell the AI to use Supabase Vector database tool

The AI Agent does use the tool but only return the “best 10”. My problem is that I want these “best 10” to really be the best fitting with the user request.

I reckon that the problem resides on the tool beacause it doesn’t apply filters. Even though I could be wrong about where’s the problem.

Despite I have tried to modify the system message the AI Agent ends up returning the wrong products.

Ok, I got your problem. For your needs, you might be use “reranker” for your case, to make the data “sorted” by the nearest accurate data with your needs, and n8n has that feature with using Cohere reranker.

2 Likes

I have been trying to polish the prompt. But it don’t seems to fix it. As I told @cutecatcode I think the problem is that the vectore store dosen’t provide the agent with the real best products (based on the user quest).

I think the solution that @cutecatcode is providing is the best one to go with…

Still if it’s not work out, I am very happy to see your workflow and help you solve it out together…

Happy to help…

Alright,

I try what @cutecatcode said and let you both know if it worked.

Thank you so much for the implication!

1 Like

You’re welcome!
Kindly mark my message as solution if it helps you, thanks!