In 2017 we here at OrderStack had conceptualized an idea for food ordering chatbots for restaurants. Helping restaurants by providing them a virtual host and creating an online presence.

Overview

A Facebook Messenger Chatbot.
Natural Language Processing.
Small Talk Enabled.
User Context Management.
Reduce User Ordering Time.

Project Lifecycle:

Requirement Gathering

We got into inter-team brainstorming sessions on how the flow of the bot should be and the features that it will have apart from the food ordering flow. We also researched the Facebook Graph API to handle the messages and also to figure out the challenges on the Messenger UI while giving in responses to the users. Also looked into a lot of other chatbots on the Messenger Platform to study the flow of non-food-ordering chatbots.

Analysis

For the development plan, we first figured out a simple user ordering flow and thought about the functionality around it. Also, we decided to go with MongoDB as the database used to store all user messages and user information. We planned on creating a modular NodeJS server structure that interfaces with the Facebook Graph API. We also preemptively thought out that complex functionality might be added, so to keep the entire application highly modular to seamlessly add functionality if needed. We also prototyped a “fixed reply” chatbot to understand the workings of the Facebook Graph API.

Development

Based on the research in the Analysis Phase we chose a Waterfall Development Approach.

  1. We first created a modular server structure for API integration.
  2. Also integrated MongoDB to store the user messages and storing the user information.
  3. Wrote logic for creating user flows and integrated DialogFlow for Natural Language Processing.
  4. Created intents to help with user flows in DialogFlow and created profiles for restaurants to upload menu items and customize messages for the users.
  5. Also developed an Admin Panel for the restaurants to manage their menus and custom information about the restaurants.
  6. We also integrated ElasticSearch to search for food items based on the user input.
  7. Also created a Restaurant Facing ChatBot for the owners or managers of the restaurants to manage the User Facing chatbot through the Messenger Interface itself.

Testing

We tested our bot internally by setting up a fake restaurant profile and menu. Our team tested this out for a week internally. Then we shifted the chatbot to UAT where we ran a pilot with a restaurant for 1 month.

Deployment

In the deployment phase, we had to deploy the main application which was in NodeJS on a server with 4GB RAM, the server was also running the MongoDB instance and the ElasticSearch instance. The ElasticSearch instance is a Java Application which takes in a lot of RAM and that needed this entire server to have RAM enough to support all the 3 instances.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store