Check out my courses Learn Dialogflow ES and Learn Dialogflow CX if you would like to learn Dialogflow in depth.
In this article, I will explain how you can quickly turn an FAQ page into a Dialogflow chatbot.
Let us consider this example page which talks about COVID vaccination FAQ in India.
This would be a one-and-done FAQ chatbot. That is, usually, you do not expect follow up questions referencing the previous answer. (Answering follow-up questions would require the use of followup intents or input and output contexts, for which you need to do more work and hence spend more time).
Before we move on to the rest of the article, I will address an objection some people will have: “Why not just use the Dialogflow Knowledge Base feature?”
Here are some reasons:
|Intent Based FAQ Bot||Knowledge Based FAQ Bot|
|How we build it||Using intents and training phrases||Using the knowledge base feature|
|Support for multiple responses for the same query||No||Yes|
|Multiple training phrases per intent||Yes||No|
|Supports entities in training phrases||Yes||No|
|Support for contexts (and follow up)||Yes||No|
|Easy to construct rich responses (e.g. for Dialogflow Messenger)||Yes||No|
|Use term reinforcement for adding weights to specific words and phrases||Yes||Blackbox|
|Allows us to minimize intra-intent variance and maximize inter-intent variance (as recommended by Google)||Yes||Blackbox|
Except for being able to get multiple responses for a single query (highlighted), you can see that an intent based FAQ bot gives you a lot of benefits and much fewer limitations when compared to knowledge based FAQ bots.
You might still decide to use the Dialogflow Knowledge base features, but I am presenting a case for the pros and cons of using the Knowledge base feature. If you decide to just use an Intent based FAQ bot, the rest of the article explains how you can build it out quickly.
Convert an FAQ page into a Dialogflow chatbot
1 Prepare the CSV file
First you should prepare a CSV file with exactly two columns: Query and Response.
Here are the steps:
Make sure you are logged in to Airtable
Go to this Airtable table and click on “Use this data”
Create a new workspace and new base to use the data.
You will see that this will automatically import this table into your Airtable account. You can adjust the height of the rows to be able to type out the information more easily.
Now copy the questions from your FAQ page and paste them into the Query column. Copy the answers for those questions and paste them into the Response column.
You can add as many rows as you want.
When you are done with filling out this table, click on “Download CSV” from the Menu and download this list of questions in CSV format.
2 Convert it to Dialogflow agent
Log in to the BotFlo app.
From the menu, select FAQ Bots > Simple (2 Column)
Select the language of your bot, as well as the timezone.
Select the CSV file you downloaded in step 1.
Click on the Upload file button
On the next page, you will see a preview of the contents of your CSV file.
Click on the Convert button.
You will be prompted to download the agent ZIP file. Download this file to your local computer.
3 Deploy the bot
In your Dialogflow console, go to Settings.
Click on the Restore agent button.
Select the agent ZIP file you downloaded in step 2 and use it to Restore.
Once the Restore is complete, you can go to the Intents and see that your bot has been created.
You can deploy the bot in one of two ways.
You can use the Web Demo.
Note that the Web Demo integration is very limited and doesn’t allow clickable hyperlinks.
You can also use the Dialogflow Messenger integration.
In the Dialogflow Messenger integration, while hyperlinks inside text are not clickable, you can create clickable hyperlinks using the custom payload feature.
In fact, you can use BotFlo to visually edit the hyperlink and copy paste the custom payload.
Once you generate the custom payload in the BotFlo tool, copy paste it into your Dialogflow intent.
You will now be able to see this as a clickable hyperlink in the Dialogflow Messenger integration preview.
Why not simply copy/paste?
You can also do all this by simply copy pasting this information into individual intents. But there are two problems with that approach:
1 unlike the spreadsheet view, you cannot get a quick overview of what is in your FAQ chatbot inside the Dialogflow web app without clicking into each intent
2 as you add more and more FAQ questions Dialogflow web app usually gets slower and slower.
The more FAQ questions you have, the more tedious it is to do everything inside Dialogflow.
Can I use Microsoft Excel or Google Sheets instead of Airtable?
Yes, you can use any spreadsheet software which allows you to create a CSV file. Airtable allows me to provide a template that you can just start typing into and so is a little less error-prone.
This website contains affiliate links. See the disclosure page for more details.
"The magic key I needed as a non-programmer" The custom payload generator was the magic key I needed (as a non-programmer) to build a good demo with rich responses in DialogFlow Messenger. I've only used it for 30 minutes and am thrilled. I've spent hours trying to figure out some of the intricacies of DialogFlow on my own. Over and over, I kept coming back to Aravind's tutorials available on-line. I trust the other functionalities I learn to use in the app will save me additional time and heartburn. - Kathleen R Cofounder, gathrHealth