Intents

An intent categorizes an end-user's intention for one conversation turn. Compared to ES intents, CX intents have been simplified to make them a more reusable resource.

An intent contains the following data:

Term Definition
Training phrases Training phrases are example phrases for what end-users might type or say, known as end-user input. When end-user input resembles one of these phrases, Dialogflow matches the intent. You don't have to define every possible example, because Dialogflow's built-in machine learning expands on your list with other, similar phrases.
Parameters You define your training phrases to use parameters to extract values from specific parts of the end-user input.

Intent matching

When an end-user writes or says something, referred to as end-user input, Dialogflow compares the input to intent training phrases to find the best match. This process is called intent matching. Intent matching can only occur for intents associated with an intent route (a state handler with an intent requirement) in scope.

When searching for a matching intent, Dialogflow scores potential matches with an intent detection confidence, also known as the confidence score. These values range from 0.0 (completely uncertain) to 1.0 (completely certain). Once intents are scored, there are two possible outcomes:

  • If the highest scoring intent has a confidence score greater than or equal to the classification threshold setting, it is returned as a match.
  • If no intents meet the threshold, then a no-match event will be invoked.

Training phrases

Training phrases are example phrases for what end-users might type or say, referred to as end-user input. For each intent, you create many training phrases. When an end-user input resembles one of these phrases, Dialogflow matches the intent.

For example, the training phrase "I want pizza" trains your agent to recognize end-user input that is similar to that phrase, like "Get a pizza" or "Order pizza".

You don't have to define every possible example, because Dialogflow's built-in machine learning expands on your list with other, similar phrases. You should create at least 10-20 (depending on complexity of intent) training phrases, so your agent can recognize a variety of end-user inputs. For example, if you want your intent to recognize an end-user's input about their favorite color, you could define the following training phrases:

  • "I like red"
  • "My favorite color is yellow"
  • "black"
  • "Blue is my favorite"
  • ...

Annotate training phrases

You control how end-user data is extracted by annotating parts of your training phrases and configuring the associated parameters.

For example, consider a training phrase like "What is the forecast tomorrow for Tokyo?" You should annotate "tomorrow" with a date parameter and "Tokyo" with a location parameter. When you annotate parts of a training phrase, Dialogflow recognizes that these parts are just examples of actual values that will be provided by end-users at runtime. For an end-user input like "What is the forecast on Friday for Sydney?", Dialogflow would extract the date parameter from "Friday" and the location parameter from "Sydney".

When building an agent with the console, most annotations are automatically created for you when you add training phrases that contain parts that can be matched to an existing entity type. These parts are highlighted in the console. You can edit these annotations and parameters as needed.

To manually annotate a training phrase with the console:

  1. Select the part of the training phrase that you want to annotate.
  2. Select the desired entity type from the list.
  3. A parameter is created for you in the parameter table below.

When building an agent with the API, you must annotate training phrase parts manually. See the TrainingPhrase type used by the Intent type.

Select a protocol and version for the Intent reference:

Protocol V3beta1
REST Intent resource
RPC Intent interface
Java IntentsClient
Node.js IntentsClient
Python IntentsClient

Default welcome intent

When you create an agent, a default welcome intent is created for you. The intent has simple training phrases like "Hi" or "Hello" that are meant to match initial end-user input. You can edit this intent as desired.

When using the API, you can reference this intent with the following intent ID:

00000000-0000-0000-0000-000000000000

Default negative intent

When you create an agent, a default negative intent is created for you. You can add training phrases to this intent that act as negative examples. There may be cases where end-user input has a slight resemblance to training phrases in normal intents, but you do not want these inputs to match any normal intents.

For example, a room booking agent may have a training phrase like "I'd like to book a room". If the end-user wants to purchase a book about rooms, they may say "I'd like to buy a book about rooms." To ensure that the end-user input does not match your intent, you can add that phrase as a negative example.

When using the API, you can reference this intent with the following intent ID:

00000000-0000-0000-0000-000000000001

Create an intent

To create an intent:

Console

  1. Open the Dialogflow CX Console.
  2. Choose your GCP project.
  3. Select your agent.
  4. Select the Manage tab.
  5. Click Intents.
  6. Click +Create.
  7. Enter intent data.
  8. Click Save.

API

See the create method for the Intent type.

Select a protocol and version for the Intent reference:

Protocol V3beta1
REST Intent resource
RPC Intent interface
Java IntentsClient
Node.js IntentsClient
Python IntentsClient

Delete an intent

To delete an intent:

Console

  1. Open the Dialogflow CX Console.
  2. Choose your GCP project.
  3. Select your agent.
  4. Select the Manage tab.
  5. Click Intents.
  6. Hover your mouse over the intent you want to delete.
  7. Click the delete button.

API

See the delete method for the Intent type.

Select a protocol and version for the Intent reference:

Protocol V3beta1
REST Intent resource
RPC Intent interface
Java IntentsClient
Node.js IntentsClient
Python IntentsClient

Access intent data

To access intent data:

Console

  1. Open the Dialogflow CX Console.
  2. Choose your GCP project.
  3. Select your agent.
  4. Select the Manage tab.
  5. Click Intents.
  6. Click the intent you want to access.
  7. View or update intent data.
  8. Click Save to save any changes.

API

See the get and patch/update methods for the Intent type.

Select a protocol and version for the Intent reference:

Protocol V3beta1
REST Intent resource
RPC Intent interface
Java IntentsClient
Node.js IntentsClient
Python IntentsClient