bigquery-ai-ml

A guide for using BigQuery's built-in AI and machine-learning functions through standard SQL. BigQuery is Google's cloud service for storing and querying large datasets.

In plain words
What is it for?
Forecasting time series, classifying unstructured text, and detecting unusual patterns in time-series data.
Why use it?
It keeps AI and forecasting work in SQL and directs the agent to the exact reference instructions needed for each supported function.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/google/adk-python/bigquery-ai-ml
Any agent
npx skills add google/adk-python --skill bigquery-ai-ml
Clone the repo
git clone --depth 1 https://github.com/google/adk-python

Made for: Claude Code, Codex.

Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 572 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00031 $0.00572
Opus 5 $0.00015 $0.00286
Sonnet 5 $0.00006 $0.00114
Haiku 4.5 $0.00003 $0.00057

Measured 2d ago against content hash bf873812bc11, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

bigquery-ai-ml scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

src/google/adk/tools/bigquery/skills/bigquery-ai-ml/SKILL.md · 48 lines

How it starts

The opening of the file, as written. The whole thing — 48 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Skill: bigquery-ai-ml

This skill defines the usage and rules for BigQuery AI/ML functions, preferring SQL-based Skills over dedicated BigQuery tools.

1. Skill vs Tool Preference (BigQuery AI/ML)

Agents should prefer using the Skill (SQL via execute_sql()) over dedicated BigQuery tools for functionalities like Forecasting and Anomaly Detection.

Use execute_sql() with the standard BigQuery AI.* functions for these tasks instead of the corresponding high-level tools.

2. Mandatory Reference Routing

This skill file does not contain the syntax for these functions. You MUST read the associated reference file before generating SQL.

CRITICAL: DO NOT GUESS filenames. You MUST only use the exact paths provided below.

Function Description Required Reference File to Retrieve
AI.FORECAST Time-series forecasting via the pre-trained TimesFM model references/bigquery_ai_forecast.md
AI.CLASSIFY Categorize unstructured data into predefined labels references/bigquery_ai_classify.md
AI.DETECT_ANOMALIES Identify deviations in time-series data via the pre-trained TimesFM model references/bigquery_ai_detect_anomalies.md
AI.GENERATE General-purpose text and content generation references/bigquery_ai_generate.md
AI.GENERATE_BOOL Generate a boolean value (TRUE/FALSE) based on a prompt references/bigquery_ai_generate_bool.md
AI.GENERATE_DOUBLE Generate a floating-point number based on a prompt references/bigquery_ai_generate_double.md
AI.GENERATE_INT Generate an integer value based on a prompt references/bigquery_ai_generate_int.md
AI.IF Evaluate a natural-language boolean condition references/bigquery_ai_if.md
AI.SCORE Rank items by semantic relevance (use with ORDER BY) references/bigquery_ai_score.md
AI.SIMILARITY Compute cosine similarity between two inputs references/bigquery_ai_similarity.md
AI.SEARCH Semantic search on tables with autonomous embedding generation references/bigquery_ai_search.md

Read the full file on GitHub · 48 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 48 lines · 31 tokens per session scan A bf873812bc11

Subscribe to this mod's changes

bigquery-ai-ml is a skill published in the GitHub repository google/adk-python (21,331 stars, last pushed 2d ago), licensed Apache-2.0. It adds 31 tokens to every session and 572 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.