Agents

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

A Conversational Agents (Dialogflow CX) 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 Google Cloud project.
  3. Click Create agent.
  4. Select Auto-generate to create a data store agent or select Build your own to create other kinds of agents.
  5. 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. You cannot change the default language for an agent once it is created.
  6. Click Save.

API

If you have not already configured location settings for your project, you must configure these settings with the console before creating agents with the API. Currently, you cannot configure location settings with the API.

To create an agent, 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++ AgentsClient Not available
C# AgentsClient Not available
Go AgentsClient Not available
Java AgentsClient AgentsClient
Node.js AgentsClient AgentsClient
PHP Not available Not available
Python AgentsClient AgentsClient
Ruby Not available Not available

Agent data

Conversational Agents (Dialogflow CX) 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 Google Cloud 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:

For more information about how data is applied at varying levels, see the data application levels.

Export and restore an agent

You can export an agent to a file, and restore an agent with that file.

An agent export includes all agent data except the following:

An agent restore overwrites all target agent data (including all flow versions) except the following:

  • Environments: All custom environments remain unchanged in the target agent. Flow versions referenced by custom environments in the target agent will continue to exist, as long as the associated environments exist. However, these stale flow versions are not listed or selectable flow versions for the agent.
  • Vertex AI Agents Apps: The association to a Vertex AI Agents App remains unchanged in the target agent. (In other words, the value of engine in GenAppBuilderSettings) This means that data store agents can only be restored into other existing data store agents, because the resulting agent also needs to have an association to a Vertex AI Agents App.
  • Vertex AI Agents Data Stores: All references to data stores will be overwritten in the target agent according to the following rules:

    • If the target agent isn't associated with an App, then it's not possible to restore an agent with data store references into it. Trying to do so results in an error message. To fix that, you can either create a new data store agent from scratch. (Alternatively, you can turn your existing agent into a data store agent by adding a data store state handler to it. In this case you'll be guided through adding an associated App to your agent.)
    • If the target agent is associated with an App, then all the data store references will be updated upon restore: their Google Cloud project ID and location will be updated to match the App of the target agent. The collection ID and data store ID will remain unchanged. This means that you need to add data stores for all the IDs with matching types into the App of the target agent prior to the restore operation.

    Example: if the source agent refers to a data store named projects/123/locations/eu-west2/collections/default_collection/dataStores/myDataStore1 and the App of the target agent is named projects/321/locations/us-east1/collections/default_collections/engines/app123, then the resulting data store reference in the target agent will become: projects/321/locations/us-east1/collections/default_collection/dataStores/myDataStore1

When exporting, you can select the export file format. If you are using source control versioning for your agent data, you should export in the JSON format. When you restore an agent, Conversational Agents (Dialogflow CX) automatically determines the file format.

To export or restore an agent:

Console

  1. Open the Dialogflow CX console.
  2. Choose the Google Cloud 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++ AgentsClient Not available
C# AgentsClient Not available
Go AgentsClient 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.

If you use GitHub, also see the GitHub export/restore guide.

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 Google Cloud 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++ AgentsClient Not available
C# AgentsClient Not available
Go AgentsClient Not available
Java AgentsClient AgentsClient
Node.js AgentsClient AgentsClient
PHP Not available Not available
Python AgentsClient AgentsClient
Ruby Not available Not available

If you delete your project, all Conversational Agents (Dialogflow CX) agents and data associated with the project are deleted immediately.