Skip to content

Recast node

Guidone edited this page Apr 5, 2018 · 6 revisions

Recast.ai is a chatbot / AI platform that allows to easily train a bot in order to detect the user intent and extract relevant data.

For a complete tutorial about Recast.ai give a look here. The Recast node sends the text of the incoming message to the Recast.ai servers, then:

  • if no intent is detected, then the incoming message is redirected to the second output
  • if an intent is detected, then it's stored in the context variable topic (or a different variable) and a key/value hash of all relevant information extracted is sent to the first output

For example, create an intent want-drink and train with these phrases

I want a martini
May I have a martini
Can I have a moscow mule
May I have a mojito

and mark the words "martini", "moscow mule" and "mojito" as a new entity called drink, then prepare a flow like this

Recast flow

If the user says "I want a martini", the topic will be switched to "want-drink" and the output will be

{
  payload: {
    intent: 'want-drink',
    variables: { 
      pronoun: 'I', 
      number: 1, 
      drink: 'martini' 
    }
}

Generally after a Recast.ai node it's useful a Rules node to test the topic variable and redirect the flow based on user's intent.

Telegram Facebook Slack Smooch

Clone this wiki locally