Introduction to AI in BigQuery

BigQuery provides AI, machine learning (ML), and agent capabilities across several workflows:

  • In-console assistance and analysis: write and explain code, prepare data, ask questions about your tables in natural language, build pipelines, and administer BigQuery resources in the Google Cloud console.
  • AI, search, and ML in SQL queries: call large language models (LLMs) such as Gemini, perform text and vector search, and train or run predictive ML models directly in GoogleSQL.
  • Tools for building agents: connect custom agents to BigQuery using Model Context Protocol (MCP) servers, agent frameworks, and skills, and stream agent interaction logs into BigQuery for analysis.
  • Agents in your IDE or terminal: query data, manage pipelines, and run workflows from development environments such as Antigravity, VS Code, and command-line interfaces.

Choose an AI tool

The following table maps common tasks to their corresponding BigQuery feature and where you use it.

Use case Feature Where to use it
Generate, complete, or explain SQL queries SQL code assist Google Cloud console query editor
Ask questions about your data in natural language and get answers and charts Conversational analytics Google Cloud console (Agents page) or Conversational Analytics API
Find tables, join data, run SQL or natural language queries, and visualize results in a graphical workflow BigQuery data canvas Google Cloud console
Generate automated questions and SQL queries from table metadata Data insights Google Cloud console
Get AI-generated recommendations to clean, transform, and enrich data Data preparation Google Cloud console
Create custom rules to translate other SQL dialects to GoogleSQL Interactive SQL translator Google Cloud console
Analyze and troubleshoot jobs, manage reservations, trace lineage, discover resources, or optimize queries Gemini Cloud Assist ( Preview) Google Cloud console toolbar chat pane
Generate, complete, or explain Python code Python code assist Colab Enterprise notebooks in BigQuery
Automate exploratory data analysis, ML workflows, and visualizations in a notebook Data Science Agent Colab Enterprise notebooks in BigQuery
Build, modify, and manage data pipelines using natural language prompts Data Engineering Agent Google Cloud console and Dataform workspaces
Generate text, extract structured data, classify, score, filter, or aggregate table data with LLMs Generative AI functions GoogleSQL queries
Perform translation, document processing, audio transcription, or computer vision on table data Task-specific AI functions GoogleSQL queries
Generate embeddings and run semantic or keyword search over structured, unstructured, or multimodal data Embeddings and vector search and text search GoogleSQL queries
Train, evaluate, and run predictive ML models (forecasting, anomaly detection, classification, regression, clustering) BigQuery ML GoogleSQL queries, Google Cloud console, bq command-line tool, REST API, or notebooks
Connect custom AI applications or agents to BigQuery to inspect metadata, run queries, translate SQL, or manage transfers BigQuery MCP server, BigQuery Migration Service MCP server, BigQuery Data Transfer Service MCP server, MCP Toolbox for Databases, or Agent Development Kit (ADK) MCP clients and agent frameworks
Give agents reusable instructions and reference files for BigQuery tasks BigQuery agent skills Agentic clients and terminals
Log, monitor, and evaluate agent interactions, token usage, and latency BigQuery agent analytics ADK, LangGraph, or BigQuery Storage Write API (gRPC)
Explore BigQuery resources, run queries, and build pipelines from an IDE or CLI Google Cloud Data Agent Kit, MCP IDE integrations, or Antigravity CLI Antigravity, VS Code, Cursor, or command-line tools

In-console assistance and agents

When you work in the Google Cloud console or Colab Enterprise notebooks, you can use assistive features and built-in agents to write code, explore data, build pipelines, and manage BigQuery resources.

Assistive features

Gemini in BigQuery provides in-console assistance for authoring queries, preparing data, and exploring tables:

  • SQL code assist: generate, complete, and explain SQL queries in the query editor.
  • Python code assist: generate, complete, and explain Python code, including PySpark and BigQuery DataFrames, in notebooks.
  • Data canvas: find tables, join and query data using natural language, and visualize results in a directed acyclic graph (DAG) workspace.
  • Data insights: generate natural language questions about a table and the SQL queries to answer them based on table metadata.
  • Data preparation: generate context-aware recommendations to clean, transform, and enrich your data.
  • Interactive SQL translator: create translation rules to customize how queries from other SQL dialects are translated into GoogleSQL.

Chat experiences

