Cognitive Flow

In order to create the conversational intelligence for your chatbot, you are describing all conversations your bot can have with a user in the Cognitive flow in JSON format.

The Cognitive flow describes all conversations the bot can have. It also contains some general settings for your bot.

Each conversation is comprised of steps executed in a linear way. The bot will try to go through all of the steps in a conversation. You can define conditions on each step if you want it (or don’t want it) executed in certain circumstances.

The Cognitive Flow is described in JSON format (Bot > Cognitive Flow in Kinvey Chat Portal).

Structure

The default structure for your bot has three elements defining the built-in conversations, settings, and commands.

Here is a basic Cognitive Flow example:

{
  "conversations": {
    "conversation": [
      "steps": [
        ...
      ]
    ]
  },
  "commands": {
    "NEXT-PAGE": [
      "Next 5"
    ]
  },
  "settings": {
    "invalid-replies": [
      "I am not sure I understood what you said."
    ],
    "general-failure": [
      "We are experiencing technical difficulties at this moment."
    ],
    "previous-conversation-messages": [
      "I am going back to {{ conversationDisplayName }} now."
    ],
    "silence-timeout": 60,
    "persist-entities": [],
    "timezone": "Universal",
  }
}

Conversations

List of all conversations and definition of every conversation.

See Conversations page for detailed documentation.

Commands

NEXT-PAGE

List of expressions for the built-in NEXT-PAGE command.

Settings

Definition of all general bot settings (not specific to a particular conversation)

See Settings page for more info.

Basic Concepts

Automatic slot-filling

Slot-filling is the machine algorithm where you have a defined number of pieces of information (slots) to gather from your users. Each slot corresponds to an entity and a step in the cognitive flow. Thanks to the NLP Kinvey Chat can automatically fill some (or all) of the slots if the user writes them in some part of the conversation.

For example, if you need to collect for an appointment the doctor, the date and the time, you define 3 entities and 3 steps in the cognitive flow. But if the users say something like “Can I visit Dr. Smith on Wednesday afternoon?” Kinvey Chat will automatically fill the 3 matching entity values with Dr. Smith (doctorName), 21-03-2018 (date) and 12:00PM (time) and not ask explicitly about them.

Bot Memory

Kinvey Chat chatbots have long-term and short-term memory.

  • short-term memory - this is where all the information from the current conversation with the user is stored.
  • long-term memory - after a conversation is completed, all the information from the short-term memory is saved in the long-term memory. And then the short-term is reset.

Information in the long-term memory can be used for displaying suggestions to the user or automatically pre-filling some of the data in a conversation.

Read more about bot memory and how to use it.

Linear vs decision-tree

The steps of the conversation you define in the Cognitive Flow are executed in a linear way, one after the previous.

You can add conditions to each step so it is executed only if the conditions are met.

In a conversation with a user, the chatbot will always try to finish conversation by running all the available steps.

Types of conversations

There are 2 types of conversations the chatbot can have depending what you are trying to achieve with them.

Goal conversations

The goal is to complete a specific business process, e.g. book an appointment, make a request, etc. When the bot is having a goal conversation it will try to complete all the steps and keep asking the user questions.

Learn more about goal conversations.

Support conversations

These are used to help the user achieve a business process, such as provide billing info, get help, answer FAQs and etc.

One support conversation can be referenced from multiple goal conversations.

For example, if you need to collect contact information from the user, you can create a support conversation “Contact Information” once and then redirect to it from all goal conversations that need to collect such information.

Learn more about how to configure a support conversation.

Next steps

Defining Conversations