General description

Dialogs (also called Dialog Manager) is a component responsible for managing the dialog. It's the heart of every bot. It works with close cooperation with NLU components. Has its API exposed via Gateway. It holds the current version (working copy and published) for each project/bot in its DB. This component sends analytics data to the Analytics component via RabbitMQ.

It should be the first component when investigating bot errors.

It has DEBUG logs enabled by default, for production usage logs could be limited to INFO, but this would limit investigation capabilities.

API

Default port: 5748

The application has got HTTP API which is not secured by any mechanism, therefore should NOT be visible from outside the Kubernetes cluster.

There are default endpoints for monitoring purposes. They are described in Components monitoring section.

Databases

SQL

The component has its own SQL Database for storing flow models as well as active dialogs. Main tables:

  • project_model - contains flow models for bots
  • dialog - contains current dialogs/conversations with bots
  • integration - persistant cache for integration

RabbitMQ

The component reads data from queues:

  • automate.jobs.XXX - used for handling jobs from cron-orchestrator

The component writes data to queues:

  • automate.analytics.message - used for pushing analytics data
  • automate.jobs.result - used for returning status to cron-orchestrator

Communication

This service communicates with the following services:

ApplicationConfig to URLAuth
adminchatbots.dialog-manager.api.admin-external.urlOTP

Config

Application's config:

chatbots.dialog-manager {
  session {
    max-inactivity: "1h"
  }

  db {
    url: "jdbc:postgresql://db:5432/chatbots-dialog-manager",
    user: "postgres",
    password: "root"
    max-connections: 20
  }  
  
  knowledge-base {
    caching-time: 1h
  }

  memory-in-response-character-limit: 1000
  model-cache: 60s
  distributed-locks-enabled: true
}
  

Other required configurations:

chatbots.dialog-manager {
  api {
    admin-external {
      url: "http://admin:5750/api/external"
      otp-secret: "R4UY32KJ3JVRFRNR"
    }
  }
}

chatbots.messaging {  
  rabbit {  
    hosts: ["HOST:PORT"]  
    username: "USER"  
    password: "PASSWORD"  
  }  
}

Play Framework config

More information about Play Framework could be found in Play Framework configuration section

Job execution

CleanDialogManagerDb

This cron job is executing in this component. It removes sessions older (last update) than setting chatbots.dialog-manager.session.max-inactivity

Troubleshooting

Bot returns error when processing

Check logs for particular request id and find out the place where the actual error occurred. The most common cases are Expression Language in a block or call to NLU. Expression Language issue should be passed to the Bot Design team and the NLU error should be investigated further in the nlu-pipeline component.