Dynamically filter knowledge base for different user

(Aayush) #1

A knowledge base can have multiple files. Where we can give tag to individual file.

This knowledge base is attached to an assistant using Tools option. The tool option allows filtering option from knowledge base, so that only subset of files would be used when providing context to model.

I have created web-bot from this assistant and everything is working good.

Problem 1: I am not able to change this filter option dynamically based on user who is interacting the website’s chatbot. Is there a way like using API?

Suppose knowledge base has 3 files one for each user and model should consider using only respective file for each user. Is this possible? Because in assistant’s tool option the filter option has been set as seen in image and can’t be changed dynamically. So every user would get same answer from file.

Problem 2: https://support.flowxo.com/article/325-updating-a-knowledge-base-via-api from this API endpoint how can I change these files’ filter or add new?

(Jordan M) #2

For problem 1, try creating a flow with:

  1. Trigger = New Command
  2. Action = Search KB
  3. Attach the Flow to your assistant as a tool
  4. In the flow, determine what the User ID should be.
    (in our case, we use the Web Messenger API and inject the logged in User ID as Meta in the chat)

Here’s an example of the lookup step with variables in place for the meta:

Problem 2: I could be wrong about this one, but in our setup, we store the FlowXO document ID on our site, then we overwrite or delete it, then replace with a new one. I haven’t had luck adding / changing meta data in place.