BigQuery offers two distinct chat experiences in the Google Cloud console, depending on whether you want to analyze data in your tables or manage your BigQuery environment:

  • Conversational analytics: answers questions about the data stored in your tables. You can chat directly with data sources or create configured data agents with custom metadata, glossary terms, instructions, and verified queries. The agent writes and runs SQL queries on your behalf and returns answers and visualizations.
  • Gemini Cloud Assist (Preview): helps you operate and administer BigQuery. Use the chat pane in the Google Cloud console toolbar to discover resources, trace data lineage, debug failed or slow jobs, analyze slot capacity and reservations, and optimize or schedule queries.

Notebook and pipeline agents

You can use the following built-in agents for data science and data engineering workflows:

  • Data Science Agent: automates exploratory data analysis, data cleaning, ML tasks, and visualizations for BigQuery tables and CSV files within a Colab Enterprise notebook.
  • Data Engineering Agent: builds, modifies, and troubleshoots Dataform data pipelines to load and process data in BigQuery using natural language prompts.

AI, search, and ML in SQL queries

You can run generative AI models, search unstructured and structured data, and train predictive ML models directly in GoogleSQL.

AI functions

BigQuery provides SQL functions that call Gemini, partner, and open models on Gemini Enterprise Agent Platform, Cloud AI APIs, or built-in models:

  • General-purpose AI functions: use these functions when you want full control over the model, prompt, output schema, and parameters.
  • Managed AI functions: use these functions for routine filtering, rating, classification, and aggregation tasks with a simplified syntax. BigQuery can choose a model for you to optimize for cost and quality.
  • Task-specific functions: call Cloud AI APIs from SQL for natural language processing, machine translation, document processing, audio transcription, and computer vision.

BigQuery supports keyword and semantic search across structured, semi-structured, and multimodal data:

  • Text search: use the SEARCH function to perform tokenized search on unstructured text or semi-structured JSON data. You can improve search performance by creating a search index, which lets BigQuery optimize queries that use the SEARCH function, as well as other functions and operators.
  • Embedding generation: generate embeddings, which are high-dimensional numerical vectors that represent entities such as text or images, by using models provided by or hosted on Agent Platform, or by using models imported and run in BigQuery. You can also have BigQuery automatically maintain a column of embeddings by enabling autonomous embedding generation.
  • Vector search: find semantically similar items for retrieval-augmented generation (RAG) or recommendations using VECTOR_SEARCH, AI.SEARCH, and vector indexes.

Machine learning

With BigQuery ML, you can train, evaluate, and run inference on models for tasks such as time series forecasting, anomaly detection, classification, regression, clustering, dimensionality reduction, and recommendations.

You can work with BigQuery ML capabilities through the Google Cloud console, the bq command-line tool, the REST API, or in Colab Enterprise notebooks. Because BigQuery ML lets SQL practitioners use existing SQL tools and skills to build and evaluate models, it democratizes ML and speeds up model development by bringing ML to the data instead of requiring data movement. You can use BigQuery ML to help you with the following types of ML tasks:

To learn more, see the Introduction to ML in BigQuery.

Tools for building and monitoring agents

If you're developing custom AI applications or agents that interact with BigQuery, you can use the following tools:

  • Managed MCP servers: connect MCP-compatible agents to managed HTTPS endpoints:
  • MCP Toolbox for Databases: run an open source local MCP server to connect agents to BigQuery or define custom tools over parameterized SQL queries.
  • ADK integrations: build agents in ADK with prebuilt BigQuery toolsets.
  • BigQuery agent skills: install reusable skill packages (bigquery-basics and bigquery-ai-ml) that provide agents with instructions and references for common BigQuery tasks.
  • BigQuery agent analytics: stream agent interaction logs—including requests, responses, tool calls, and errors—from ADK or LangGraph into BigQuery to analyze token usage, latency, and execution traces.

Agents in your IDE or terminal

You can interact with BigQuery from your local development environment or command line using the following tools:

  • Data Agent Kit: use the IDE extension (for VS Code, Antigravity, and Cursor) or the coding agent plugin (for Antigravity CLI, Gemini CLI, Claude Code, and Codex CLI) to explore datasets, run queries, build pipelines, and train ML models.
  • MCP IDE integrations: connect IDEs such as Antigravity, VS Code, Cursor, Windsurf, and Claude Code to BigQuery using the Antigravity MCP Store or MCP Toolbox for Databases.
  • Antigravity CLI: use the Antigravity CLI to run queries, manage pipelines, and interact with BigQuery resources.

What's next