2 The Basics

Concepts

  • Intents—Categories of actions or tasks users expect your bot to perform for them.

  • Entities—Variables that identify key pieces of information from user input that enable the bot to fulfill a task.

    Both intents and entities are common NLP (Natural Language Processing) concepts. NLP is the science of extracting the intention of text and relevant information from text.

  • Components—Provide your bot with various functions so that it can respond to users. These can be generic functions like outputting text, or they can return information from a backend and perform custom logic.

  • Dialog Flow—The definition for the bot-user interaction. The dialog flow describes how your bot responds and behaves according to user input.

  • Channels—Bots aren’t apps that you download from an app marketplace, like iTunes. Instead, users access them through messaging platforms or through client messaging apps. Channels, which are platform-specific configurations, allow this access. A single bot can have several channels configured for it so that it can run on different services simultaneously.

  • Instant Apps—Instant Apps are self-contained, wizard-like modules that enable bot users to complete some task – a purchase that requires users to complete a form with specific field formats, for example, or an escalation.

  • Q&A—Your bot can also act as the interface to your FAQs or other knowledge base documents. The Bot Builder lets you integrate a Q&A service by importing sets of question and answer pairs.

  • Bot Builder—Not only does the Intelligent Bots platform provide its own A.I framework that allows your bot to parse and interpret user input, it also provides you with the Bot Builder, a UI for creating and managing all aspects of your bot, from building its cognition, to publishing it to a messaging platform.

How Do I Create a Bot?

Here’s a bird’s-eye view of bot development.
  1. Create Intents—Start off by creating intents. Intents illustrate your use case by describing the various actions that your bot helps its users complete. If your bot enables users to perform various banking transactions, for example, then you could create intents like CheckBalance or TransferMoney. Intents not only describe what your bot can do, they are also the key to your bot’s intelligence: they enable it to recognize user input because each intent has a set of typical user statements known as utterances associated with it. While these phrases share the same meaning, they make your bot resilient because they’re also varied (for example, What’s my savings account balance? and How much is in my checking account?). See Intents.

  2. Train the Bot—To enable your bot to reference intents when it parses the user input, you need to train it. Specifically, you need to train it with the intents and their utterances (collectively, the training data), so that it can resolve the user input to one of the intents. By training your bot, you leverage the language intelligence which is at the core of the Bots platform: its algorithms enable your bot to not only recognize the sample phrases that belong to each intent, but similar phrases as well. See Intent Training and Testing.

  3. Create Entities— In some cases, you may need to provide some context to enable your bot to complete a user request. While some user requests might resolve to the same intent (What’s my savings account balance? and How much is in my checking account? would both resolve to the CheckBalance intent, for example), they are nonetheless asking for different things. To clarify the request, you would add an entity. Using the banking bot example, an entity called AccountType, which defines values called checking and saving would enable the bot to parse the user request and respond appropriately. See Entities.

  4. Integrate Custom Components—At this point, your bot can recognize input, but it can’t respond to it. To put your bot’s intelligence to work, you need to add components and then later, create a dialog flow. Components enable your bot to do its job. There are two types of components: the ones provided by Intelligent Bots that perform functions ranging from holding the resolved intent to outputting text, and the ones that you provide. The components belonging to this latter category are known was custom components. Unlike the built-in components that you can use in any bot that you build with the Intelligent Bots platform, the custom components perform tasks that are specific to a single bot, like checking a user’s age, or returning account information. Custom components don’t reside within the Intelligent Bots platform, so for your bot to use them, you need to access them through a REST service. See The Custom Component Service.

  5. Create the Dialog Flow— Next, you need to give the bot the wherewithal to express its intelligence to its users by creating the dialog flow. The dialog flow describes how you bot reacts as different intents are resolved. It defines what your bot says to its users, how it prompts them for input, and how it returns data. Think of the dialog flow as a flow chart that’s been transposed to a simple markdown language. In Intelligent Bots, this markdown language is a version of YAML called OBotML. See The Dialog Flow Definition.

  6. Test the Bot—Once you’ve started your dialog flow, you can chat with your bot to test it out.
  7. Configure Channels—Users subscribe to your bot through messaging platforms such as Facebook Messenger. You don’t have to rewrite your bot for each messaging platform, but you do need to configure a channel for each one. Intelligent Bots enables you to integrate with Facebook Messenger quickly through its Facebook Channel. You don’t need to craft any REST calls to run your bot on Facebook. Instead, you complete a UI using artifacts that are generated by both Facebook and Intelligent Bots. See Running Your Bot on Facebook Messenger. To integrate your bot with other services, Intelligent Bots provides the Webhook channel. You build your own webhooks for these non-Facebook integrations. To help you out, you can use the sample chat server that we provide with the Developer Resources or create your own.