Sending user questions to Knowledge Base
# 🤝help
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.
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. 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.
@acceptable-kangaroo-64719 thank you. I will have a look at what you suggested!
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
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
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
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
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
@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.
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.
Cool, that sounds like a good idea. I have something to try when I get the chance. Thank you.