Dynamic Knowledge Bases
# 👀feature-requests
e
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?
a
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!
r
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 🙂
e
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.
f
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.
r
@witty-football-93730
s
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.
r
@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: https://discord.com/channels/1108396290624213082/1113641714167595048 @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?
s
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
g
This would be so helpful
b
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
a
@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
q
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.

https://youtu.be/EQOznhaJWR0

a
.
b
any news/progress
w
Still in the works, we'll keep you posted whenever we have anything to show or to beta release
78 Views