Building a bot using api.ai
Recently I found myself wandering into the concept of bots and conversational programming if I may call it so, I stumbled upon API.AI, a website promoted by google to create conversational user experience for a much natural approach to app interactions.
It seemed quite simple to understand at first and then all the stuff gets confusing. But eventually it slowly sunk in. Let me give you a quick bite on how to begin make a bot in api.ai.
Begin by signing in with your google account. After this you will begin by creating a new Agent.
Google does provide you with some sample data that will be populated into your agent if you want to understand its potential, but we will begin with a clean slate. I do encourage you to check those sample data out to get a better understanding of how stuff were meant to be used.
An agent has 3 major components.
- Intents
- Entities
- Response
Intents
There are the inputs what people usually ask the bot.
Entities
These are what people categorize data into. More like a variable in development terms.
We can create our own entities from the entities page
Here we create an entity called options. It well have 2 possible results. Agree or disagree ..and a set of words that will mean either of those options. API.AI also gives you some inbuilt entities under the @sys namespace.
You can add new ones. You can make entities compulsory. If so you can prompt the user until he/she supplies the information.
Response
The reply that is sent to the user after you have satisfied all that you needed to know from the user’s intent.
Testing our work
Where do we go from here…
If you dial into the options, you’ll find a ton of integrations with api.ai that will save you a lot of time and engage with users in a great collection of platforms.