Create your bot

Start with a template

To create a new bot, login and click on the link + NEW BOT in the header section.

  • Choose a name and a description
  • Set the default language, you will be able to add more languages later ;)
  • Choose a template to start easily, the Meeting Bot is a complete bot example!

Recast.AI create bot

Create an intent

Everything your bot knows is in the intents. Intents are boxes including expressions that mean the same thing but are paraphrased. Each intent corresponds to one action your user wants to perform. For example, an intent greetings makes your bot understand when a user says Hello.

In the meeting bot you will find all intents you need to create a bot that can book you a meeting room. Explore each intent a little bit by clicking on the name and you will see expressions inside that train your bot to understand the user intent ;)

Add a new intent called Thanks, to understand when users will thank your bot! Type thanks in the input Search and Fork from the community, then click on the Search button.

As the platform is collaborative, there are a lot of intents already created. Select one of the first results and just click on the FORK button on the right.

Recast.AI fork intents

Add expressions

You have a new intent in your bot! Click on it. The optimal setting for a great intent is to contain around twenty paraphrased expressions. Add some expressions your users will say by typing the sentence in the field Add an expression.

Recast.AI expressions

Use entities

Go to the Booking intent. If you click on one of the expressions you will see highlighted words, with tags. These are entities. They’re keywords detected in expressions that are important to you in order to automate a task.

Recast.AI intents

We automatically detect 31 different entities like: Location, Datetime, Colors, Emojis, Number… We call them gold entities. If you need another entity, a custom one like a meal for a cooking bot, just select what you want to tag as your new entity and type a name. The more examples you provide, the better the detection will be ;)

Recast.AI tag entities

Use the console

Once you’ve set up your bot, you can test it with the console. Click on the TEST bubble icon on the top right to make it appear. Select the tab Analyse, and type a sentence to test if your bot is well trained: I want meeting room 2 for tomorrow

Recast.AI NLP analyse

You will see which intent is detected and which entities are extracted. Click on the Smart view toggle to switch the view to the JSON mode. The JSON contains a lot of useful information about the message you’ve sent, like all the enrichments we can provide for the gold entities.

Recast.AI NLP JSON

Make a first API request

This JSON returned in the console is what you receive when you've sent a text (like a user input) and want to analyze it. To get that response, you need to make a request: How? First, get your Request access token: click on the little gear icon to go to the settings of your bot.

Recast.AI bot settings

Then copy-paste this snippet in a file by replacing the REQUEST_TOKEN by your token, install the dependencies, and run the file ;)

JS: npm install recastai

Python: pip install recastai

Ruby: gem install 'RecastAI'

PHP: composer require recastai/sdk-php

JS
Ruby
Python
PHP
const recastai = require('recastai')

const client = new recastai.request('YOUR_REQUEST_TOKEN', 'en')

client.analyseText('hello')
  .then(function(res) {
    if (res.intent()) { console.log('Intent: ', res.intent().slug) }
    if (res.intent().slug === 'YOUR_EXPECTED_INTENT') {
      // Do your code...
    }
  })

Train your bot

When your message doesn’t match any intent, you have to train your bot. Go to the MONITOR tab on your bot page, and click on the Log feed menu. Here are the logs of your bots. Select the expressions that did not match and redirect them to the right intent. After that, check that your custom entities have been automatically tagged. If not, do it and remember “Bot trained, mommy approved!”.

Recast.AI bot monitor