User Guide - SilasBerger/coachbot-brain GitHub Wiki

Using the cloud version

Go to our integration web page and start chatting.

Note: Currently, the system considers every user as the same one. If you experience unexpected behavior, you can reset the context by sending /reset. The bot will be ready to start a conversation after that.

Setting up the project

If you want to host the project yourself, follow these steps.

  1. Clone this repository
  2. Start the business logic server using node . from within the repository root. Make sure that the server is publicly accessible (e.g. using the ngrok tool, when hosting on a machine in a local network). The application runs on port 3000, as stated by its console log.
  3. Create a new agent on Dialogflow. On Dialogflow, import our CoachBot agent from the CoachBot.zip folder located in the /misc folder of this repository. Note: this hasn't been tested yet!
  4. In Dialogflow, go to the Fulfillment page and set the webhook URL to your server. The webhook endpoint of the server is /webhook (example: my.coachbot.ch/webhook). Further information can be found here.
  5. You can now use the "Try it now" input field in Dialogflow to talk to the bot.
  6. Alternatively, you can take the contents of the /misc/coachbot folder if this repository and upload them to a web host, as an integration page. Note: You will need to replace the iframe element in index.html with the one for your Dialogflow agent, which can be obtained on Dialogflow, under Integrations -> Web Demo.

Expected dialog flow

Any input will start the conversation. The bot will then ask you how you are feeling. Currently supported feelings are happy, sad/depressed, angry, and anxious (although the subsequent dialog is not yet implemented for anxious). All other inputs will trigger the bot to suggest you a lesson that he wants to teach you. You can accept or decline it.

At any point during a conversation, you can say that you want to change the subject or stop chatting. The bot will take appropriate action.

Note: After the bot has said goodbye, any new user input will start a new conversation.

Limitations

  • For testing purposes, the bot doesn't exclude a lesson (on CBT concepts) after it has been taught once. In a production version, the same lesson would not be taught twice.
  • Although CoachBot brain fully works on a per-user basis, the system currently considers every user as the same one. If multiple users were to use CoachBot at the same time, this would lead to unexpected behavior. This is due to the fact that we do not yet identify a user on the integration web page, nor do we store user data yet.
  • Due to our architecture, 1 request = 1 reply. If the bot has written something, you have to write next. The bot cannot initiate a conversation.

Troubleshooting

  • If you experience unexpected behavior, you can reset the context by typing /reset. The bot will then be ready to start a new conversation.
  • If your first text messages doesn't get a response (i.e. times out), this may be due to the application going to sleep on Heroku. Just try again, and it should work. Maybe type /reset to be sure to start a fresh conversation.
  • If you experience further difficulties (e.g. server crashes), contact Silas Berger ([email protected])