How to add metadata filter to KnowledgeBase?
# support
s
I am trying to add memory to the assistant with the knowledge base, and now i have a task to give it user-level memory - my first approach was to use RAG with a tool call, but that is not very efficient and adds more latency. My goal is to save the transcript summary in the trieve in a "user_lvl_memory" knowledge with a phone_number metadata filter and when i make the call to the assistant - transient assistant, I will pass that user_lvl_memory knowledgebase with phone_number filter hope this makes sense, maybe this is not available or there are alternatives that can be used
v
I understand you're looking to implement user-level memory by saving transcript summaries in Trieve with a phone number filter. Based on the available information, I can see that metadata fields can be configured for filtering in Trieve, but I don't have specific details on implementing a phone_number filter. Could you share more about: 1. Have you already created your Trieve dataset for the knowledge base? If so, what structure are you using for your documents? 2. Are you using the [Trieve API](https://docs.vapi.ai/knowledge-base/integrating-with-trieve) directly to add documents with metadata, or are you trying to configure this through Vapi's API? 3. Have you considered using a custom knowledge base server as an alternative? This would allow you to implement custom filtering logic based on phone numbers when Vapi sends requests to your server. Source: - [Integrating with Trieve](https://docs.vapi.ai/knowledge-base/integrating-with-trieve)
s
I am adding knowledgebase directly to trieve dataset with the filter what is custom knowledgebase server?
@Vapi I am adding knowledgebase directly to trieve dataset with the filter what is custom knowledgebase server?
p
To implement user level memory in Vapi efficiently, store post call summaries in a knowledge base, tagged with the user’s phone number, and retrieve this data during transient assistant sessions to personalize interactions without relying on latency prone RAG tool calls.
s
How would i retrieve it with filter ?? thats what i am stuck at - trying to understand
r
Hi, GM all .. I am trying to get some help on the AI agents behaviour to read out a menu for my ordering ai , but it always skips the name of the menu item .. i have tried multiple of feeding the data using Trieve, just a simple text aggregrator from a google sheet .. for one or two items it is fine but when i pull more data it always misses the menu item .. any help is appreciated. I even made the prompts specifically stick to the item as written but no luck ..
s
You are correct that, with current Vapi and Trieve integration, there is no built-in support to filter a shared Trieve dataset by user/group at runtime via the dashboard or a single API call. To isolate memory for each of 1,000 users, you would need to create 1,000 separate knowledge bases or datasets and programmatically associate each one with the correct user/assistant using the API1234. There is no supported method to apply a dynamic filter (such as group ID or phone number) at call time within a single Trieve dataset in Vapi at this time25.
this is from vapi documentation assistant
so there is no option right now
p
You're absolutely right - there is currently no built-in support for filtering a shared Trieve dataset by user/group at runtime in Vapi. The current Trieve integration doesn't support dynamic metadata filtering at call time. Available Alternatives is either Transient Assistant with Dynamic Knowledge Base or Custom Knowledge Base Server.