Mixing AI generated response with a knowledgebase
# 🤝help
a
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
Did you target the KB of the site? Or try adding in the prompt "using only your supplied knowledge bases". 🤔
f
Hey You can't query the KB from an AI card. You will have to use the Query Knowledge Bases card.
a
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
Use {{event.preview}}
a
then it spits out "2"...
f
Does the Query Knowledge Bases card spit out 2?
a
yeah...
f
Can you send a screenshot of your Query Knowledge Bases card
a
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
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
jeez thanks again mate
f
You are very welcome
a
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
What is your current prompt to the KB?
a
give me a full list of all the dishes
now it answers with undefined
f
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
there is
the problem shouldn'n be the info providfed
f
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
f
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
like a pdf document incuding that
?
the pdf is a excel with all the info
f
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
will do
really appriciate your time and help mate ❤️
f
Its a pleasure helping here