Conversation

A conversation is an interaction between user and bot, it consists of one incoming message and one or more responses. The system will never send a message to user by itself. Every message coming to the user is triggered by an incoming message. Incoming message can either be triggered a user message, or by systems such as scheduler / broadcaster.

Figure 1

Process Workflow

Whenever a conversation is triggered, following workflow is processed:

  1. Session object will be fetched
  2. Current Flow will be determined

    1. if not, it will select a flow that has a matching intent
  3. Intent will be matched and attributes will be processed
  4. Starting from the last state (otherwise initial state), a new state will be determined

    1. During state transition, context mapping will be executed
  5. Actions of the state will be executed

    1. Responses are generated by action
    2. If action contains command, converse will be executed recursively
  6. Session will be updated
  7. Responses will be sent

Responses Type

One converse process can produce more than one responses. A response can be one of the following type:

  • command - A command response type will be fed back to the bot and trigger another converse cycle.
  • data - A data response type will return a formatted data, such as image, carousel, button etc.
  • text - A text response type will return a text chat bubble as a response.

Message Structure

A message consists of following definitions:

  • type: string - Message type (text or data)
  • content: string - Exist if message type is text
  • payload: JsonObject - Exist if message type is data
  • metadata: JsonObject - Metadata for specific channel type

Re-Converse using Command

Command allow you to trigger multiple converse cycles. This is useful in many use-cases, such as moving to multiple states for more fluid conversation.

Figure 2

Contributing to the Documentation

Is something missing/incorrect? Please let us know by contacting support@kata.ai. If you know how to fix it straight away, don’t hesitate to create a pull request on this documentation’s GitHub repository.