Building bot-ready knowledge bases #3: Objectives for the grocery shopping chatbot

How to improve the quality of your knowledge base and the efficiency of your AI-based delivery system.

This post is part of a series. For more information and links to other posts in the series, see the “Building bot-ready knowledge bases” home page.

Setting objectives for the grocery shopping chatbot

Before we dived in to bot-creation activities in Dialogflow (a Google company and product), our chosen AI environment for the grocery shopping chatbot, we decided what it is we wanted our bot to be able to do.

Here are our four main objectives, which are illustrated and discussed in greater detail below:

  1. Chat with the user at a minimal level
  2. Answer from a set of prescribed questions and answers about grocery shopping
  3. Refer users to knowledge base articles for more information
  4. Defer if user questions are beyond the bot’s restricted domain.

1. Chat with the user at a minimal level

We wanted our chatbot to be capable of making casual smalltalk with the user. Smalltalk support is a standard part of Dialogflow and can be simply enabled.

Note the cleverness of our bot in its response to the user’s “good evening” greeting!

GROCERYbot chatting with user
GROCERYbot chatting with user

2. Answer from a set of prescribed questions and answers about grocery shopping

If a user question matches or nearly matches a question in a prescribed set (for example, a set of frequently asked questions (FAQs)), provide the answer directly to the user.

For example, in the following image the bot has answered the user’s question about why she should buy canned goods.

GROCERYbot answering questions from FAQs
GROCERYbot answering user questions. The answers are available in the FAQs.

3. Refer users to KB articles for more information

If a user question is not in the prescribed set, but is closely related to the text in a grocery shopping knowledge base article, refer the user to the article.

For example, in the following image the bot has referred the user to the “Canned Goods: Prices” article to get pricing information.

GROCERYbot referring user to KB article
GROCERYbot referring user to KB article

If this chatbot were to be further developed, Python scripting could be added to serve up the actual KB article to the user. Since this project is only a proof of concept, we have chosen not to add that capability here.

4. Defer if user questions are beyond the bot’s restricted domain

If the bot doesn’t believe it can answer a user question, it should politely defer along with a hint of what kind of queries it is capable of handling. (The bot can be told explicitly to refuse to engage with the user on particular topics, as explained in future blogs.)

For example, in the following image the bot has deferred on questions related to “drinks” and “dairy products,” because it has been trained only on “produce” and “canned goods.”

GROCERYbot deferring on answer to user's request
GROCERYbot deferring on answer to user’s request

What’s next?

In blog #4 of our “building bot-ready knowledge bases” series, we’ll talk about the Dialogflow console, and the features we used in building our grocery bot.