https://discord.gg/botpress logo
#🤝help
Mixing AI generated response with a knowledgebase
# 🤝help
a

adorable-ability-56067

02/14/2024, 7:12 AM
I'm having trouble integrating a AI card with the inputs from the user and also generating a response bsaed off the provided Knowledge Base. I'm currently building a bot for a compamy that sells pre-cooked meals. The idea is that this bot can generate mealplans taking in count the user goals such as loosing weight or gaining muscle, their gender, weight, height, etc. I have a csv file and a web to use as knowledge for the bot. Both include all the meals and the calories and other macronutrients they contain. The bot first captures all the data and saves it to variables. Then I use the AI card to make it generate a mealplan and it does use those variables previously captured, but it won't make use of the knowledge base, so the mealplans that it generates doesn't contain the products the company sells (provided in the KB). Am I doing something wrong? How can I fix this issue? Thx for all the help ^^
d

delightful-yacht-58732

02/14/2024, 8:41 AM
Did you target the KB of the site? Or try adding in the prompt "using only your supplied knowledge bases". 🤔
f

fresh-fireman-491

02/14/2024, 3:22 PM
Hey You can't query the KB from an AI card. You will have to use the Query Knowledge Bases card.
a

adorable-ability-56067

02/14/2024, 5:16 PM
hm, how does that work? I tried and I get "undefined". How can I make sure it also takes in count the input from the user?
f

fresh-fireman-491

02/14/2024, 5:25 PM
Use {{event.preview}}
a

adorable-ability-56067

02/15/2024, 7:15 AM
then it spits out "2"...
f

fresh-fireman-491

02/15/2024, 3:58 PM
Does the Query Knowledge Bases card spit out 2?
a

adorable-ability-56067

02/15/2024, 5:35 PM
yeah...
f

fresh-fireman-491

02/15/2024, 7:10 PM
Can you send a screenshot of your Query Knowledge Bases card
a

adorable-ability-56067

02/15/2024, 9:50 PM
I'm sorry that almost everythign is labeled in spanish... if you need any help just let me know
I'm probably doing somehting really wrong or some stupid error
Thanks for your all your time and help ^^
f

fresh-fireman-491

02/16/2024, 6:10 AM
The text in the query should be a question. This can either have the variable {{event.preview}} to get the users question or you can set up your own question like "Generate a meal plan based on x, y, z" where x, y, z would be variables that the user set like it should be a vegetarian meal plan. The reason why it's just saying "2x Is because you got {{event.preview}} in the text card, this will just echo whatever the user sent which would be 2. Take a look at this stream where Robert uses the Query Knowledge Bases card.

https://youtu.be/R8ylktVSPVQ?si=HwI4JJ1l6mq-C7v-

a

adorable-ability-56067

02/16/2024, 6:23 PM
jeez thanks again mate
f

fresh-fireman-491

02/16/2024, 6:39 PM
You are very welcome
a

adorable-ability-56067

02/17/2024, 11:15 AM
alright, I maneged to get a response from the query KB, although I still have the same issue, integrating user data with the actual KB and generating an answer based on both
f

fresh-fireman-491

02/17/2024, 11:19 AM
What is your current prompt to the KB?
a

adorable-ability-56067

02/17/2024, 11:26 AM
give me a full list of all the dishes
now it answers with undefined
f

fresh-fireman-491

02/17/2024, 12:07 PM
Do you have a full list of all of the dishes in your KB?
It can only answer what you have in your KB
a

adorable-ability-56067

02/17/2024, 4:52 PM
there is
the problem shouldn'n be the info providfed
f

fresh-fireman-491

02/17/2024, 5:36 PM
It usually is. Can you export your bot and send it to me in a DM so I can take a look? I am on my way to the airport right now so I might not have an answer before tomorrow
a

adorable-ability-56067

02/17/2024, 5:44 PM
f

fresh-fireman-491

02/17/2024, 5:54 PM
Where is the list of dishes here?
I would recommend you to create a Faq
Like Q1: Give me a full list of all the dishes A: A list of all the dishes here. Q2: dsdasdas A: dsdasdsa
a

adorable-ability-56067

02/17/2024, 5:56 PM
like a pdf document incuding that
?
the pdf is a excel with all the info
f

fresh-fireman-491

02/17/2024, 5:59 PM
You can use the tables instead of a pdf for excel sheet.
Its in a language that I don't know and I can't copy the text to translate it but it doesn't look like a list of dish names.
Try using a table
And a faq
And see it helps
a

adorable-ability-56067

02/17/2024, 6:38 PM
will do
really appriciate your time and help mate ❤️
f

fresh-fireman-491

02/17/2024, 6:57 PM
Its a pleasure helping here