You Bot-cha! It’s Easy to Create a Rule-Based ChatBot using Azure Bot Service and InRule
From e-commerce to customer support to marketing, HR and more, a simple Google search makes it clear: chatbots are the future of business. In fact, a search of “bot business” delivers 280,000,000 results in Google (on 12 Aug 2019).
A recent Facebook study shines a light on the reason behind the surge in popularity of bot technology. The study revealed that 56% of people would rather use a messaging application than make a phone call to customer service. Hence, chatbots are one of the most commonly used bots in businesses today.
While the pool of options for chatbot services continues to grow, most of the technology presents a significant challenge: requiring a developer to maintain the logic through code.
Given the demand for chatbot services and the fact that InRule specializes in allowing business people to maintain decision logic, we wondered if we could combine these two, powerful technologies to create a chatbot experience.
We leveraged the Azure Bot Service to build a basic bot and irAuthor to create a banking rule application. Then, by calling the rule engine from the bot we could easily interact with the customer. Bots can integrate with different user-facing channels (like Slack, Skype, Messenger, etc.); for this example, we used Slack.
Here are the steps we took to create a rule-based chatbot:
- Create a bot with Azure Bot Service
- Create a banking rule application using irAuthor
- Call the rule application in bot code using Visual Studio
- Upload bot code to Azure
- Connect a bot to one of the available channels supported by Azure Chat bot
1. Create a bot with Azure Bot Service
The Azure Bot service provides a tool to build, test, deploy and manage all bots. Azure makes the bot creation and integration process straightforward. Follow these steps to create a basic web application bot, test the bot in the Web Chat and eventually download the source code to edit it. We used the C# template to create a bot using the Bot Framework SDK v4.
2. Create a banking rule application using irAuthor
Once we created and downloaded our bot code, we created a banking rule application using irAuthor. This is where the magic happens!
- The rule application accepts a question asked by the customer.
- The application then scans the question against the existing categories to pick an appropriate rule set to run.
- Each rule set has a list of questions:
- If a current session already has a response for that question, the response will be displayed to the customer.
- If a current session does not have an answer, the application will run the rule set to ask additional questions to collect relevant information.
- Once the application has all the information it needs, it stores and generates the response to the customer.
For example, if a customer asks for an account balance, the application would need to know the unique account number to display the account balance.
We used a Decision Table to map the customer’s question with the existing categories and the Vocabulary feature to make the Language Rule more concise and readable.
3. Call the rule application in bot code using Visual Studio
Once the rule application was ready, the next step was to call the rule engine in the bot code. The bot application stores the values to track existing customer responses.
4. Upload bot code in Azure
Update the code in Azure and use the Web Chat functionality to test the bot.
5. Connect a bot to one of the available channels supported by Azure Chat bot
Once the bot code is working and updated in Azure, integrate this bot with other channels such as Slack, Skype, Web App, Messenger, etc. We integrated our banking bot with the InRule slack channel.
By using InRule along with Azure Bot Service, it’s easy to automate interactions with customers, prospects, employees and more. Please comment below or reach out to us if you have any questions!