How to add filter on knowledgebase
# support
s
I am saving the call summary directly in trieve dataset with a group id each phone number -> grouped chunks (scoped to that phone number) now how can i add a group id filter on the knowledgebase ? i want to make the user level memory work this is waht vapi documentation assistant gave me """ 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. """
c
What error are you seeing when trying to add a group ID filter on the knowledge base?
s
Copy code
{
  "customer": {
    "number": "{{ $json.phone }}"
  },
  "phoneNumberId": "{{ $json.vapiPhoneNumberId }}",
  "assistantId": "{{ $json.vapiAssistantId }}",
  "assistantOverrides": {
    "variableValues": {
      "firstMessage": "{{ $json.firstMessage }}",
      "name": "{{ $json.firstName }}",
      "email": "{{ $json.email }}",
      "phone": "{{ $json.phone }}",
      "primaryAgentId": "{{ $json.primaryAgentId }}",
      "leadId": "{{ $json.leadId }}"
    }
  }
}
this is my assistant call json - how can i pass the knowledgebase with filter here ?
i can go to vapi dashboard and select the knowledgebase i created - but that won't have any filter at all so only place i can think wher the filter can be passed is here but i don't know how to pass that
maybe i have to use a tool call + n8n workflow
so 2 places when creating the call i will pass it previous call context and also give it a tool to fetch the context async if needd (tool call)
ok i created the tool call - using local qdrant so its not adding much latency - fine for now
c
Checking in, how is everything working?
4 Views