AI Task and Knowledge base sending same message tw...
# 🤝help
h
So im trying to make a conversational AI Bot for a marketing agency. for this i need to use an AI Task. I've done that but in order to access the knowledge base i have to enable it on my node which contains the AI Task. so if i ask a question that's in the knowledge base, the AI Task and Knowledge base both reply. But if i turn the knowledge base off, the AI Task isn't able to give me the right information. How do I fix this

https://cdn.discordapp.com/attachments/1137021662647304282/1137021758055133264/image.png

m
In the Knowledge Agent Settings, enable manual answering. You can then use the knowledge base result in your AI Task via a Variable. That's how I did it.
This is the variable you'd use to access the KB response: {{turn.KnowledgeAgent.answer}}
make sure to keep the KB enabled on that node
h
so how exactly should i add the variable in the AI Task. can u send me a screenshot of what u did
@melodic-pharmacist-33482 you there? could u share the prompt for the AI Task
i just tried it but it still doesnt seem to work @melodic-pharmacist-33482
Chat history - {{conversation.SummaryAgent.transcript}} give a good response to {{workflow.user_response}}. First, you need to search this variable: {{turn.KnowledgeAgent.answer}} for an answer. If you do not have a direct response to it, give a response that best suits it. it needs to let the user know that you are well aware of the topic but it's currently not in the knowledge base so you need to divert the user from thinking you're incapable but do not provide any false information. if the question is completely different from the relevant topics then add a short line on how it is irrelevant but present the information anyway. if a question is way too complicated and completely out of reach for you to answer. then refer them to a firebrand official/professional. This is what I put in the AI Task Input
i added a meeting link in the knowledge base but it doesnt seem to know what it is
this is good and its not sending the message twice. but still isn't accessing the knowledge base

https://cdn.discordapp.com/attachments/1137021662647304282/1137026992496185444/image.png

https://cdn.discordapp.com/attachments/1137021662647304282/1137027542331707542/image.png

https://cdn.discordapp.com/attachments/1137021662647304282/1137027620115054683/image.png

ok it seems to be working now but im not sure if its 100% solved. i had an empty knowledge base which mightve been causing the problem
it has stopped working now

https://cdn.discordapp.com/attachments/1137021662647304282/1137045385471328377/image.png

https://cdn.discordapp.com/attachments/1137021662647304282/1137045408061870221/image.png

f
not sure im following, seems like there was a couple of issues here
is your issue that markdown(hyperlinks) is not working on webchat channel?
h
yeah
the 2 messages issue is solved
@freezing-printer-49373 should i grant permissions for that or something?
f
hey in your kb, can you provide your link in markdown format
looks something like this
[Link text Here](https://link-url-here.org)
[Link text Here](https://link-url-here.org)

https://cdn.discordapp.com/attachments/1137021662647304282/1137050806114328586/Screenshot_2023-08-04_at_11.53.52_AM.png

sorry discord supports markdown so it removes the format and just shows a hyperlink lol
h
so it suddenly started working last night, but now it just stopped
c
i have same problem... Sometimes it works sometimes not
f
in the 1st screenshot is the bot in my website, the 2nd screenshot is the editor, when I try to redirect to a link in the editor it works, and when I try to do it on my website it does not work, why? Can someone help me?

https://cdn.discordapp.com/attachments/1137021662647304282/1138470118389727324/Screenshot_2023-08-08_at_14.49.14.png

https://cdn.discordapp.com/attachments/1137021662647304282/1138470118821732474/Screenshot_2023-08-08_at_14.49.38.png

c
Might be your flow which sent the bot towards the end of the conversation due to an error. Without seeing the main flow or the error, it can be hard to tell
f
this is my main flow

https://cdn.discordapp.com/attachments/1137021662647304282/1138619136809898105/Screenshot_2023-08-09_at_00.44.58.png

c
There could be something with the execute code, could you check in the Botpress studio if there is any error? If you are sending webhooks check if the other side is receiving properly
f
in the bot press there is no errors
on my webpage, the bot don't launch the new window
standard 1 const phoneNumber = 'xxxx' const message = 'Hello, this is a test message!' const whatsappUrl =
https://api.whatsapp.com/send?phone=${phoneNumber}&text=${encodeURIComponent(message)}
window.open(whatsappUrl, '_blank')
meeting window.open('https://bookme.cyango.com/joao-rodrigues/business', '_blank')
this works fine on botpress studio
this doesn't work only on my webpage
er TypeError: Cannot read properties of undefined (reading 'payload') at handler (/var/task/customer_code.js:529:930) at /var/task/index.js:20:13517 at AsyncLocalStorage.run (node:async_hooks:338:14) at handleHTTPEvent (/var/task/index.js:20:13496) at Runtime.handler (/var/task/index.js:20:13391) at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1083:29) now it gives me this error
f
Hey @full-beard-7139 seems, like this issue is not related to the thread. Can you open a new one with a Problem report id
I will be happy to take a look
w
Hi @freezing-printer-49373 , markdown formatting works on some occasions, some times it doesnt. If I specifically ask for a link ...sometimes the bot even makes the link up...even though all the links are provided in the KB in markdown formatting. Have you guys done any testing on this issue?
f
Yes, we are currently working through it. In a nut shell, GPT api is not providing the link in the payload, it's not systematic.
if you've noticed specific moments were it happens the most, you can open a problem report in a new thread, and ill bee happy to take a look
w
Thanks @freezing-printer-49373
32 Views