Dynamic Knowledge Bases
# 👀feature-requests


05/29/2023, 5:47 PM
Not sure about the feasibility of this one but i noticed that knowledge bases can be created as static next to folders and workflows. Would it be possible to eventually store knowledge bases as dynamic variables and generate them in your graph as needed (using a "Create Knowledge Base" task)? This would be incredibly helpful when users ask about user-generated content or otherwise dynamic content. I definitely can imagine how long this would take though depending on the source(s). Unless this is currently possible using the AI task?


05/29/2023, 6:05 PM
We are getting a lot of requests about something like this and are working on a solution to give more control over the process. Stay tuned!


05/29/2023, 6:06 PM
Hey Jacob, def. in the works! If you can share ideas on how you'd like that feature to be exposed in the product that would be even better 🙂


05/29/2023, 6:41 PM
Thank you both, great to hear this is something thats being looked into. The use cases that come to mind are: - Have another action that can be added to nodes (this would let users generate knowledge bases using dynamically set text or url(s) (and eventually pdfs/files whenever file uploads are possible) the resulting generated knowledge base could be set to a variable (possibly of a new "Knowledge Base" data type for variables). - Provide a ts function that would allow users to generate knowledge bases using the execute code function. This could additionally allow other functions for the knowledge base to also be called from the execute code function such as .generateResponse(query: string) which would let users programmatically access knowledge base responses via ts. - Create a "Use Knowledge Base" or "Knowledge Base Response" action that would let users pass a static knowledgebase variable as input along with a dynamic query to generate a response (maybe the response could be stored in a variable statically but this might be much easier to allow programatically via the Execute code action). Hopefully these make sense, but let me know and i can definitely clarify.


05/29/2023, 6:46 PM
Thanks for sharing Jacob. This will help. Stay posted on Discord. I'll make sure to update everyone here as soon as the new dynamic sources feature is out.


05/29/2023, 7:34 PM


06/01/2023, 2:31 PM
Hello all, I have the same need. Basically, the knowledge I want to use is stored on our back-end. An API call would bring to botpress the expeted data or file, and then knowledge base would be used to answer users question using this file or data.


06/01/2023, 4:25 PM
@steep-spring-32887 thanks for the input! how do you see the expiry/lifetime of that dynamic KB to be like? for example, would you like the dynamic KB to be only set for the current turn, or would you like/expect it to be available longer? or should it be scoped by workflow etc
I think this other issue could share the same solution: @prehistoric-caravan-92312 @early-camera-62649 @steep-spring-32887 Agents will soon be able to expose cards in the flow editor. Interested to hear your thoughts on this potential solution (and if you have better ideas!): 1) KnowledgeAgent could expose a few context variables inside {{user.KnowledgeAgent.context}} / {{bot.KnowledgeAgent.context}} / {{conversation.KnowledgeAgent.context}} / {{workflow.KnowledgeAgent.context}} respectively, which would allow you to edit/amend the context that wraps all calls to GPT + Knowledge Sources. This would be useful to include information that is useful to answer better given the knowledge sources. 2) In addition, the KnowledgeAgent would expose cards to "Append Dynamic Knowledge". Not sure how and when the dynamic knowledge would expire though?


06/01/2023, 6:00 PM
I would see it expire at the end of the flow or at the end of the conversation. Option 1 : We build a flow to give information about a specific service. The same flow is used with the service being a variable that is defined when entering the flow. It gives answers on that service. Then the User asks about another service. It gets the data about this service and replace the previous knowledge base and answers the questions. Option 2 : We upload all data needed at the begining of the conversation for the specific user with an API call after authenticating the user


06/05/2023, 6:47 PM
This would be so helpful


06/30/2023, 10:46 PM
It will be really helpful, I have the same need. Basically make a capture information for the users to generate knowledge bases using text, URLs, pdfs/files. So that every user have a dynamic way to use the chatbot for their needs. I really think that it will be a lot of work and a lot of code for you guys but there will be many ways to integrate a chatbot in a business or for custommer support


07/05/2023, 1:55 PM
@rich-battery-69172 - create knowledge triplets from documents => triplets can then be vectorized - create graph from triplets => entities from the graph can be queried programatically if needed


07/05/2023, 7:42 PM
Would this cache concept be helpful in this feature request? It looks like it could be used to make less api calls and potentially even use a cheaper model after a more expensive model is used to initially populate the cache/kb.



08/16/2023, 10:39 AM


08/17/2023, 3:23 PM
any news/progress


08/21/2023, 8:53 PM
Still in the works, we'll keep you posted whenever we have anything to show or to beta release