Generative AI agents

Generative AI App Builder provides an agent built on Dialogflow CX. With this feature, you provide a website link or documents (data stores), and Google parses your content and creates a virtual agent powered by large language models. This is accomplished by creating special state handlers called data store handlers. Using these data store handlers, your agent can have conversations about the content with your end-users.

You can specify your domain name and/or upload any number of documents, and Google will index them. This information is made available to your agent to access in real time. This unifies the power and accuracy of Google Search algorithms running against your public or private data with Dialogflow's natural conversation capabilities.

For information about this type of agent, and directions for creating a new agent, see the Generative AI agent introduction.

The remainder of this document describes how to add data store handlers to an existing Dialogflow CX agent.

About hybrid agents

If you have an existing Dialogflow CX agent, you can upgrade this agent to a hybrid agent, which combines the power of precise conversation controls (flows, parameters, intents, conditions, transitions, and so on) with data store handler generative features.

As part of this upgrade, you may wish to delete or temporarily disable intent routes (while testing data store handlers) for certain conversation scenarios from your agent, because the data store handlers can handle those scenarios more simply.

The following scenarios are recommended for data store handlers:

  • Questions that can be answered by your organization's documents or website.
  • FAQs that do not require database lookups.

The following scenarios are not recommended for data store handlers:

  • Content that does not have answers to desired questions.
  • Questions that require database lookups or server requests.
  • Scenarios that require data redaction.
  • Scenarios that require deterministic agent responses.

Input evaluation order

Dialogflow evaluates end-user input in the following order for hybrid agents:

  1. Parameter input while form filling.
  2. Intent matches for routes in scope.
  3. Data store handler with FAQ data store content.
  4. Data store handler with unstructured data store content.

Add or edit data store handlers for an existing agent

Data store handlers are a special type of Dialogflow state handler. This means that you can apply them to flows or pages, and that they are evaluated using the same scope rules.

To add or edit a data store handler:

  1. Go to the Dialogflow CX Console.
  2. Select your Google Cloud project.
  3. Select the agent.
  4. Select the flow associated with the data store handler. This is commonly the default start flow.
  5. Select the page associated with the data store handler. This is commonly the start page.
  6. Click Add state handler in the page data, then select data store.
  7. If you need to create a data store, you will be taken to the Generative AI App Builder user interface. See the data store information to help you make selections.
  8. If you already have a data store, click Edit data store.
  9. Make updates as needed and save when you are complete. See information below about data store specific settings.

Agent responses

In the Agent responses section, you can provide custom responses that reference generative answers. Use $request.knowledge.questions[0] in the Agent says section to provide the generative answer.

Data store response options

You can update the Link maximum field to indicate the maximum number of supplemental links that should be provided by the generative answers.

Handle conversation digressions

An end-user may ask clarifying questions during a conversation. For example, during credit card information collection, they may want to clarify what a CVV is. In this case, your agent should answer the question and return to collecting the necessary credit card information. To accomplish this, you can create a data store handler with data stores that answer the question, apply that handler to the flow start page of the flow that handles credit card information collection, and set a transition target for this handler to return to the "current page".

Handle undesired intent matches

If your agent is matching intents when it should be using a data store handler, you can try the following to correct this:

  • Delete or modify training phrases that are vague, so that all of your training phrases precisely handle the desired intention and do not conflict with your data store content.
  • Use negative examples to avoid intent matching.

Data store filtering

In some cases, you may only want certain data stores available for queries, depending on session parameter values. For example, you may have unique data stores for product categories. To accomplish data store filtering for product categories:

  • Set session parameters to product categories.
  • Create condition routes that check the values of the session parameters and transition to a specific page that has the desired data store handler.
  • The data store handler should transition back to the calling page, so that the conversation can continue.


Also see the Generative AI Agent and Generators Codelab.