This document describes how to create, edit, and delete conversations in Spanner. Conversations are persisted chats with a data agent.
You can ask data agents multi-part questions that use common terms—for example, "sales" or "most popular"—without specifying table field names, or defining conditions to filter the data. The chat response provides the answer to your question as text and code, and it generates charts when appropriate. The response includes the reasoning behind the results.
You can create a conversation with a data agent. 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
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Spanner, Data Analytics API with Gemini, and Gemini for Google Cloud APIs.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.
Required roles
To work with data agents, you must have IAM permissions that match your use case. The following table lists required roles based on whether you're creating and publishing agents, provisioning agents in Gemini Enterprise, or discovering and using agents. For more information, see Conversational Analytics API Identity and Access Management roles.
| Use case | Required roles |
|---|---|
| Create, edit, publish, share, and delete agents |
|
| Provision agents in Gemini Enterprise |
To make a published agent available to users in Gemini Enterprise, you need permissions to register and manage A2A agents in the Gemini Enterprise administration console. |
| Discover and use agents |
|
To work with Spanner resources, see Spanner roles and permissions.
Create conversations
You can create persistent conversations with an agent or with a data source in the Google Cloud console for Spanner from the Agent Catalog tab on the Agents page.
Create a conversation with a data agent
To create a conversation with a data agent, you first create a data agent and publish it. You can also initiate a conversation with agents that others share with you.
To create a conversation with a data agent in the Google Cloud console, follow these steps:
In the Google Cloud console, go to the Spanner page.
Select an instance from the list, and then select a database.
In the navigation menu, click Agents.
From either the My agents or Shared by others in your organization section, click the agent card of the agent that you want to chat with.
Click Start a Conversation. A new chat panel opens.
In the Ask a question field, enter a question for the data agent. For example, "What were our total sales last quarter?" or "Show me the top 5 users by session time." You can also click one of the Gemini-suggested questions to get started.
The data agent responds by stating the action that it's taking to address your question, and then the data agent returns the results.
To see each step that the data agent takes to provide the answer to your question, click Show reasoning to view each message in the agent's reasoning process.
To see information about how the results were calculated, click How was this calculated? The Summary section now includes a generated query followed by the query result. You can copy the code and then click Studio to paste the code in the query editor.
When appropriate for the data, the data agent provides charts, tables, and other visualizations. To view your chat history, go to the Conversation Management list.
To view agent information, go to the Details panel. This panel includes a description of the agent and its knowledge sources.
Manage conversations
You can open, rename, or delete a conversation on the Agents page.
Open an existing conversation
In the Google Cloud console, go to the Spanner page.
Select an instance from the list, and then select a database.
In the navigation menu, click Agents.
On the Conversations tab, in the conversations list, click the conversation you want to open.
Rename a conversation
In the Google Cloud console, go to the Spanner page.
Select an instance from the list, and then select a database.
In the navigation menu, click Agents.
On the Conversations tab, in the conversations list, click the conversation you want to rename.
Click View actions > Rename.
In the Rename conversation dialog, enter a new name for the conversation in the Conversation name field.
Click Rename.
Delete a conversation
In the Google Cloud console, go to the Spanner page.
Select an instance from the list, and then select a database.
In the navigation menu, click Agents.
On the Conversations tab, in the conversations list, click the conversation you want to delete.
Click View actions > Delete.
In the Delete conversation? dialog, click Delete.
Locations
Conversational analytics operates globally; you can't choose which region to use.
What's next
- Learn more about conversational analytics in Spanner.
- Learn more about the Conversational Analytics API.
- Create a data agent in Spanner.