Analyze data with conversations

Use this document to learn how to create, edit, and delete conversations in BigQuery. Conversations are persisted user chats with a data agent or data source. Users can ask data agents multi-part questions that use common terms like "sales" or "most popular", without having to specify table field names, or define conditions to filter the data. The chat response returned to the user provides the answer to the user's question as text and code, and also generates charts where appropriate. The response also includes the reasoning behind the results.

You can create a conversation with a data agent, or a direct conversation with one or more tables. When you create a direct conversation, the Conversational Analytics API interprets your question without the context and processing instructions offered by a data agent.

Before you begin

  1. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  2. Verify that billing is enabled for your Google Cloud project.

  3. Enable the BigQuery, Gemini Data Analytics, and Gemini for Google Cloud API APIs.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the APIs

Required roles

To create conversations, you must have one of the following Conversational Analytics API IAM roles:

  • View and create conversations with any data agent that has been shared with you: Gemini Data Analytics Data Agent User (roles/geminidataanalytics.dataAgentUser) at the project level.
  • Create a direct conversation: Gemini Data Analytics Stateless Chat User (roles/geminidataanalytics.dataAgentStatelessUser)

Additionally, any user that creates a conversation must have the following roles:

If a conversation user doesn't have appropriate roles on the source data tables used by the data agent, the following error is returned when the user chats with the data agent:

Schema_Resolution: Access Denied

Create a conversation with a data agent

Use the following steps to create a conversation with a data agent. You must create a data agent before you can initiate a conversation with one.

  1. Go to the BigQuery Agents page.

    Go to the Agents page

  2. On the Conversations tab, on the Chat with your data pane, click the agent card of the data agent that you want to chat with. The conversation page opens.

  3. In the Ask a question field, type a question that you want the data agent to answer. You can also click one of the Gemini-suggested questions to get started.

    The data agent responds, stating the action it is taking to address your question, and then returning the results.

    To see the steps that the data agent took, click View steps.

    To see information about how the results were calculated, click How was this calculated?:

    Select the icon next to the initial data agent response to see details of the agent's calculations.

    The Text tab decribes the generated code, and the Code tab provides the generated code:

    The agent's calculation details includes information about the code it generated.

    If appropriate for the data, the data agent also provides charts, tables, and other visualizations.

Create a direct conversation with a data source

Follow these steps to create a direct conversation with a data source:

  1. Go to the BigQuery Agents page.

    Go to the Agents page

  2. On the Conversations tab, on the Chat with your data pane, click Data sources.

  3. Select one or more tables and click Create Conversation.

  4. In the Ask a question field, type a question that you want the data agent to answer. You can also click one of the Gemini-suggested questions to get started.

    The Conversational Analytics API processes your question and returns the results.

    To see the steps that the Conversational Analytics API took, click View steps.

    To see information about how the results were calculated, click How was this calculated?:

    Select the icon next to the initial data agent response to see details of the agent's calculations.

    The Text tab decribes the generated code, and the Code tab provides the generated code:

    The agent's calculation details includes information about the code it generated.

Open an existing conversation

Follow these steps to open a conversation:

  1. Go to the BigQuery Agents page.

    Go to the Agents page

  2. On the Conversations tab, in the conversations list, click the conversation that you want to open.

Rename a conversation

Follow these steps to rename a conversation:

  1. Go to the BigQuery Agents page.

    Go to the Agents page

  2. On the Conversations tab, in the conversations list, click the conversation that you want to rename.

  3. Click View actions > Rename.

  4. In the Rename conversation dialog, type a new name for the conversation in the Conversation name field.

  5. Click Rename.

Delete a conversation

Follow these steps to delete a conversation:

  1. Go to the BigQuery Agents page.

    Go to the Agents page

  2. On the Conversations tab, in the conversations list, click the conversation that you want to rename.

  3. Click View actions > Delete.

  4. In the Delete conversation? dialog, click Delete.

Locations

Conversational analytics operates globally, you can't choose which region to use.

What's next