google/skillsPrüfung bestanden
SKILL DETAIL
bigquery-ai-ml
google/skills/bigquery-ai-ml
>-
Installationen · 105Quelle ansehen
Installation
npx skills add https://github.com/google/skills --skill bigquery-ai-ml
Skill-Dateien
SKILL.md
Zuletzt synchronisiert · 29.08.2026
references/ai_agg.md›
# BigQuery AI.AGG
`AI.AGG` uses a Vertex AI Gemini model to aggregate data based on natural
language instructions and returns a STRING. It enables reasoning over groups of
rows, up to an entire table.
Common use cases:
- Sentiment analysis of many user reviews
- Summarization of content (e.g. log analysis, object table image
descriptions)
- Analysis of agent prompts/responses or unstructured feedback
- Categorization of user feedback, reviews, or support tickets into common
themes
## Syntax Reference
```sql
AI.AGG(
[ DISTINCT ]
input,
instruction
[, connection_id => 'CONNECTION_ID']
[, endpoint => 'ENDPOINT']
)
```
### Input Arguments
Argument | Requirement | Type | Description
:------------------ | :----------- | :------------ | :----------
**`input`** | **Required** | String/Struct | The data to be aggregated, as either a `STRING` value or a `STRUCT` object consisting of `STRING` values, [`ObjectRefRuntime` values](/bigquery/docs /reference/standard -sql/objectref _functions #objectrefruntime), and arrays of `STRING` and `ObjectRefRuntime` values. `ObjectRefRuntime` values reference text or image data in {{gcs_name}} and are generated by the [`OBJ.GET_ACCESS_URL` function](/bigquery /docs/reference /standard-sql /objectref_functions #objget_access_url).
**`instruction`** | **Required** | String | The user instruction on how to aggregate data (must be a string literal or query parameter).
**`connection_id`** | Optional | String | Identifies a cloud resource connection.
**`endpoint`** | Optional | String | The model endpoint (e.g., `'gemini-2.5-flash'`).
### Output Schema
| Column Name | Type | Description |
| :------------------ | :------- | :---------------------------------------- |
| **(Scalar Result)** | `STRING` | The summarized/aggregated result. It |
: : : returns a STRING value. If you use the :
: : : `AI.AGG` function with a `GROUP_BY` :
: : : statement, then the function returns a :
: : : STRING value for each input group. Capped :
: : : at 10000 tokens per group. :
## Execution Limitations
- Final output is capped at 10000 tokens per group. Longer outputs will be
truncated.
- Arrays of object refs using OBJ.GET_ACCESS_URL() may cause rows to be
skipped.
## Examples
### User sentiment analysis
```sql
SELECT
title,
movie_id,
AI.AGG(
review,
'You will be given user-provided reviews of a movie. Summarize the overall sentiment towards the movie.'
) AS sentiment
FROM `bigquery-public-data.imdb.reviews`
WHERE movie_id IN ('tt0339384', 'tt0084787', 'tt0029850')
GROUP BY movie_id, title;
```
### Common categories
```sql
SELECT AI.AGG(
TO_JSON_STRING(t),
'These are Wikipedia comments. What are the most used languages?'
)
FROM (SELECT * FROM `bigquery-public-data.samples.wikipedia` LIMIT 30000) AS t;
```
### Most frequent items
```sql
SELECT
AI.AGG(
TO_JSON_STRING(t),
'Among these tech news articles, what are the top 3 most referenced companies and what are they famous for?'
)
FROM `bigquery-public-data.bbc_news.fulltext` AS t
WHERE t.category = "tech";
```
### Image content summarization
```sql
SELECT AI.AGG(
STRUCT(OBJ.GET_ACCESS_URL(ref, 'r')),
'You will be provided with a series of images. What are the most common categories these images belong to?'
)
FROM multimodal.images;
```
references/ai_classify.md›
# BigQuery AI.Classify
`AI.CLASSIFY` categorizes unstructured data into a predefined set of labels.
## Syntax Reference
```sql
AI.CLASSIFY(
[ input => ] 'INPUT',
[ categories => ] 'CATEGORIES'
[, connection_id => 'CONNECTION_ID' ]
[, endpoint => 'ENDPOINT' ]
[, output_mode => 'OUTPUT_MODE' ]
)
```
### Input Arguments
| Argument | Requirement | Type | Description |
| :------------------ | :----------- | :------------ | :-------------------- |
| **`input`** | **Required** | String | The text content to |
: : : : classify. :
| **`categories`** | **Required** | Array<String> | A list of target |
: : : : categories/labels. :
: : : : Can be :
: : : : `ARRAY<STRING>` or :
: : : : `ARRAY<STRUCT<STRING, :
: : : : STRING>>` (label, :
: : : : description). :
| **`connection_id`** | Optional | String | The connection ID to |
: : : : use for the LLM. :
| **`endpoint`** | Optional | String | The model name, e.g., |
: : : : `'gemini-2.5-flash'`. :
| **`output_mode`** | Optional | String | `'single'` (default) |
: : : : or `'multi'`. :
: : : : Determines the output :
: : : : type. :
### Output Schema
The output type depends on the `output_mode` argument:
| Output Mode | output_mode Value | Type | Description |
| :--------------- | :---------------- | :-------------- | :------------------ |
| **Single Label** | `NULL` (Default) | `STRING` | The single category |
: : : : that best fits the :
: : : : input. :
| **Single Label | `'single'` | `ARRAY<STRING>` | An array containing |
: (Explicit)** : : : exactly one :
: : : : category string. :
| **Multi Label** | `'multi'` | `ARRAY<STRING>` | An array containing |
: : : : zero or more :
: : : : matching :
: : : : categories. :
## Examples
### Classify text into categories
```sql
SELECT
content,
AI.CLASSIFY(
content,
categories => ['Spam', 'Not Spam', 'Urgent'],
connection_id => 'my-project.us.my-connection'
) as classification
FROM `dataset.emails`;
```
### Classify text into multiple topics
```
SELECT
title,
body,
AI.CLASSIFY(
body,
categories => ['tech', 'sport', 'business', 'politics', 'entertainment', 'other'],
output_mode => 'multi') AS categories
FROM
`bigquery-public-data.bbc_news.fulltext`
LIMIT 100;
```
### Classify reviews by sentiment
SELECT AI.CLASSIFY( ('Classify the review by sentiment: ', review), categories
=> [('green', 'The review is positive.'), ('yellow', 'The review is neutral.'),
('red', 'The review is negative.')]) AS ai_review_rating, reviewer_rating AS
human_provided_rating, review FROM `bigquery-public-data.imdb.reviews` WHERE
title = 'The English Patient'
references/ai_detect_anomalies.md›
# BigQuery AI.Detect_Anomalies
`AI.DETECT_ANOMALIES` uses the pre-trained **TimesFM** model to identify
deviations in time series data without needing to train a custom model.
## Syntax Reference
This function compares a target dataset against a historical dataset to identify
anomalies.
```sql
SELECT *
FROM AI.DETECT_ANOMALIES(
{ TABLE `project.dataset.history_table` | (SELECT * FROM history_query) },
{ TABLE `project.dataset.target_table` | (SELECT * FROM target_query) },
data_col => 'DATA_COL',
timestamp_col => 'TIMESTAMP_COL'
[, model => 'MODEL']
[, id_cols => ID_COLS]
[, anomaly_prob_threshold => ANOMALY_PROB_THRESHOLD]
)
```
### Input Arguments
Argument | Requirement | Type | Description
:--------------------------- | :----------- | :------------ | :----------
**`historical_data`** | **Required** | Table/Query | The source table or subquery containing historical data for training context.
**`target_data`** | **Required** | Table/Query | The source table or subquery containing data to analyze for anomalies.
**`data_col`** | **Required** | String | The numeric column to analyze.
**`timestamp_col`** | **Required** | String | The column containing dates/timestamps.
**`id_cols`** | Optional | Array<String> | Grouping columns for multiple series (e.g., `['store_id']`).
**`anomaly_prob_threshold`** | Optional | Float64 | Threshold for anomaly detection (0 to 1). Defaults to 0.95.
**`model`** | Optional | String | Model version. Defaults to `'TimesFM 2.0'`.
### Output Schema
| Column | Type | Description |
| :--- | :--- | :--- |
| **`id_cols`** | (As Input) | Original identifiers for the series. |
| **`time_series_timestamp`** | TIMESTAMP | Timestamp for the analyzed points. |
| **`time_series_data`** | FLOAT64 | The original data value. |
| **`is_anomaly`** | BOOL | TRUE if the point is identified as an anomaly. |
| **`lower_bound`** | FLOAT64 | Lower bound of the expected range. |
| **`upper_bound`** | FLOAT64 | Upper bound of the expected range. |
| **`anomaly_probability`** | FLOAT64 | Probability that the point is an anomaly. |
| **`ai_detect_anomalies_status`** | STRING | Error messages or empty string on success. A minimum of 3 data points is required. |
## Examples
### Basic Anomaly Detection
Detect anomalies in daily bike trips for a specific 2-month window based on
prior history.
```sql
WITH bike_trips AS (
SELECT EXTRACT(DATE FROM starttime) AS date, COUNT(*) AS num_trips
FROM `bigquery-public-data.new_york.citibike_trips`
GROUP BY date
)
SELECT *
FROM AI.DETECT_ANOMALIES(
-- Historical context (Training data equivalent)
(SELECT * FROM bike_trips WHERE date <= DATE('2016-06-30')),
-- Target range (Data to inspect for anomalies)
(SELECT * FROM bike_trips WHERE date BETWEEN '2016-07-01' AND '2016-09-01'),
data_col => 'num_trips',
timestamp_col => 'date'
);
```
### Multivariate Detection (Multiple Series)
Use `id_cols` to detect anomalies separately for different user types (e.g.,
Subscriber vs. Customer) in the same query.
```sql
WITH bike_trips AS (
SELECT
EXTRACT(DATE FROM starttime) AS date, usertype, gender,
COUNT(*) AS num_trips
FROM `bigquery-public-data.new_york.citibike_trips`
GROUP BY date, usertype, gender
)
SELECT *
FROM
AI.DETECT_ANOMALIES(
# Historical data from a query
(SELECT * FROM bike_trips WHERE date <= DATE('2016-06-30')),
# Target data from a query
(SELECT * FROM bike_trips WHERE date BETWEEN '2016-07-01' AND '2016-09-01'),
data_col => 'num_trips',
timestamp_col => 'date',
id_cols => ['usertype', 'gender'],
model => "TimesFM 2.5",
anomaly_prob_threshold => 0.8);
```
references/ai_evaluate.md›
# AI.EVALUATE
Evaluates the accuracy of a forecasting model by comparing predicted values
against actual historical data. It computes standard regression metrics like
MAE, MSE, and RMSE.
## Syntax
```sql
SELECT
*
FROM
AI.EVALUATE(
{ TABLE `project.dataset.history_table` | (HISTORY_QUERY) },
{ TABLE `project.dataset.actual_table` | (ACTUAL_QUERY) },
data_col => 'DATA_COL',
timestamp_col => 'TIMESTAMP_COL'
[, model => 'MODEL']
[, id_cols => ID_COLS]
[, horizon => HORIZON]
)
```
## Input Arguments
| Argument | Requirement | Type | Description |
| :--- | :--- | :--- | :--- |
| **`history_data`** | **Required** | | The table or query containing historical data used for the forecast. |
| **`actual_data`** | **Required** | | The table or query containing the actual "ground truth" data. |
| **`data_col`** | **Required** | String | The numeric column to evaluate. |
| **`timestamp_col`** | **Required** | String | The column containing dates/timestamps. |
| **`id_cols`** | Optional | Array<String> | Grouping columns for multiple series. |
| **`horizon`** | Optional | Int64 | Number of points to evaluate. Defaults to 1024. |
| **`model`** | Optional | String | Model version (e.g., `'TimesFM 2.0'`). |
## Output Schema
| Column | Type | Description |
| :--- | :--- | :--- |
| **`id_cols`** | (As Input) | Original identifiers for the series (if provided). |
| **`mean_absolute_error`** | FLOAT64 | Average magnitude of errors in the predictions. |
| **`mean_squared_error`** | FLOAT64 | Average of the squares of the errors. |
| **`root_mean_squared_error`**| FLOAT64 | Square root of the mean squared error. |
| **`mean_absolute_percentage_error`** | FLOAT64 | Mean absolute percentage error for the series. |
| **`symmetric_mean_absolute_percentage_error`** | FLOAT64 | Symmetric mean absolute percentage error for the series. |
| **`ai_evaluate_status`** | STRING | Error messages or empty string on success. |
## Example: Evaluating Forecast Quality
```sql
SELECT * FROM AI.EVALUATE(
(SELECT * FROM `sales` WHERE date < '2024-01-01'),
(SELECT * FROM `sales` WHERE date >= '2024-01-01'),
data_col => 'total_sales',
timestamp_col => 'date',
id_cols => ['store_id']
);
```
references/ai_forecast.md›
# BigQuery AI.Forecast
`AI.FORECAST` leverages the pre-trained **TimesFM** foundation model to generate
forecasts without the need to train and manage custom models.
## Syntax Reference
```sql
SELECT
*
FROM
AI.FORECAST(
{ TABLE `project.dataset.table` | (QUERY_STATEMENT) },
data_col => 'DATA_COL',
timestamp_col => 'TIMESTAMP_COL'
[, model => 'MODEL']
[, id_cols => ID_COLS]
[, horizon => HORIZON]
[, confidence_level => CONFIDENCE_LEVEL]
[, output_historical_time_series => OUTPUT_HISTORICAL_TIME_SERIES]
[, context_window => CONTEXT_WINDOW]
)
```
### Input Arguments
| Argument | Requirement | Type | Description |
| :--------------------- | :----------- | :------------ | :---------------- |
| **`input_data`** | **Required** | | The source table or subquery containing historical data. |
| **`data_col`** | **Required** | String | The numeric column to predict. |
| **`timestamp_col`** | **Required** | String | The column containing dates/timestamps. |
| **`id_cols`** | Optional | Array<String> | Grouping columns for multiple series (e.g., `['store_id']`). |
| **`horizon`** | Optional | Int64 | Number of future points to predict. Defaults to 10. The valid input range is [1, 10,000]. |
| **`confidence_level`** | Optional | Float64 | Confidence interval (0 to 1). Defaults to 0.95. |
| **`model`** | Optional | String | Model version. Defaults to `TimesFM 2.0`. |
| **`context_window`** | Optional | Int64 | The number of historical data points the model uses to forecast. The min value is 64 and the max value is 2048 for `TimesFM 2.0`. If not set, the model determines this automatically. |
### Output Schema
The schema adjusts based on the `output_historical_time_series` flag.
Column | Type | Included if output_historical_time_series=FALSE | Included if output_historical_time_series=TRUE | Description
:------------------------------------ | :--------- | :---------------------------------------------- | :--------------------------------------------- | :----------
**`id_cols`** | (As Input) | Yes | Yes | Original identifiers for the series.
**`forecast_timestamp`** | TIMESTAMP | **Yes** | No | Timestamp for predicted points.
**`forecast_value`** | FLOAT64 | **Yes** | No | The 50% quantile (median) prediction.
**`time_series_timestamp`** | TIMESTAMP | No | **Yes** | Uniform timestamp column for both history and forecast.
**`time_series_data`** | FLOAT64 | No | **Yes** | Merged column: actual values for history, median for forecast.
**`time_series_type`** | STRING | No | **Yes** | Label: `'history'` or `'forecast'`.
**`prediction_interval_lower_bound`** | FLOAT64 | Yes | Yes | Lower bound (NULL for historical rows).
**`prediction_interval_upper_bound`** | FLOAT64 | Yes | Yes | Upper bound (NULL for historical rows).
**`confidence_level`** | FLOAT64 | Yes | Yes | The constant confidence level used.
**`ai_forecast_status`** | STRING | Yes | Yes | Error messages or empty string on success. A minimum of 3 data points is required.
## Examples
### Forecasting with History
```sql
WITH
citibike_trips AS (
SELECT EXTRACT(DATE FROM starttime) AS date, usertype, COUNT(*) AS num_trips
FROM `bigquery-public-data.new_york.citibike_trips`
GROUP BY date, usertype
)
SELECT *
FROM
AI.FORECAST(
TABLE citibike_trips,
data_col => 'num_trips',
timestamp_col => 'date',
id_cols => ['usertype'],
horizon => 30,
output_historical_time_series => true);
```
references/ai_generate_embedding.md›
# AI.GENERATE_EMBEDDING
Used to generate high-dimensional numerical vectors (embeddings) for text or
visual content. These embeddings can be used for semantic search, clustering,
and recommendation systems.
## Syntax
```sql
SELECT
*
FROM
AI.GENERATE_EMBEDDING(
MODEL `project.dataset.model`,
{ TABLE `project.dataset.table` | (QUERY_STATEMENT) }
[, STRUCT(
[TASK_TYPE AS task_type]
[, OUTPUT_DIMENSIONALITY AS output_dimensionality]) ]
)
```
## Input Arguments
| Argument | Requirement | Type | Description |
| :--- | :--- | :--- | :--- |
| **`model`** | **Required** | | The model resource (e.g., `project.dataset.model`). |
| **`input_data`** | **Required*** | | The source table or `SELECT` statement containing the data to embed. |
| **`task_type`** | Optional | String | The intended downstream application (e.g., `RETRIEVAL_QUERY`, `RETRIEVAL_DOCUMENT`). |
| **`output_dimensionality`** | Optional | Int64 | The number of dimensions to use when generating embeddings. |
\* *`input_data` is optional for matrix factorization models.*
## Output Schema
| Column | Type | Description |
| :--- | :--- | :--- |
| **`[Input Columns]`** | (As Input) | Every column included in your input data. |
| **`embedding`** | ARRAY<FLOAT64> | The generated numerical vector. |
| **`statistics`** | JSON | Metadata about the generation, such as token count. |
| **`status`** | STRING | Execution status; contains error messages on failure. |
## Example: Generating Text Embeddings
```sql
-- Generate embeddings for a literal string
SELECT *
FROM
AI.GENERATE_EMBEDDING(
MODEL `mydataset.text_embedding`,
(SELECT "Example text to embed" AS content)
);
```
references/ai_generate_table.md›
# AI.GENERATE_TABLE
Uses Gemini models to extract information into a predefined SQL schema. It is a
"Table-Valued Function," meaning it is called in the `FROM` clause.
## Syntax
```sql
SELECT
*
FROM
AI.GENERATE_TABLE(
MODEL `project.dataset.model`,
{ TABLE `project.dataset.table` | (QUERY_STATEMENT) },
STRUCT(
OUTPUT_SCHEMA AS output_schema
[, MAX_OUTPUT_TOKENS AS max_output_tokens]
[, TOP_P AS top_p]
[, TEMPERATURE AS temperature]
[, STOP_SEQUENCES AS stop_sequences]
[, SAFETY_SETTINGS AS safety_settings]
[, REQUEST_TYPE AS request_type])
)
```
## Input Arguments
| Argument | Requirement | Type | Description |
| :--- | :--- | :--- | :--- |
| **`model`** | **Required** | | The remote model resource (e.g., `project.dataset.model`). |
| **`input_data`** | **Required** | | The source table or `SELECT` statement. Must contain a column named or aliased as `prompt`. |
| **`output_schema`** | **Required** | String | A `STRUCT` containing SQL-style column definitions (e.g., `"name STRING, qty INT64"`). |
| **`max_output_tokens`** | Optional | Int64 | [1, 8192]. Limits response length. |
| **`temperature`** | Optional | Float64 | [0.0, 2.0]. Degree of randomness (0.0 is recommended for deterministic responses). |
| **`top_p`** | Optional | Float64 | [0.0, 1.0]. Changes how the model selects tokens for output. |
| **`stop_sequences`** | Optional | Array<String> | Strings that halt model generation if matched. |
| **`safety_settings`** | Optional | Array<Struct> | Thresholds to filter hate speech, harassment, etc. |
| **`request_type`** | Optional | String | `SHARED`, `DEDICATED`, or `UNSPECIFIED` (defaults to `UNSPECIFIED`). |
### Prompt Construction (STRUCT Fields)
When using a `QUERY_STATEMENT`, you can build multimodal prompts by combining
types:
* **`STRING` / `ARRAY<STRING>`**: Literal text or column names.
* **`ObjectRefRuntime`**: Use `OBJ.GET_ACCESS_URL(col, 'r')` for images/PDFs.
## Output Schema
The output table is a join of your source data and the model's generated
content. It preserves all original input columns to maintain traceability.
| Column | Type | Description |
| :--- | :--- | :--- |
| **`[Input Columns]`** | (As Input) | Every column included in your input `TABLE` or `QUERY_STATEMENT`. |
| **`[Schema Columns]`**| (As Defined)| The typed columns you specified in the `OUTPUT_SCHEMA` argument. |
| **`full_response`** | JSON | The raw, unparsed JSON response from the underlying Gemini model. |
| **`status`** | STRING | Execution status; will contain error messages if a row fails extraction. |
## Example: Preserving Keys During LLM Summarization
```sql
-- The output includes 'ticket_id' from the input and 'priority' and 'issue_summary' from the AI schema
SELECT
ticket_id,
priority,
issue_summary
FROM AI.GENERATE_TABLE(
MODEL `prod.models.gemini_flash`,
(SELECT ticket_id, body AS prompt FROM `support.tickets`),
STRUCT("priority STRING, issue_summary STRING" AS output_schema)
)
```
references/ai_generate.md›
# BigQuery AI.Generate
`AI.GENERATE` is a general-purpose function for text and content generation.
## Syntax Reference
```sql
AI.GENERATE(
[ prompt => ] 'PROMPT',
[, endpoint => 'ENDPOINT']
[, model_params => 'MODEL_PARAMS']
[, output_schema => 'OUTPUT_SCHEMA']
[, connection_id => 'CONNECTION_ID']
[, request_type => 'REQUEST_TYPE']
)
```
### Input Arguments
| Argument | Requirement | Type | Description |
| :------------------ | :----------- | :----- | :-------------------- |
| **`prompt`** | **Required** | String | The prompt text or instruction for the model. |
| **`connection_id`** | Optional | String | The connection ID. Optional if configured via other means or testing. |
| **`endpoint`** | Optional | String | The model name, e.g., `'gemini-2.5-flash'`. |
| **`output_schema`** | Optional | String | Schema definition for structured output, e.g., `'answer BOOL, reason STRING'`. |
| **`request_type`** | Optional | String | `'DEDICATED'` or `'SHARED'`. |
| **`model_params`** | Optional | JSON | JSON object for model parameters (e.g., `temperature`, `max_output_tokens`). |
### Output Schema
Returns a `STRUCT` with the following fields:
| Column Name | Type | Description |
| :------------------ | :------------------- | :----------------------------- |
| **`result`** | `STRING` (or Custom) | The generated content. If `output_schema` is used, this field is replaced by the schema's fields. |
| **`status`** | `STRING` | API response status (empty on success). |
| **`full_response`** | `JSON` | The complete raw JSON response from the model (including safety ratings, usage metadata). |
## Examples
### Basic Text Generation
```sql
SELECT
AI.GENERATE(
'Summarize this article: ' || article_content,
connection_id => 'my-project.us.my-connection',
endpoint => 'gemini-2.5-flash'
) as summary
FROM `dataset.articles`
LIMIT 5;
```
### Structured Output Generation
```sql
SELECT
AI.GENERATE(
'Extract the date and amount from this invoice: ' || invoice_text,
output_schema => 'date DATE, amount FLOAT64'
) as extracted_data
FROM `dataset.invoices`;
```
### Process images in a Cloud Storage bucket
```sql
CREATE SCHEMA IF NOT EXISTS bqml_tutorial;
CREATE OR REPLACE EXTERNAL TABLE bqml_tutorial.product_images
WITH CONNECTION DEFAULT OPTIONS (
object_metadata = 'SIMPLE',
uris = ['gs://cloud-samples-data/bigquery/tutorials/cymbal-pets/images/*.png']);
SELECT
uri,
STRING(OBJ.GET_ACCESS_URL(ref,'r').access_urls.read_url) AS signed_url,
AI.GENERATE(
("What is this: ", OBJ.GET_ACCESS_URL(ref, 'r')),
output_schema =>
"image_description STRING, entities_in_the_image ARRAY<STRING>").*
FROM bqml_tutorial.product_images
WHERE uri LIKE "%aquarium%";
```
references/ai_if.md›
# BigQuery AI.If
`AI.IF` is a semantic boolean function used to evaluate a condition described in
natural language.
The function can be used to filter and join data based on conditions described
in natural language or multimodal input. The following are common use cases:
- Sentiment analysis: Find customer reviews with negative sentiment.
- Topic analysis: Identify news articles related to a specific subject.
- Image analysis: Select images that contain a specific item.
- Security: Identify suspicious emails.
## Syntax Reference
```sql
AI.IF(
[ prompt => ] 'PROMPT'
[, connection_id => 'CONNECTION_ID' ]
[, endpoint => 'ENDPOINT' ]
)
```
### Input Arguments
| Argument | Requirement | Type | Description |
| :------------------ | :----------- | :------------ | :--------------------- |
| **`prompt`** | **Required** | String/Struct | The prompt text or a |
: : : : struct/tuple of :
: : : : `(data, instruction)`. :
| **`connection_id`** | Optional | String | The connection ID to |
: : : : use for the LLM. :
| **`endpoint`** | Optional | String | The model endpoint |
: : : : (e.g. :
: : : : `'gemini-2.5-flash'`). :
### Output Schema
| Column Name | Type | Description |
| :------------------ | :----- | :---------------------------------------- |
| **(Scalar Result)** | `BOOL` | `TRUE` if the condition is met, `FALSE` |
: : : otherwise. Returns `NULL` on error/safety :
: : : filter. :
## Examples
### Filter rows based on semantic meaning
```sql
SELECT *
FROM `dataset.table`
WHERE AI.IF(
(content_column, 'Is this review positive?')
);
```
references/ai_key_drivers.md›
# BigQuery AI.Key_Drivers
`AI.KEY_DRIVERS` automatically identifies the key dimensional segments most
responsible for driving changes in a specified metric between a defined interest
group and a reference group.
## Syntax Reference
```sql
SELECT
*
FROM
AI.KEY_DRIVERS(
{ TABLE TABLE | (QUERY_STATEMENT) },
metric_col => 'METRIC_COL',
dimension_cols => DIMENSION_COLS,
interest_label_col => 'INTEREST_LABEL_COL'
[, min_apriori_support => MIN_APRIORI_SUPPORT]
[, top_k => TOP_K]
[, enable_pruning => ENABLE_PRUNING]
)
```
### Input Arguments
Argument | Requirement | Type | Description
:------------------------ | :----------- | :-------------- | :----------
**`input_data`** | **Required** | | The source table or subquery containing the data to analyze.
**`metric_col`** | **Required** | `STRING` | Metric column name. Must be of type: INT64, NUMERIC, BIGNUMERIC, or FLOAT64.
**`interest_label_col`** | **Required** | `STRING` | Boolean column name: `TRUE` for interest group, `FALSE` for reference group.
**`dimension_cols`** | **Required** | `ARRAY<STRING>` | 1-12 dimension columns (INT64, BOOL, STRING); cannot be `metric_col` or `interest_label_col`.
**`min_apriori_support`** | Optional | `FLOAT64` | Minimum apriori support threshold [0, 1] for output segments. Default: 0.1. Cannot be used with `top_k`.
**`top_k`** | Optional | `INT64` | Return top k insights [1, 1M] by apriori support. If unset, uses `min_apriori_support=0.1`. Cannot be used with `min_apriori_support`.
**`enable_pruning`** | Optional | `BOOL` | If `TRUE` (default), redundant insights are pruned. If `FALSE`, all insights meeting thresholds are returned. Two segments are redundant if two conditions are met: 1) their metric values are equal 2) The dimensions and corresponding values of one row are a subset of the dimensions and corresponding values of the other. In this case, the row with more dimensions (the more descriptive row) is kept.
### Output Schema
Returns a `STRUCT` with the following fields:
Column Name | Type | Description
:----------------------------------- | :-------------- | :----------
**`drivers`** | `ARRAY<STRING>` | Provides a list of drivers, or dimension values of interest, which describes each of the segments.
**`metric_interest`** | `NUMERIC` | The sum of the metric_column for the data in the interest segment.
**`metric_reference`** | `NUMERIC` | The sum of the metric_column for data in the reference segment.
**`difference`** | `NUMERIC` | The difference between the interest and reference metric values for a segment.
**`relative_difference`** | `NUMERIC` | The relative change of a segment, calculated as the difference divided by the reference metric value.
**`unexpected_difference`** | `NUMERIC` | Measures deviation of segment from the rest of the population's growth. Calculated as: (segment relative_difference - complement relative_difference) * segment reference metric.
**`relative_unexpected_difference`** | `NUMERIC` | The unexpected_difference divided by the expected interest metric value for a segment.
**`contribution`** | `NUMERIC` | Contains the absolute value of the difference value: `ABS(difference)`.
**`apriori_support`** | `NUMERIC` | Segment size relative to the total population (filters small segments).
## Examples
### Identifying Key Drivers in 2024 H2 Liquor Sales
```sql
WITH InputData AS (
SELECT
sale_dollars,
city,
category_name,
vendor_name,
(date > '2024-07-01') AS IS_H2
FROM `bigquery-public-data.iowa_liquor_sales.sales`
WHERE EXTRACT(YEAR FROM DATE) = 2024
)
SELECT *
FROM AI.KEY_DRIVERS(
TABLE InputData,
metric_col => 'sale_dollars',
dimension_cols => ['city', 'vendor_name', 'category_name'],
interest_label_col => 'IS_H2',
min_apriori_support => 0
);
```
### Finding Top 5 Key Drivers in Bottle Costs
```sql
SELECT *
FROM AI.KEY_DRIVERS(
(
SELECT
state_bottle_cost,
city,
category_name,
(EXTRACT(MONTH FROM date) >= 7) AS is_h2
FROM `bigquery-public-data.iowa_liquor_sales.sales`
WHERE EXTRACT(YEAR FROM date) = 2024
),
metric_col => 'state_bottle_cost',
dimension_cols => ['city', 'category_name'],
interest_label_col => 'is_h2',
top_k => 5
);
```
references/ai_score.md›
# BigQuery AI.Score
The `AI.SCORE` function is commonly used with the ORDER BY clause and works well
when you want to rank items. The following are common use cases:
- Retail: Find the top 5 most negative customer reviews about a product.
- Hiring: Find the top 10 resumes that appear most qualified for a job post.
- Customer success: Find the top 20 best customer support interactions.
## Syntax Reference
```sql
AI.SCORE(
[ prompt => ] 'PROMPT'
[, connection_id => 'CONNECTION_ID' ]
[, endpoint => 'ENDPOINT' ]
)
```
### Input Arguments
| Argument | Requirement | Type | Description |
| :------------------ | :----------- | :------------ | :--------------------- |
| **`prompt`** | **Required** | String/Struct | The prompt text or a |
: : : : struct/tuple of :
: : : : `(data, instruction)`. :
| **`connection_id`** | Optional | String | The connection ID to |
: : : : use for the LLM. :
| **`endpoint`** | Optional | String | The model endpoint |
: : : : (e.g. :
: : : : `'gemini-2.5-flash'`). :
### Output Schema
| Column Name | Type | Description |
| :------------------ | :-------- | :----------------------------------------- |
| **(Scalar Result)** | `FLOAT64` | A numerical score representing the degree |
: : : to which the data matches the instruction. :
## Examples
### Rank rows by semantic relevance
```sql
SELECT *
FROM `dataset.table`
ORDER BY AI.SCORE(
(content_column, 'relevance to sports'),
connection_id => 'my-project.us.my-connection'
) DESC
LIMIT 10;
```
references/ai_search.md›
# BigQuery AI.Search
`AI.SEARCH` is a table-valued function for semantic search on tables that have
autonomous embedding generation enabled. If your table has a column that has
generated_expression metadata with format "AI.EMBED(source_column)", then
AI.SEARCH uses it to optimize the search.
You can use AI.SEARCH to help with the following tasks:
- Semantic search: search entities ranked by semantic similarity.
- Recommendation: return entities with attributes similar to a given entity.
- Classification: return the class of entities whose attributes are similar to
the given entity.
- Clustering: cluster entities whose attributes are similar to a given entity.
- Outlier detection: return entities whose attributes are least related to the
given entity.
## Syntax Reference
```sql
AI.SEARCH(
{ TABLE base_table | base_table_query },
column_to_search,
query_value
[, top_k => top_k_value ]
[, distance_type => distance_type_value ]
[, options => options_value]
)
```
**IMPORTANT:** Do not add "column_to_search =>" prefixes to the column_to_search
argument because column_to_search is a positional argument.
### Input Arguments
Argument | Requirement | Type | Description
:--------------------- | :----------- | :------- | :----------
**`base_table`** | **One Of** | Table | The table to search for nearest neighbor embeddings. The table must have autonomous embedding generation enabled.
**`base_table_query`** | **One Of** | Subquery | The query that you can use to pre-filter the base table. Only SELECT, FROM, and WHERE clauses are allowed in this query. Don't apply any filters to the embedding column.
**`column_to_search`** | **Required** | STRING | A STRING literal that contains the name of the string column to search
**`query_value`** | **Required** | STRING | A string literal that represents the search query.
**`top_k`** | Optional | INT64 | A named argument with an INT64 value, specifies the number of nearest neighbors to return. The default is 10.
**`distance_type`** | Optional | STRING | A named argument with a STRING value. distance_type_value specifies the type of metric to use to compute the distance between two vectors. Supported distance types are EUCLIDEAN, COSINE, and DOT_PRODUCT. The default is EUCLIDEAN. Recommend to use COSINE.
**`options`** | Optional | STRING | A named argument with a JSON-formatted STRING value that specifies the following search options: `fraction_lists_to_search` or `use_brute_force`
### Output Schema
Column Name | Type | Description
:------------- | :------ | :----------------------------------------------------
**`base`** | STRUCT | A struct containing all columns from the input table.
**`distance`** | FLOAT64 | The distance score between the query and the result.
## Examples
```sql
# Create a table with a product column, a description column, and an autonomous
# embedding generation column over the descrption column.
CREATE TABLE mydataset.products (
name STRING,
description STRING,
description_embedding STRUCT<result ARRAY<FLOAT64>, status STRING>
GENERATED ALWAYS AS (AI.EMBED(
description,
connection_id => 'us.example_connection',
endpoint => 'text-embedding-005'
))
STORED OPTIONS( asynchronous = TRUE )
);
# Get all really fun toy products.
SELECT
base.name,
base.description,
distance
FROM AI.SEARCH(TABLE mydataset.products, 'description', "A really fun toy", distance_type => "COSINE");
# Get top 5 fun toy products.
SELECT DISTINCT(base.description)
FROM AI.SEARCH(TABLE `mydataset.products`, 'description', "A really fun toy", distance_type => "COSINE", top_k => 100)
LIMIT 5;
```
references/ai_similarity.md›
# BigQuery AI.Similarity
`AI.SIMILARITY` computes the semantic similarity between two inputs.
Use cases include the following:
- Semantic search: Search for text or images based off a description, without
having to match specific keywords.
- Recommendation: Return entities with attributes similar to a given entity.
## Syntax Reference
```sql
AI.SIMILARITY(
content1 => 'CONTENT1',
content2 => 'CONTENT2'
[, endpoint => 'ENDPOINT']
[, model_params => 'MODEL_PARAMS']
[, connection_id => 'CONNECTION_ID']
)
```
### Input Arguments
| Argument | Requirement | Type | Description |
| :------------------ | :----------- | :-------- | :----------------------- |
| **`content1`** | **Required** | String or | The first text content |
: : : ObjectRef : or image context. :
| **`content2`** | **Required** | String or | The second text content |
: : : ObjectRef : or image to compare :
: : : : against. :
| **`connection_id`** | Optional | String | The connection ID to use |
: : : : for the LLM. :
| **`endpoint`** | Optional | String | The model endpoint (e.g. |
: : : : `'text-embedding-005'`). :
| **`model_params`** | Optional | JSON | JSON object for model |
: : : : parameters (e.g., :
: : : : `temperature`, :
: : : : `max_output_tokens`). :
### Output Schema
| Column Name | Type | Description |
| :------------------ | :-------- | :---------------------------------- |
| **(Scalar Result)** | `FLOAT64` | A similarity score (e.g., cosine |
: : : similarity). Returns null if error. :
## Examples
### Compute semantic similarity between two text inputs
```sql
SELECT AI.SIMILARITY(
content1 => 'The cat sat on the mat',
content2 => 'A feline is resting on the rug'
) as similarity_score;
```
### Compute semantic similarity between text and image
```sql
CREATE SCHEMA IF NOT EXISTS cymbal_pets;
CREATE OR REPLACE EXTERNAL TABLE cymbal_pets.product_images
WITH CONNECTION DEFAULT
OPTIONS (
object_metadata = 'SIMPLE',
uris = ['gs://cloud-samples-data/bigquery/tutorials/cymbal-pets/images/*.png']
);
SELECT
uri,
OBJ.GET_READ_URL(ref) AS signed_url,
ai.similarity(
"aquarium device",
ref,
endpoint => 'multimodalembedding@001') AS similarity_score
FROM cymbal_pets.product_images
ORDER BY similarity_score DESC
LIMIT 3;
```
references/ml_contribution_analysis.md›
# Contribution Analysis
Contribution analysis, also called key driver analysis, is a method used to
generate insights about changes to key metrics in your multi-dimensional data.
## Syntax
To use contribution analysis in BigQuery ML, create a contribution analysis
model with the CREATE MODEL statement.
After you have created a contribution analysis model, you can use the
ML.GET_INSIGHTS function to retrieve the metric information calculated by the
model.
### CREATE MODEL Syntax
```sql
CREATE OR REPLACE MODEL `project.dataset.model_name`
OPTIONS (
MODEL_TYPE = 'CONTRIBUTION_ANALYSIS',
CONTRIBUTION_METRIC = 'contribution_metric',
IS_TEST_COL = 'is_test_col'
[, DIMENSION_ID_COLS = dimension_column_array]
[, MIN_APRIORI_SUPPORT = min_apriori_support]
[, TOP_K_INSIGHTS_BY_APRIORI_SUPPORT = top_k_insights_by_apriori_support]
[, PRUNING_METHOD = {'NO_PRUNING', 'PRUNE_REDUNDANT_INSIGHTS'}]
)
AS query_statement;
```
### Options
| Option | Requirement | Type | Description |
| :--- | :--- | :--- | :--- |
| **`MODEL_TYPE`** | **Required** | String | Must be `'CONTRIBUTION_ANALYSIS'`. |
| **`CONTRIBUTION_METRIC`** | **Required** | String | The metric to analyze. Supported metric is `SUM(metric_column_name)`. |
| **`IS_TEST_COL`** | **Required** | String | The name of the boolean column that distinguishes test data (TRUE) from control data (FALSE). |
| **`DIMENSION_ID_COLS`** | Optional | Array<String> | The columns to use as dimensions for segmenting the data. Defaults to all columns in the input data that aren't specified in other options. Restricted to columns of type `INT64`, `BOOL`, or `STRING`. Limited to a max of 50 columns.|
| **`MIN_APRIORI_SUPPORT`** | Optional | Float64 | Minimum support threshold to prune small segments. Cannot be used with `TOP_K_INSIGHTS_BY_APRIORI_SUPPORT`. Defaults to 0.1 if neither is specified. The value is in the range of [0, 1]. |
| **`TOP_K_INSIGHTS_BY_APRIORI_SUPPORT`** | Optional | Int64 | The maximum number of insights to output with the highest apriori support value. Cannot be used with `MIN_APRIORI_SUPPORT`. This value should be within the interval [1, 1,000,000]|
| **`PRUNING_METHOD`** | Optional | String | The pruning method used to filter insights. Supported: `'NO_PRUNING'`, `'PRUNE_REDUNDANT_INSIGHTS'`. Defaults to `'NO_PRUNING'`. `PRUNE_REDUNDANT_INSIGHTS` prunes redundant segments, excluding the `all` segment. Two segments are redundant if two conditions are met: 1) their metric values are equal 2) The dimension IDs and corresponding values of one row are a subset of the dimension IDs and corresponding values of the other. In this case, the row with more dimension IDs (the more descriptive row) is kept.|
---
## ML.GET_INSIGHTS Syntax
Use `ML.GET_INSIGHTS` to retrieve the results from the model:
```sql
ML.GET_INSIGHTS(
MODEL `PROJECT_ID.DATASET.MODEL_NAME`
)
```
### Output Schema
| Column | Description |
| :--- | :--- |
| **`contributors`** | The dimension values for a given segment (e.g., `['dim1=val1', 'dim2=val2']`). |
| **`metric_test`** | A numeric value that contains the sum of the value of the metric column in the test dataset for the given segment. |
| **`metric_control`** | A numeric value that contains the sum of the value of the metric column in the control dataset for the given segment. |
| **`difference`** | A numeric value that contains the difference between the metric_test and metric_control values: `metric_test - metric_control`. |
| **`relative_difference`** | A numeric value that contains the relative change in the segment value between the test and control datasets. |
| **`unexpected_difference`** | A numeric value that contains the unexpected difference between the segment's actual metric_test value and the segment's expected metric_test value, which is determined by comparing the ratio of change for this segment against the complement ratio of change. |
| **`relative_unexpected_difference`** | A numeric value that contains the ratio between the unexpected_difference value and the expected_metric_test value. |
| **`apriori_support`** | The proportion of the total metric in the test and control sets that this segment represents. |
| **`contribution`** | A numeric value that contains the absolute value of the difference value. |
---
## Example: Analyzing Revenue Change
```sql
-- 1. Create the model
CREATE OR REPLACE MODEL `my_project.my_dataset.revenue_analysis`
OPTIONS (
MODEL_TYPE = 'CONTRIBUTION_ANALYSIS',
is_test_col = 'is_current_year',
dimension_id_cols = ['region', 'product_category', 'customer_segment'],
contribution_metric = 'SUM(revenue)'
) AS
SELECT
region,
product_category,
customer_segment,
revenue,
IF(date >= '2024-01-01', TRUE, FALSE) AS is_current_year
FROM
`my_project.my_dataset.sales_data`;
-- 2. Get insights
SELECT
*
FROM
ML.GET_INSIGHTS(MODEL `my_project.my_dataset.revenue_analysis`)
ORDER BY
unexpected_difference DESC;
```
references/remote_models.md›
# Creating Remote Models
Generative and embedding functions require a remote model that points to a
specific endpoint (e.g., Gemini). Remote models are created using a connection
to interact with Vertex AI.
### Syntax
```sql
CREATE [OR REPLACE] MODEL `project.dataset.model_name`
REMOTE WITH CONNECTION { DEFAULT | `project.region.connection_id` }
OPTIONS (ENDPOINT = 'endpoint_name');
```
### Available Endpoints
* **Generative**: `gemini-2.5-pro`, `gemini-2.5-flash`
* **Embedding**: `text-embedding-005`, `text-multilingual-embedding-002`,
`gemini-embedding-001`.
### Connection Usage
If `REMOTE WITH CONNECTION DEFAULT` is used, BigQuery automatically attempts to
use a default connection in the model's region. Default connection should be
the default behavior. Otherwise, you must specify a fully qualified connection
ID (e.g., `my-project.us.my-connection`).
references/vector_search.md›
# VECTOR_SEARCH
BigQuery `VECTOR_SEARCH` is a table-valued function used to find semantically
similar entities by searching embeddings in a base table against embeddings in a
query table.
## Syntax
```sql
VECTOR_SEARCH(
{ TABLE base_table | (base_table_query) },
column_to_search,
{ TABLE query_table | (query_table_query) },
[, query_column_to_search => query_column_to_search_value]
[, top_k => top_k_value ]
[, distance_type => distance_type_value ]
[, options => options_value ]
)
```
### Arguments
| Argument | Requirement | Type | Description |
| :--- | :--- | :--- | :--- |
| **`base_table`** | **One Of** | TABLE | The table containing the embeddings to search. Mutually exclusive with base_table_query. |
| **`base_table_query`** | **One Of** | QUERY | A query that you can use to pre-filter the base table. Only SELECT, FROM, and WHERE clauses are allowed in this query. Don't apply any filters to the embedding column. Mutually exclusive with base_table. |
| **`column_to_search`** | **Required** | String | The name of the base table column containing embeddings (`ARRAY<FLOAT64>` or `STRING`). |
| **`query_table`** | **One Of** | TABLE | The table that provides the embeddings for which to find nearest neighbors. All columns are passed through as output columns. Mutually exclusive with query_table_query |
| **`query_table_query`** | **One Of** | QUERY | A query that provides the embeddings for which to find nearest neighbors. All columns are passed through as output columns. Mutually exclusive with query_table |
| **`query_column_to_search`** | Optional | String | The name of the column in the query table. Defaults to `column_to_search`. The value can be either `STRING` or `ARRAY<FLOAT64>`. If `STRING`, the base_table must have autonomous embedding generation enabled. The string values are embedded at runtime using the same connection and endpoint specified for the base table's embedding generation. If the value is an `ARRAY<FLOAT64>`, all elements in the array must be non-NULL and all values in the column must have the same array dimensions as the values in the column_to_search column.|
| **`top_k`** | Optional | Int64 | The number of nearest neighbors to return. Defaults to 10. |
| **`distance_type`** | Optional | String | The metric to use: `'EUCLIDEAN'`, `'COSINE'`, or `'DOT_PRODUCT'`. Defaults to `'EUCLIDEAN'`. |
| **`options`** | Optional | String | JSON string for search options (e.g., `use_brute_force`, `fraction_lists_to_search`). |
### Output Columns
| Column | Type | Description |
| :--- | :--- | :--- |
| **`base`** | STRUCT | A STRUCT value that contains all columns from base_table or a subset of the columns from base_table that you selected in the base_table_query query. |
| **`query`** | STRUCT | A STRUCT value that contains all selected columns from the query data. This column is only included in the output if you use the batch search syntax. For single vector searches, this column is omitted.|
| **`distance`** | FLOAT64 | A FLOAT64 value that represents the distance between the base data and the query data. |
---
## Example: Combined Vector Search with AI.GENERATE_EMBEDDING
```sql
SELECT
query.content AS search_query,
base.product_name,
base.description,
distance
FROM
VECTOR_SEARCH(
TABLE `my_project.my_dataset.products`,
'product_embedding',
(
SELECT
content,
embedding
FROM
AI.GENERATE_EMBEDDING(
MODEL `my_project.my_dataset.embedding_model`,
(SELECT "high-performance running shoes" AS content)
)
),
top_k => 5,
distance_type => 'COSINE'
);
```
---
## Example: Optimized Single Search
This version is optimized for finding neighbors for a single value.
```sql
SELECT
base.product_name,
base.description,
distance
FROM
VECTOR_SEARCH(
TABLE `my_project.my_dataset.products`,
'product_embedding',
query_value => (
SELECT embedding
FROM AI.GENERATE_EMBEDDING(
MODEL `my_project.my_dataset.embedding_model`,
(SELECT "high-performance running shoes" AS content)
)
),
top_k => 5
);
```
SKILL.md›
---
name: bigquery-ai-ml
metadata:
category: AiAndMachineLearning
description: >-
Leverages BigQuery's built-in machine learning and GenAI capabilities
for advanced data analytics. Use when you need to write SQL queries
that perform time-series forecasting, predict values, detect outliers or anomalies, find key drivers,
perform semantic search or vector search, classify text, calculate similarity,
summarize content, translate language, evaluate models, filter by semantic conditions,
or leverage generative AI capabilities in BigQuery. Do not use for general
BigQuery dataset, table, or job management requests.
---
# BigQuery AI & ML
BigQuery integrates with Vertex AI to provide powerful machine learning and
generative AI capabilities directly within SQL queries using built-in functions
like `AI.FORECAST`, `AI.KEY_DRIVERS`, `AI.DETECT_ANOMALIES`, and `AI.GENERATE`.
## Reference Directory
- **Functions Reference**:
- **AI.AGG**: [ai_agg.md](references/ai_agg.md) - Multi-row semantic
aggregation and summarization.
- **AI.CLASSIFY**: [ai_classify.md](references/ai_classify.md) - Classify
text.
- **AI.DETECT_ANOMALIES**:
[ai_detect_anomalies.md](references/ai_detect_anomalies.md) - Detect
anomalies.
- **AI.EVALUATE**: [ai_evaluate.md](references/ai_evaluate.md) - Evaluate
models.
- **AI.FORECAST**: [ai_forecast.md](references/ai_forecast.md) -
Time-series forecasting.
- **AI.GENERATE**: [ai_generate.md](references/ai_generate.md) - Generate
text using LLMs.
- **AI.GENERATE_EMBEDDING**:
[ai_generate_embedding.md](references/ai_generate_embedding.md) -
Generate embeddings.
- **AI.GENERATE_TABLE**:
[ai_generate_table.md](references/ai_generate_table.md) - Table-valued
AI generation.
- **AI.IF**: [ai_if.md](references/ai_if.md) - Evaluate semantic
conditions.
- **AI.KEY_DRIVERS**: [ai_key_drivers.md](references/ai_key_drivers.md) -
Identifies key drivers, this is a TVF.
- **AI.SCORE**: [ai_score.md](references/ai_score.md) - Score data.
- **AI.SEARCH**: [ai_search.md](references/ai_search.md) - Semantic
search.
- **AI.SIMILARITY**: [ai_similarity.md](references/ai_similarity.md) -
Semantic similarity.
- **Remote Models**: [remote_models.md](references/remote_models.md) -
Working with remote models (Vertex AI).
- **CONTRIBUTION_ANALYSIS**:
[ml_contribution_analysis.md](references/ml_contribution_analysis.md)
- Finds contributing factors, key drivers of change. Requires creating
a MODEL entity.
- **VECTOR_SEARCH**: [vector_search.md](references/vector_search.md) -
Vector search best practices.
## Related Skills
- [BigQuery Basics Skill](../bigquery-basics): SKILL.md file for core BigQuery
concepts, resource management, CLI, and client libraries.