About AI Generated Text and links
# 🤝help
s
Hello. I am looking for help with the following strange behavior in my bot. I have created a (KB) in my botpress with links to a client's website. It includes all the information about their products and all available categories. At some point in the flow, when a customer asks about specific products, my bot suggests some products and generates links for each of them, as well as a link to their main category. All of this works together using Raw input cards, Query Knowledge Bases, AI Generated Text, and a text card with {{workflow.moreInfo}}. These are all interconnected flows stored in variables. The issue I am facing is that the response is about products that are not from the client; sometimes it includes links that do not exist, and generally, the link to the main category is also incorrect. In my AI Generated Text card, the prompt specifically states to only show information available in the KB, and I have even added the URL within the prompt to ensure that it should only display information from my client. However, it is not working. Any ideas on how I could correct this error?
g
Have you tried using AI task instead ?
And could you tell/show us more about your cards to see what you've set up in each
s
Hey buddy! I tried Ai Task, and the result regarding link creation is the same. It generates links that are not on my client's website. In the KB, I have the URLs of the website with their corresponding categories and product links. The flow is in Spanish, and the idea is that when the customer delves into their question, the bot will consult the KB, check which options fit the customer's request, and display this information. For example, if the customer asks about industrial refrigerators for dairy products, the idea is to show two or three options that fit that query and generate a link to that product. However, when asked about these specific features, it generates a link for "neveras para lacteos" and "almacenamiento y refrigeracion" that don't exist on my client's website.
g
So like it is giving answers that arent in your knowledge base?
Well if I were you I would first try without an Ai Task to get links from the bot and see if they are the good ones (do not forget to add a text card with @workflow.answer2).If not that means your Ai task might not be the ond to blame, but if it works without Ai task, then Id say it is most likely an error coming from your Ai Task
Maybe @fresh-fireman-491 would help you better with this
f
The AI cards can't see what information you have in your KB so prompting it to only show information from your KB won't have an effect. The AI Task Card in Botpress is designed to enable users to perform tasks using generative artificial intelligence. The AI Generate Text card is a specific type of AI Task that helps you generate text based on a prompt and a few settings. This is useful for countless different use cases such as: Generating catchy blog titles from a topic or keyword Summarizing long texts or documents in a few sentences Creating articles from bullet points or outlines Writing product descriptions that highlight the features and benefits Crafting creative content such as stories, poems, lyrics, and more! I would recommend using the AI Task for this job. As stated earlier, the AI cards doesn't have access to the KB so you will have to give the AI Task card all of the links. Docs about how to use the AI Task: https://botpress.com/docs/cloud/toolbox/ai-task/
g
@swift-garage-22701 I didn't see that but you need to also add your @workflow.answer2 in your AI task input if you want to modify something from your Query Knowledge Base
s
Thanks for your responses. I've used the AI Task card, but I'm still in the same situation. It generates a link to a destination that doesn't work. I get that with AI Generated Text, you can't have specific instructions for things that can be queried with KB, but it seems like AI Task isn't working for me either. Additionally, I've created some extra tables with all the products, names, and links to each of the client's categories, but they still don't show up anywhere in the responses, and I really can't figure out what else I can do.
If it's of any use, I'll share my complete bot flow with you. I would appreciate any help since it's really frustrating not making progress in this regard despite the efforts.
g
Have you activated answer manually on your chatbot (in your knowledge agent) ?
I also do not know if you have published the recent version but something is for sure is that you have some errors like you should put an always expression card after using capture information cards
I think you need to use carousel to get links but not sure. Either way I'd recommend you putting information in a rich-text format for your knowledge base
You can't even get a link out of your KB, and quite frankly you've set up so many things and I have an hard time testing
And I have never tried getting getting links from KB
Say first, second or third
It work to get links (I've written them in the KB format rich-text)
Wait I haven't published it lol
This should work but I don't recommend you importing it into a chatbot you are currently building but rather a new one where you haven't done anything important
s
Sure, thanks. Okay, let me try transferring the information to Rich Text and test it again.
I dont have answer manually in the knowledge agent, this is important?
g
Not sure but I know I had some weirds things happening when I had it off
s
Ok, thanks. I'll also run some tests on that end.
g
@swift-garage-22701 When using tables you should be doing this to get the link :
Now if you want to send the link + other text within a message you can just put {{workflow.test[0].Links}} in the input section of the AI task, or put it anywhere in a text card
I think this should cover the link part (but you should take a look at the table I've set and the find records card)
s
I understand. However, my bot's task is a bit more complex. The flow itself is for a customer to select a category with buttons, a subcategory with buttons, and then they can make their inquiry. It's at this point where my bot acts strangely. If a customer asks, for example, about refrigerators for dairy, the idea is for the bot to query the KB, validate the categories, and other characteristics that the customer may have consulted, and then offer some product options along with their links. So, it's not about always providing an exact link in response to a question but rather analyzing the information the customer has inquired about.
This is an example of the products in a category with links for each product in the table
g
With that template you can Ask Botpress, Google, or Amazon
@swift-garage-22701 Do you have a more advanced version of your bot than before, like half of the subjects that should be linked aren't
s
Actually, no. The only modification made was to switch from AI Generated Text to AI Task.
Oh yeah, and after watching one of the YouTube tutorials, I created a response table where I mark if it's good or not and the reason why it's not good.
The idea behind trying tables with the products and their links was to see if it somehow helped with the responses given to customers asking for product suggestions.
g
You have nothing linked to your nodes I don't even know what you are trying to accomplish
What am I supposed to do with all these unlinked nodes :
s
It's weird, that card should move to the response one.
g
no it shouldn't
you haven't set most things right
First of all, I don't recommend you linking cards with the add card, but instead you should use the expression card
and in your case each choices should be linked to the node you want it to be in order to work
s
Sure, I'll keep your observation in mind. What's strange to me is that during simulations, it hasn't generated errors in the transition between different cards. Also, in what you have open, the nodes aren't connected, but in mine, they are.
g
Probably because you didn't publish your bot before exporting it
s
Ahhhh
It makes sense.
g
I'd recommend calling all your rows with links Links Because otherwise the code I set up for you won't work
s
Ok, thanks
g
You will need to adjust some things like tables and how content is searched but you're the one who knows best what you want to achieve. I probably won't help you any further until you've finished setting things up like the products, maintenance and consulting and all that comes after. Without a well-defined setup, navigating through the bot becomes challenging, and finding optimal solutions becomes more time-consuming (and I also lose time by setting this up what weren't already set up like linked nodes). Let's focus on getting these initial elements in place, and then we can proceed with enhancing the functionality together.
But maybe other people are ready to help you
s
Yes, I'll proceed with what you mentioned, and any updates I'll let you know here. Thanks for the help.
g
You're welcome
@melodic-florist-75184 maybe this could help you a bit
I think this one is by using AI cards with a rich text knowledge base
And this would be with the table
7 Views