I’m trying to build a student information chatbot where all the details about students are stored in an external database. I want to know how can I connect and extract the information. I’m new to bp btw.
@NikhilJoshua The best way would be to create a module.
Your module would:
- Connect to the mysql database using knex
- Expose an API so you can query that database
- Create actions that query that API
There’s more informations for module creation here :https://botpress.io/docs/developers/create-module/
To connect to your mysql database, you can use Knex: https://knexjs.org/
Thanks, I need small clarification in the second point. I don’t exactly understand “Expose an API”. Infact I have a hard time understanding API for AI. I’m kinda new to this stuff
@NikhilJoshua Basically, since you need to access data from a custom source, you need to link that source to Botpress. Your module will expose a REST Api, then you can consume it using actions.
Here’s a basic example on how to do that:
@NikhilJoshua You are welcome ! We will release a new version tonight, and we’ve included an example on how to create a complete module.
Feel free to use that template to get a head start: https://github.com/botpress/botpress/tree/11.5.x/examples/module-templates/complete-module
Cool Thank you