Manage data agents in Spanner Studio

Preview — Data agents

This feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms, and theAdditional Terms for Generative AI Preview Products. Pre-GA features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.

For information about access to this release, see the access request page.

This document describes how to create a data agent in Spanner Studio using an agent context file. A data agent is associated with a single agent context file.

To learn about data agents, seeData agents overview.

Before you begin

Complete the following prerequisites before creating an agent.

Enable required services

Enable the following services for your project:

Prepare a Spanner instance

  • Make sure that a Spanner instance is available. For more information, seeCreate an instance.
  • Populate the database with the data and schema that the end user wants to access.

Required roles and permissions

Create a data agent

To create a data agent, perform the following steps:

  1. In the Google Cloud console, go to the Spanner page.

    Go to Spanner

  2. Select an instance from the list, and then select a database.

  3. In the navigation menu, clickSpanner Studio.

  4. In theExplorer pane, next toData Agents, clickView actions.

  5. ClickCreate agent.

  6. InAgent name, provide a unique agent name. The agent name is case-sensitive and can contain letters, numbers, hyphens, and underscores.

  7. Optional. InAgent description, add a description for your agent.

  8. Optional. ClickShow Advanced Options and inSelect a location, select a region for storing agent context.

  9. ClickCreate.

Note: Creating the first agent in a project can take several minutes.

Build agent context

After creating an agent, follow the steps inBuild contexts using Gemini CLI to create an agent context file. You can then edit your agent to upload the context file.

Edit an agent

To edit a data agent, perform the following steps:

  1. In the Google Cloud console, go to the Spanner page.

    Go to Spanner

  2. Select an instance from the list, and then select a database.

  3. In the navigation menu, clickSpanner Studio.

  4. In theExplorer pane, next toData Agents, clickView actions.

  5. ClickEdit agent.

  6. Optional: EditAgent description.

  7. ClickBrowse in theUpload agent context file section, and select the agent context file.

  8. ClickSave.

Delete a data agent

To delete a data agent, perform the following steps:

  1. In the Google Cloud console, go to the Spanner page.

    Go to Spanner

  2. Select an instance from the list, and then select a database.

  3. In the navigation menu, clickSpanner Studio.

  4. In theExplorer pane, next toData Agents, clickView actions.

  5. ClickDelete agent.

  6. In theDelete agent confirmation dialog, enter the name of the agent.

  7. ClickConfirm to delete the agent.

Note: Before you delete a database, you must delete all agents associated with that database.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-17 UTC.