Agents

A Dialogflow CX agent is a virtual agent that handles conversations with your end-users. It is a natural language understanding module that understands the nuances of human language. Dialogflow translates end-user text or audio during a conversation to structured data that your apps and services can understand. You design and build a Dialogflow agent to handle the types of conversations required for your system.

A Dialogflow agent is similar to a human call center agent. You train them both to handle expected conversation scenarios, and your training does not need to be overly explicit.

Create an agent

To create an agent:

Console

  1. Open the Dialogflow CX Console.
  2. Create or choose a GCP project.
  3. Click Create agent.
  4. Complete the form for basic agent settings:
    1. You can choose any display name.
    2. Select your preferred location. Click the Edit button if you want to change advanced location settings.
    3. Select your preferred time zone.
    4. Select the default language for your agent.
  5. Click Save.

API

See the create method for the Agent type.

Select a protocol and version for the Agent reference:

Protocol V3 V3beta1
REST Agent resource Agent resource
RPC Agent interface Agent interface
C# Not available Not available
Go Not available Not available
Java AgentsClient AgentsClient
Node.js AgentsClient AgentsClient
PHP Not available Not available
Python AgentsClient AgentsClient
Ruby Not available Not available

Agent data

Dialogflow agents serve as top-level containers for settings and data for virtual agents.

To access an agent's data:

Console

  1. Open the Dialogflow CX Console.
  2. Choose the GCP project for the agent.
  3. Find the agent in the list.
  4. Click the agent display name.
  5. Update flows, pages, etc. as described in other guides.

API

See the guides for the data you want to update.

The following data is associated with agents:

Agent settings

To access agent settings:

Console

  1. Open the Dialogflow CX Console.
  2. Choose your GCP project.
  3. Select your agent.
  4. Click Agent Settings.
  5. Update the settings as desired.
  6. Click Save.

API

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

Select a protocol and version for the Agent reference:

Protocol V3 V3beta1
REST Agent resource Agent resource
RPC Agent interface Agent interface
C# Not available Not available
Go Not available Not available
Java AgentsClient AgentsClient
Node.js AgentsClient AgentsClient
PHP Not available Not available
Python AgentsClient AgentsClient
Ruby Not available Not available

The following subsections describe the different categories of agent settings.

General settings

The following general settings are available for agents:

  • Display name

    A human-readable name for your agent.

  • Time zone

    The default time zone for your agent.

  • Default language

    The default language supported by your agent.

  • Enable stackdriver logging

    Indicates whether Cloud logging is enabled for the agent.

  • Enable interaction logging

    Indicates whether to collect and store end-user queries. Some features, like Experiments, require this setting to be enabled. Upcoming features will allow browsing of these interaction logs.

ML settings

Dialogflow uses machine learning (ML) algorithms to understand end-user inputs, match them to intents, and extract structured data. Dialogflow learns from training phrases that you provide and the language models built into Dialogflow. Based on this data, it builds a model for making decisions about which intent should be matched to an end-user input. You can apply unique ML settings for each flow of an agent, and the model created by Dialogflow is unique for each flow.

The following agent-wide ML settings are available:

  • Allow ML to correct spelling

    If this is enabled and end-user input has a spelling or grammar mistake, an intent will be matched as though it was written correctly. The detect intent response will contain the corrected end-user input. For example, if an end-user enters "I want an applle", it will be processed as though the end-user entered "I want an apple". This also applies to matches involving both system and custom entities.

    Spell correction is available for all languages supported by Dialogflow, but is currently limited to specific regions.

    Warnings and best practices:

    • Spell correction can't correct ASR (automatic speech recognition) errors, so we don't recommend enabling it for agents using ASR inputs.
    • It is possible for corrected input to match the wrong intent. You can fix this by adding commonly mismatched phrases to negative examples.
    • Spell correction increases the agent's response time slightly.
    • If an agent is defined using domain-specific jargon, the corrections may be undesired.

