https://discord.gg/botpress logo
I have KB enabled on my nodes If i ask a question ...
# 🌎general
m
I have KB enabled on my nodes If i ask a question and KB is unable to give me an answer, then i want to execute a code to call an API which is like my other custom knowledge base, How di i do this please?
e
Hey Mish, that's an good looking flow! May I ask if what is this bot for? To achieve this you can add an Expression card with the code
turn.KnowledgeAgent.answer === null
to the end of your nodes. This will check if the bot could find an answer in the KB. Then you can transition to another node that has the Code
I'm sorry, considering you have countless capture cards, this won't work. The best way to achieve this would be with Hooks, which allow you to have processing before sending a message
Let me try doing this
m
The bot is for creating an audit report for an organization. So each node is a a section with questions the user needs to answer and based on those answers the bot generates an audit report. So for each node i want the user to be able to ask a question and get an answer but the knowledge base only allows 100 docs and i've got 87 more docs. So i created a knowledge base using langchain and pinecone and it's gonna be an api i can call and it return answers.
OKay
Please let me know when you get a way to do this
e
I understood, that's very interesting! Did you consider using only Langchain or StackAI as the KB source instead? It might make it easier for you to keep everything in the same place since you have lots of documents
But you would still need to use Hooks. In a couple hours I will try to come up with an example!
m
Okay i think that would be a good idead to keep everything in a single KB source
Alright. Thanks
c
Are there any detailed guides on how to use hooks? 🙂 There's not much info in the docs
e
Not yet Buzzea, it's on the backlog!
@melodic-engine-33365 I haven't forgotten about you! I am consulting with our top engineers to find a solution 😉
Going against my previous recommendation - If you had all your documents in the Botpress KB's this would be as easy as enabling "Knowledge Answering" in your nodes.
You could try appending docs togheter so they fall whitin the max docs quota
But hang tight for a while please
3 Views