Ai task and knowledge base
# 🤝help
b
Hello, I want my bot to be able to answer from a KB using the AI task. I have set up the KBs I want to use and the AI task but it doesn't work. In the screenshot I show how the answer is fount in the KB, but the AI doesn't answer correctly. I have also attached a screenshot of the AI input. Am I doing something wrong?

https://cdn.discordapp.com/attachments/1138461257188515971/1138461257641513103/Screenshot_2023-08-08_161128.png

https://cdn.discordapp.com/attachments/1138461257188515971/1138461257981231134/Screenshot_2023-08-08_161258.png

f
Are you usign the query knowledge base before the task?
Also you knowledge agent what is he set on?
b
Yes I am using the query before, with the question of the user as an input
The agent is on
Also, I am trying to let the AI have access to the whole KB and not just the answer that botpress returns. Is that possible in botpress or do I have to use stack AI?
a
You can use this as an input to an AI task to feed the raw infor from a kb. {{event.kb.results.map((a) => a.dsFriendlyName + '\n' + a.content).join('\n\n')}}
b
I get this error

https://cdn.discordapp.com/attachments/1138461257188515971/1138472894251405312/Screenshot_2023-08-08_170413.png

Do I have to change anything?
a
yes, you need to make sure the KB is active at that node
you can do this a couple of ways
b
It is

https://cdn.discordapp.com/attachments/1138461257188515971/1138473222044655666/Screenshot_2023-08-08_170551.png

a
if you click your last prompt, open the JSON tab, then scroll to the bottom, open kb then results
alternatively check if the KB returned any results in the first tab "Event Debugger"
b
It says 0
For the results
a
I tend to ignore the error message you see, it's not reliable
ah, that's why
what's the question you gave the convo?
b
In the test chat it says the answer is fount
a
what is being queried
b
d
I asked for the temperature
In the KBs i have weather,com
where the temperature can be found
a
can you share the bot file?
you can use this to get a code that I can use to check it out

https://cdn.discordapp.com/attachments/1138461257188515971/1138474494382583850/image.png

b
Yes, I just have to remove one KB because of the privacy of the client
Here
a
thanks, give me a min to check it out
b
Okay, thanks
a
This needs to be toggled on

https://cdn.discordapp.com/attachments/1138461257188515971/1138477514516336640/image.png

@better-journalist-46347 can you try that, refresh to make sure it was saved properly, and then try it out in the chat?
b
Yes it works, thank you
Why is that?
It is separate from the AI task
a
I believe it has to do with the capture card and the original way it worked
b
Okay, thanks
Now I get two answers each time. I believe the question is answered on both nodes
@acceptable-gold-88171
a
For that, i'll let you work on it a bit more and see if I can help someone out 😉
b
Okay, if I don't find anything I will let you know
k
i experienced the same issue. also, for some reason the knowledge base won't read some links I've provided it with, it just says "click on the following link: " and there is no link provided
b
Not yet. I think I have to take a different approach with the KB overall. I want the AI to be able to read the KB and form an answer from there.
This will solve the double answer as well because the only answer will come from the AI task and not from the KB
54 Views