The following flow-specific ML settings are available:

  • NLU type

    This can be one of:

    • Standard: Standard NLU technology.
    • Advanced: Advanced NLU technology. This NLU type works better than standard, especially for large agents and flows. Model training takes longer, so automatic training is disabled. You need to train the flows manually or via API.
  • Auto train

    If enabled, the flow is trained whenever it is updated with the console. For large flows, this may cause console UI delays, so you should disable this setting and manually train as-needed for large flows. This setting cannot be enabled for the advanced NLU type.

  • Classification threshold

    To filter out false positive results and still get variety in matched natural language inputs for your agent, you can tune the machine learning classification threshold. This setting controls the minimum intent detection confidence required for an intent match.

    If the confidence score for an intent match is less than the threshold value, then a no-match event will be invoked.

  • Training status

    Indicates whether the flow has been trained since the latest update to the flow data.

  • Train NLU

    Use this button to manually train the flow.

Speech and IVR settings

The following speech settings are available:

  • Enable speech adaptation

    See Auto speech adaptation.

  • Advanced speech settings

    This section provides additional, advanced settings for speech features. These settings are available in agent settings (applies to entire agent), flow settings (applies to entire flow and overrides agent settings), and page settings (applies to page, and overrides flow and agent settings). You can toggle these advanced settings off and on.

    • End of speech sensitivity

      Controls the sensitivity for recognizing end of speech in end-user audio input. The value ranges from 0 (low sensitivity, less likely to end speech) to 100 (high sensitivity, more likely to end speech)

    • No speech timeout

      The time duration in seconds for which Dialogflow will stop waiting for end-user audio input. The default is 5 seconds. For this timeout, Dialogflow invokes a no-input event.

    • Barge-in

      When enabled, an end-user can interrupt Dialogflow response audio. When interrupted, Dialogflow will stop sending audio, and it will process the next end-user input.

      If there are multiple messages in the message queue, and a message was queued by a fulfillment associated with a page, flow, or agent that has barge-in enabled, then all following messages in the queue will also have barge-in enabled. In this case, The integration will stop playing audio for all of the queued messages with barge-in enabled.

    • Google Cloud Storage URI

      If supplied, end-user audio inputs will be saved to the Cloud Storage bucket.

      Grant the Storage Object Creator role to the following service accounts in your project:

      • To the service account of the format one-click@df-cx-ALPHANUMERIC_VALUE-ALPHANUMERIC_VALUE.iam.gserviceaccount.com if you use a partner built-in telephony integration.

      • To the service account of the format service-PROJECT_NUMBER@gcp-sa-dialogflow.iam.gserviceaccount.com if you use the Dialogflow CX Phone Gateway integration. To find this service account in IAM, check the Include Google-provided role grants option.

Share settings

See Access control.

Languages settings

Add additional language support to your agent. For the full list of languages, see the language reference.

Security settings

See Security settings.

Advanced settings

Currently, the only advanced setting is for sentiment analysis.

Export and restore an agent

To export or restore an agent:

Console

  1. Open the Dialogflow CX Console.
  2. Choose the GCP project for the agent.
  3. Click the option menu for an agent in the list.
  4. Click the Export or Restore button.
  5. Follow instructions to complete.

API

See the export and restore methods for the Agent type.

Select a protocol and version for the Agent reference:

Protocol V3 V3beta1
REST Agent resource Agent resource
RPC Agent interface Agent interface
C# Not available Not available
Go Not available Not available
Java AgentsClient AgentsClient
Node.js AgentsClient AgentsClient
PHP Not available Not available
Python AgentsClient AgentsClient
Ruby Not available Not available

If the agent size exceeds the maximum limit, use the Cloud Storage option for agent export and restore.

Delete an agent

In order to delete an agent, you need a role that provides full access or edit access. See the access control guide for more information.

To delete an agent:

Console

  1. Open the Dialogflow CX Console.
  2. Choose the GCP project for the agent.
  3. Click the option menu for an agent in the list.
  4. Click the delete button.
  5. Confirm deletion in the dialog.

API

See the delete method for the Agent type.

Select a protocol and version for the Agent reference:

Protocol V3 V3beta1
REST Agent resource Agent resource
RPC Agent interface Agent interface
C# Not available Not available
Go Not available Not available
Java AgentsClient AgentsClient
Node.js AgentsClient AgentsClient
PHP Not available Not available
Python AgentsClient AgentsClient
Ruby Not available Not available