Conversational Analytics API: Build data agents and chat with your data

Developers can use the Conversational Analytics API, which is accessed through geminidataanalytics.googleapis.com, to build an artificial intelligence (AI)-powered chat interface, or data agent, that answers questions about structured data in BigQuery, Looker, and Looker Studio using natural language. With the Conversational Analytics API, you provide your data agent with business information and data ("context"), as well as access to tools such as SQL, Python, and visualization libraries. These agent responses are presented to the user and can be logged by the client application, creating a seamless and auditable data chat experience.

Learn how and when Gemini for Google Cloud uses your data.

Get started with the Conversational Analytics API

To set up your environment and begin building and interacting with data agents by using the Conversational Analytics API, you can either start with the Colaboratory notebooks for a guided experience or follow the steps in Setup and prerequisites for a self-driven experience.

Interactive Colaboratory notebooks

For an interactive, step-by-step guide to setting up your environment, building a data agent, and making API calls, see the following Colaboratory notebooks:

Setup and prerequisites

Before you use the API or the examples, complete the following steps:

Build and interact with a data agent

After completing the previous steps, use the Conversational Analytics API to build and interact with a data agent by following these steps:

Key API operations

The API provides the following core endpoints for managing data agents and conversations:

Operation HTTP method Endpoint Description
Create an agent POST /v1alpha/projects/*/locations/*/dataAgents Creates a new data agent.
Get an agent GET /v1alpha/projects/*/locations/*/dataAgents/* Retrieves details of a specific data agent.
Update an agent PATCH /v1alpha/projects/*/locations/*/dataAgents/* Modifies an existing data agent.
List agents GET /v1alpha/projects/*/locations/*/dataAgents Lists available data agents in a project.
Delete an agent DELETE /v1alpha/projects/*/locations/*/dataAgents/* Removes a data agent.
Create a conversation POST /v1alpha/projects/*/locations/*/conversations Starts a new, persistent conversation.
Chat by using a conversation reference POST /v1alpha/projects/*/locations/*:chat Continues a stateful conversation by sending a chat message that references an existing conversation and its associated agent context. For multi-turn conversations, Google Cloud stores and manages the conversation history.
Chat by using a data agent reference POST /v1alpha/projects/*/locations/*:chat Sends a stateless chat message that references a saved data agent for context. For multi-turn conversations, your application must manage and provide the conversation history with each request.
Chat by using inline context POST /v1alpha/projects/*/locations/*:chat Sends a stateless chat message by providing all context directly in the request, without using a saved data agent. For multi-turn conversations, your application must manage and provide the conversation history with each request.
Get a conversation GET /v1alpha/projects/*/locations/*/conversations/* Retrieves details of a specific conversation.
List conversations GET /v1alpha/projects/*/locations/*/conversations Lists the conversations in a specific project.
List messages in a conversation GET /v1alpha/projects/*/locations/*/conversations/*/messages Lists messages within a specific conversation.

Additional resource