This document covers all you need to know to configure your bot. Regarding credentials, refer to Getting started.

Configuration files

A configuration file is a .js file exporting a configuration object:

module.exports = {

It is passed as an argument to a command (train, run or test):

 yarn run  

Note that you can omit the .js extension when passing the config file name to the bot command.

Configuration files allow you to configure many parts and behaviors of the bot.


The adapter is configured using the adapter key.

It defaults to { name: 'shell' } to use the shell adapter.

See the documentation about adapters to know which adapters are available and which parameters they take.


The brain is configured using the brain key. It defaults to { name: 'memory' }.

Botfuel Dialog comes with 2 pre-configured brains:

  • 'memory' (non persistent in-memory brain)
  • 'mongo' (MongoDB brain)

Conversations duration

The duration of a conversation is the limit beyond which a new conversation is automatically created by the bot.

Its default value is 86400000ms (1 day).

To change this value, add the entry conversationDuration: <maximal duration in ms>:

brain: {
  name: 'memory',
  conversationDuration: 3600000, // one hour


The locale is configured using the locale key. It defaults to 'en'. Its possible values are:

  • 'en'
  • 'fr'
  • 'es'


Botfuel Dialog uses the Logtown logging facade together with the Winston logger.

The logger is configured using logger key. It defaults to the 'info' logger. This logger only logs messages with severity greater than or equal to 'info'.

Pre-configured loggers

Botfuel Dialog comes with 3 pre-configured loggers:

  • 'debug'
  • 'info'
  • 'error'

Custom loggers

It is also possible to define your own logger.

For example, let's define a logger that mutes the brain of the bot. Simply add logger: 'mute' to your config file and, under the root of the bot, a file loggers/mute.js with the following content:

const WinstonWrapper = require('logtown-winston');
const winston = require('winston');

const transports = [
  new winston.transports.Console({
    json: false,
    colorize: true,
    prettyPrint: true,
    timestamp: true,
    handleExceptions: true,
    align: false,
    level: 'debug',

const options = {
  exitOnError: false,

module.exports = {
  wrapper: new WinstonWrapper(transports, options),
  config: {
    namespaces: {
      Brain: {
        disable: ['debug'],
      MongoBrain: {
        disable: ['debug'],
      MemoryBrain: {
        disable: ['debug'],


Configuration of modules is defined with the key modules. The value is the array of module names (with the same syntax than the corresponding Node.js packages). The default value is [].

Natural Language Understanding

Configuration of the natural understanding is defined in the key nlu. The default value is { name: 'botfuel', intentThreshold: 0.8 }.

Intent threshold

The default NLU component uses a threshold to trigger intents, that is configured using the intentThreshold key.

Multi-intent detection

Enabling multi-intent detection is done with the multiIntent key. It expects a boolean value and defaults to false (multi-intent detection is disabled by default).


Botfuel provides an easy-to-use Questions and Answers module.

To integrate it in your bot, add this to your config file:

nlu: {
  name: 'botfuel',
  intentThreshold: 0.75,
  qna: {},

You can further configure QnA:

  • when determines whether the QnA classification runs after the bot's own classification or before, with corresponding values 'after' and 'before', it defaults to 'after'
  • strict determines whether the QnA returns only a single answer (true) or up to 3 answers (false), it defaults to false

Following is a complete configuration of the QnA module:

module.exports = {
  nlu: {
    name: 'botfuel',
    intentThreshold: 0.75,
    qna: {
      when: 'after',
      strict: true,


Botfuel provides a spell checking API.

To enable it in your bot, simply add spellchecking: '<dictionnary key>' to your config file.