Now that we have prepared an FAQ list as mentioned in the previous post, we are ready to create our first chatbot.
Log in to api.ai (you can use your Google account if you want).
Create new agent
For a fresh account, no agents will be listed. But if you already have some agents created, like mine, you will need to click on the down arrow next to the current agent’s name, and scroll down to the bottom of the list and select “Create new agent”.
Create a list of intents
Now it is time to populate the intents. As you do this step, it will become clear what intents are – but there is a section to follow which goes into more detail.
1 Click on the + sign next to the Intents in the left pane to create a new Intent
2 Name the Intent
Use the section name as the name of the intent.
3 Add the list of questions
For each item in the right column of the table, add one “User says” entry. Once you are done, your Intent screen should look like below. Ignore the yellow highlights for now.
4 Add the link in the Response field
Now take the link on the left hand side of the table and add it to the Response text box. Your screen will look like below.
Leave the rest of the fields, like Action and Events, empty.
Repeat steps 1 through 4 for each FAQ link in the table you created from the previous post. When you are finished with all the links, your agent is ready.
Test the agent by using the interactive console on the right hand side
As you are creating the agent, you can keep testing it by using the interactive console on the right side. For example, here is how my agent responds when I ask a question.
Let us look at this in some detail. First, under User Says, you see what you just typed.
Next, the Response is what the agent will respond with when you deploy it. As you can see, it gives us a link to the API.AI documentation pointing to the definition of agents (as expected).
It also has, under Intent, “Agents Overview” which is the name I gave the intent. So API.AI has determined that the query that the user typed is similar to the User Says phrases which we had used when defining this intent. You should note that the phrase used for testing isn’t an exact match with any of the items in the list of “User says” phrases for that intent, but it is close enough that API.AI can decide that is the intent it should be mapped to.
Finally, it also shows a couple more things such as Action and Parameter, which we will ignore for now.