Get a head start on developing your own Facebook Messenger chatbot with the starter kit and tutorial on Hasura Hub
There were competing bot platforms already when Facebook made its announcement, but Messenger’s user base (> 1.2 billion users at last count) and the risk of getting left behind by more nimble competitors — A Facebook study says 53% of users are more likely to do business with a business that can message, and chatbots scale more effectively than call centers — meant businesses could no longer ignore this customer engagement channel.
Since the announcement, over 100,000 bots have been deployed by approximately 100,000 developers on Messenger. There are also indications that Facebook will soon bring chatbot functionality to its other big messaging platform, WhatsApp.
What can chatbots be used for?
Chatbots allow you to provide customer or context specific information at scale, without having to invest in an expensive call center. Even for those businesses that have their own call center (or have the capability to setup their own call center), chatbots still cannot be overlooked : millennials increasingly prefer messaging over other forms of communication, with over 67% of people intending to talk to a business via chat in the near future.
Chatbots can be used for:
- Customer support: This is the most popular use case for chatbots. Customer support queries frequently follow an extreme version of the Pareto principle (most queries are around common themes). Chatbots can help you handle these queries effectively and reduce response times, without further burdening the customer support team.
- Customer engagement: Chatbots can also be used to increase user engagement (often in fun ways). For example, an e-commerce fashion brand can use a chatbot to guide you through the discovery and selection process. Whole Foods launched a chatbot that will let you find recipes using emojis, to add to the in-store shopping experience.
- Personalised communication: Chatbots provide you with the ability to offer personalised communication to a large customer base. Both customer support and customer engagement can become more powerful when a bot combines information you have on past behaviour with information about current behaviour or context, to offer personalised messaging.
- Conversational commerce: In addition to the above, chatbots can also be integrated with your shopping cart, payments and order fulfilment workflows to allow your customers to order from within Messenger directly.
(This list is roughly in decreasing order of ease of implementation and increasing order of sophistication).
Types of chatbots
Chatbots are primarily of two types:
- Chatbots that function based on rules: This bot can only respond to specific input. These are still valuable, especially in cases where the input data is structured.
- Chatbots that use some form of machine learning/artificial intelligence: In most cases, user input will not be very structured. Some kind of machine learning will be required to parse the input, and the bot will have to be programmed to continuously learn as it has more and more conversations. While this sounds very complex, the good news is that there are several third party tools that can help you get started.
Getting started with the quickstart on Hasura Hub
To get started with developing your own chatbot, go to the Facebook Messenger Bot quickstart page on Hasura hub.
Hub is where you will find community projects that you can extend and modify, to give you a headstart on developing your application. These projects range from a react + nodejs quickstart to a sample ecommerce schema to sample apps such as this one.
This quickstart deploys a simple rules based chatbot that when given a movie name replies back with details about the movie along with a poster image. The bot was built using the Node-j.s Express framework, and uses APIs provided by https://www.themoviedb.org/ for getting information about a movie. It also has an in-built typing indicator.
For the Facebook servers to talk to our server, the endpoint URL of our server should use a secure HTTPS URL — Hasura provisions these automatically.
Extending the quickstart
Hasura gives you the ability to deploy your own custom APIs and integrations with just a gitpush. This means that it is really easy to extend the functionality of this chatbot, or add custom functionality.
Here are a few ideas:
- Change the data source/use-case from movie information to something else. You can find a list of free data sets here. In case the dataset provider does not allow access over a REST API, simply import the data into a Hasura project as a CSV, and Hasura’s data APIs give you APIs instantly.
- Integrate with a service provider such as Wit.ai (owned by Facebook) or Dialogflow (owned by Google) to add Natural Language Processing and Machine Learning capabilities to your bot. Both offer free plans to help you get started.
You can get more inspiration from the list here.
In case you do extend the project, do publish the result on Hasura hub, so everyone benefits from your work.
As part of the first Hasura #Pub2Hub challenge, we are also giving away Hasura swag boxes and 3 months of hosting credits to the best published projects!