Skip to main content

Top 5 tips for developing a Chatbot

This is different from my usual blog posts but I have been sitting on this for some time. I have been working with Chatbots for about 1 year now. Been on and off various engagements. So, I wrote something to make it a a bit clearer for those wanting to develop it and those wanting to know about it.

Chatbots are very trendy these days and thought I would write up some personal learnings I have made. Chatbots have existed for many years but the technology has been democratised like many things in Azure. You can literally build a bot for free of charge (of course you have to invest a bit of your time). A user would generally communicate through a chat window and with the addition of cognitive services, you get a really powerful tool.

Below are my top tips for when building your first chat bot.

1. A chat bot must have a purpose

There are a few forms of chat bots out there.

a) General Chatbots – Alexa, Google, Cortana, Siri, Watson. This is the big problem these major companies mentioned are trying to solve. Some are very similar and some are very unique in the way they are tackling the problem. A while back Alexa and Cortana have signed an agreement. This may seem odd at first but it benefits bot companies. Rather than competing with each other, their partnership offers them a greater reach.

This is not the area for every company. It requires huge investment.

b) Domain Specific and/or Task Specific – Some examples are Alarm (Wake me up at 7am tomorrow), Weather (What’s the weather today in Perth), Health (Natural health advice), Retail (Product recommender), Company Policies (QnA)

These are some examples but the application is endless. With the toolkits available you can build a chat bot that has deep knowledge about a specific domain or a specific task. If you can focus on solving a problem for the domain then the application has purpose.

2. Know your audience

Know your audience before you develop your chat bot. If you are developing a chat bot for business users, make sure to communicate to them at the same level. Don’t try to tell jokes or deviate from your purpose. Some would call this a personality but most business users don’t expect a personality when they are performing a task that is supposed to be simple.

However, if you are developing for a consumer market, you could add personality to your chat bot. Making the users experience less serious and a bit of fun. You could tell a random joke if the user asks. You could personalise the message and try to up sell.

3. Keep it up to date

A chat bot should be well trained and kept up to date to provide the user with the best possible answer. A stale chat bot will die a lonely death and be forgotten. Remember, users don’t uninstall a chatbot. They merely stop using the chat bot and loses its relevence.

4. Be helpful

If your chat bot does not know how to answer a question. Don’t say you don’t know and stop there. Offer suggestions or some kind of summary of what the chat bot can do. For example, a user may enter a topic that is unrelated. The chat bot can respond with “I don’t understand” but you can improve this response by being helpful. Tell the user what you can do. “I don’t understand but I can help with booking your leave”. We could provide buttons or dialogs for the user to enter one of these conversations.

5. Design your flow

This sounds obvious but many forget. Before you begin any development, even a prototype, design your conversation dialog. You will see how many ways you could achieve the same thing via a conversation.

Think of a chat bot for booking leave. You could provide a wizard type dialog. Asking various questions such as; What date, how many days, what type of leave etc. Alternatively you could just build language understanding to interpret a single sentence.

User: “Book me annual leave starting next Monday for 5 days”.

From this one line we could interpret the following:

a) Type of leave is Annual leave

b) Date – starts next Monday

c) Duration – 5 days


A bonus tip is to watch this youtube video. I learnt so much and made me reflect a number of things that I have done.

https://youtu.be/aHI8qfofH4c?t=1032

Take away quote that really resonated with me “Solve one thing and solve it well.

Popular posts from this blog

AX - How to use Map and MapEnumerator

Similar to Set class, Map class allows you to associate one value (the key) with another value. Both the key and value can be any valid X++ type, including objects. The types of the key and the value are specified in the declaration of the map. The way in which maps are implemented means that access to the values is very fast. Below is a sample code that sets and retrieves values from a map. static void checkItemNameAliasDuplicate(Args _args) { inventTable inventTable; Map map; MapEnumerator mapEnumerator; NameAlias nameAlias; int counter = 0; ; map = new Map(Types::String, Types::Integer); //store into map while select inventTable { nameAlias = inventTable.NameAlias; if (!map.exists(nameAlias)) { map.insert(nameAlias, 1); } else { map.insert(nameAlias, map.lookup(nameAlias) + 1); } } //retrieve fro...

AX - How to use Set and SetEnumerator

The Set class is used for the storage and retrieval of data from a collection in which the values of the elements contained are unique and serve as the key values according to which the data is automatically ordered. You can create a set of primitive data types or complex data types such as a Class, Record or Container. Below is sample of a set of records. static void _Set(Args _args) {     CustTable       custTable;     Set             set = new Set(Types::Record);     SetEnumerator   setEnumerator;     ;     while select custTable     {         if (custTable && !set.in(custTable))         {             set.add(custTable);         }     }     if (!set.empty())     {    ...

Approve Workflow via email using template placeholders #Dyn365FO

Dynamics 365 for Finance and Operations has placeholders which can be inserted into the instructions. Normally you would want this to show up in the email that is sent. One of the most useful ones is the URL link to the exact record that you are approving. In the workflow configurations use the placeholder and build up your message. Towards the end it has workflow specific ones. The URL token is %Workflow.Link to web% . For the technical people the token is replaced in this class WorkflowDocumentField. This is what I inserted into my email template. <BODY> subject: %subject% <BR> message: %message% <BR> company: %company% <BR> for: %for% <BR> </BODY> Should look like this. The final result looks like this. If you debug these are the place holders that are put together.