update knowledge
# 🤝help
a
I'm trying to create a bot that tells you the horoscope of the day via WhatsApp. Now since the horoscope changes every day and I can't upload the Knowledge base every day for all my clients, what would be the solution? I have read other posts from users who have the problem of creating dynamic knowledge bases and I see that the last request for integration of a feature that allows refreshing the document from a URL (or any other method) dates back to November... I don't know if anything has been done by the developers in the meantime. I saw that voiceflow has a Refresh feature which I haven't tried yet, I wanted to ask if Bootpress has something similar...
s
Hi, I suggest you try to do it through Google Drive - for example, sheets, or you might have a different idea. Use custom triggers in your bot (separate flow for this) to update KB when Make.com recognizes changes in your sheets. You can install trigger handling in the Google Sheets and trigger the "make," which will inform the bot to update the KB. Take a look at this solution to get an idea of how to have updates to your KB: https://discord.com/channels/1108396290624213082/1194161232052244521
a
Yes, I saw that the process is explained in the tutorial section. I'm disappointed that Bootpress doesn't have this built-in functionality that voiceflow has, this effectively forces you to purchase 2 services. I think it's an indispensable feature for a bot....shouldn't bots be made to automate things?
s
I agree. That's just a workaround I would use. I hope they will implement other functionalities sometime. Nevertheless, I like to separate functions to make it more efficient, and "make" or any other service can act as an additional processing unit rerouting actions to different bots (just an example). You can also use scheduled Botpress triggers to update the database each day or twice per day. At a set time, your bot can download the content from any location convenient for you to make those updates—it can be Google Drive or another remote location. Just brainstorming possibilities 😉
w
@square-toddler-30705 regarding your idea above of using scheduled Botpress triggers to refresh a KB on some schedule (without a Make.com type service) -- this sounds like a great idea -- can you expand on how to accomplish that (i.e., trigger a KB source refresh)? I read devmik's tutorial, but it does not seem to indicate how to refresh the KB sources without an external integration
f
Hey there everyone👋 The files API just released yesterday🎉 This means that you can update the KB automatically through this. You would have to write a bit of code to automate it, but else it's fine. They just released so many amazing things, but I am planning on adding the files API endpoint to my Make.com app, which would hopefully let you easily update the KB. https://discord.com/channels/1108396290624213082/1221532573684203550 https://botpress.com/docs/api-documentation/#files
s
Hi, @User , @wonderful-wolf-37241 - I just found some time and created an example of a bot that automatically creates a horoscope at 00:01. It's only for Aries but can be extended. This concept can be used for other tasks. You can have a file on your server and download it by bot. Next, the flow can update the table or trigger the KB. KB can be configured, like in this case, to search for the current horoscope and update the table to avoid wasting tokens. It's just an idea - there are many possibilities. https://cdn.discordapp.com/attachments/1229368056829054976/1229754167338209320/Horoscope-every-24h_-_2024_Apr_16.bpz?ex=6630d4d1&is=661e5fd1&hm=8f35bf26b9a15538fa3ed7ffa525049bf9bcf1d670acf8292eefad08d9d07504&
w
@square-toddler-30705 very nice design there -- I see it uses a 'search the web' source for the KB -- do you happen to know if there's a way to initiate a KB source refresh when the KB source is an indexed website/web page?
s
Maybe after the latest Botpress update it's possible. Look above - the message from Decay about automatic update of the KB. Before, you would have to remove the source inside the KB and add it again to index the page. It's because of the chunking process—the AI creating vectors. With 'search the web,' it happens when it gets executed - I didn't check the code yet, so just assume how the function works. Therefore, I try to balance between always fresh data and caching/indexing to make it efficient (cost and response time). I used to design embedded systems so it's in my DNA 🤓
w
Thanks again! Related: Robert mentioned in another thread that native support for dynamic KB caching is forthcoming 'soon' in a future release, so that is pretty sweet! (link for reference: https://discord.com/channels/1108396290624213082/1229533870861451345/1229891542672736407)
f
Hey there👋 The files API got added to their documentation, but I am not sure that it's usable just yet, but it being added means that it's not too far out!
w
@fresh-fireman-491 that files API looks promising -- do you happen to know how one would associate a given file with a particular KB (in a situation where multiple KBs exist in a bot)? I looked in the metadata objects in the docs you linked, but didn't see anything in there pertaining to KB association
f
That is a pretty good question! I don't know, but I am sure that the docs can tell us once they get updated
4 Views