Using the Intent Detection Node

Using the Intent detection node, it is possible to use an NLP service to match user input to intents.

Each Intent Detection node will provide you with a few output ports.

  • The first one is for successful responses from the NLP service.
  • The second port is for slot filling
  • The last port is for when no intent is matched in the NLP.

Start with a Classic Flow bot

Create a Classic flow bot from blueprint. Our getting started bot should be good enough.

Pick your NLP

This tutorial will cover using Dialogflow, but other vendors are compatible.

  • In Dialogflow, create a bot, and generate a secret
  • Keep track of the project ID
  • Create an intent and give it a few utterances

Edit your Bot

  • Add a intent detection node
  • Configure it to use the right project ID and secret from your previous steps.
  • Test the bot in messenger and send it an utterance
  • The response from dialoglow should be available as a context variable msg.payload.result.fulfilment

Other properties will also be available for use in your flow

msg :{
    payload :{
      result: {
        intent: 'intent_name',
        slots: {},
        action: {},
        fulfilment: 'message from NLP', //for a single response
        fulfillmentResponses: ['array', 'of', 'nlp', 'responses'],
        intentDetectionConfidence: 1
      }
    }
  }
}