https://discord.gg/botpress logo
#🤝help
Sending user questions to Knowledge Base
# 🤝help
h

hallowed-lawyer-88533

06/27/2023, 1:01 AM
Hi New to Botpress. I would like to ask the user a series of questions, and then create a message like - "please give me a price for the following: model is @model, height is @height and width is @width" This message is then routed to the knowledge base (which is a pdf document with a price table) - and the price is returned. I'm struggling with sending the message. Can someone point me in the right direction please? Thank you.
a

acceptable-kangaroo-64719

06/27/2023, 10:27 AM
Hey @hallowed-lawyer-88533, knowlege bases aren't really the best tool for this use case. You can absolutely build this kind of thing in Botpress, but for best results I recommend using capture cards and transitions. Not only are today's LLMs kinda of bad at doing analysis, but there's no way to manually search the knowledge base in Botpress. But don't worry! We have capture cards that will let you ask the user a question and extract the right information from them. Height and width can use the "Number" capture type, and I recommend making a list entity for the models. https://botpress.com/docs/cloud/studio/library/#custom-entities Then you can use transitions like "If height > 10 && width > 10 && model == 'xyz' go to node A" to direct your user to the right information.
h

hallowed-lawyer-88533

06/27/2023, 10:39 AM
@acceptable-kangaroo-64719 thank you. I will have a look at what you suggested!
a

acceptable-kangaroo-64719

06/27/2023, 10:45 AM
Since you mentioned you're new, here's a suggested step-by-step on what to do: 1. Go to the library (📙 icon) and make a new list entity for your model names. 2. Make a new node called 'get model' and put a capture card (any type) in that node. Then, change the data type on the right side to your new list entity. Add a question like "What model?" to the capture card and have it save the answer to a variable called
model
3. Make a new node called 'get height' and put a Number capture card in there. Add a question like "What height?" and save the answer to a variable called
height
4. Make a new node called "get width" and do the same as step 3 5. Add "Expression" transitions to all of the nodes and link them up, one after another. To turn the transition to "Always," write
true
in the expression box 6. In the "get-width" node, you can add transitions to go to the right information with an expression like:
Copy code
js
workflow.model == 'model A' && workflow.height > 10 && workflow.width > 10
adjusting the model name and numbers as needed. These transitions can go to new nodes with text cards in them that contain the needed info.
It's a lot, especially getting started. If you need some tutorials, our Youtube channel has a lot of good ones https://www.youtube.com/botpress
h

hallowed-lawyer-88533

06/27/2023, 10:51 AM
@acceptable-kangaroo-64719 - great thank you. Is there a limit on the number you can put in the list entity. Yes I have watched most of the videos, can do the basic chat flows. Thank you again.
a

acceptable-kangaroo-64719

06/27/2023, 10:54 AM
I don't think there's a hard limit, but performance can get iffy if you've got a lot. It might be helpful to narrow them down into smaller categories- for example, leaf blowers, lawn mowers, hedge trimmers- instead of keeping everything in one big list entity.
h

hallowed-lawyer-88533

06/27/2023, 11:07 AM
Cool, that sounds like a good idea. I have something to try when I get the chance. Thank you.
3 Views