statmike/bigquery-data-science/bigquery-ai
Claude Code and agent skill by statmike/bigquery-data-science
- community
Checking that the SKILL.md file is still in the repository.
Use when calling Gemini, TimesFM, TabFM, or pre-trained Cloud AI services from BigQuery SQL or BigFrames — generation (AI.GENERATE*, AI.COUNT_TOKENS), managed scoring/classification (AI.IF, AI.SCORE, AI.CLASSIFY, AI.AGG), embeddings and vector/hybrid search (AI.EMBED, VECTOR_SEARCH, AI.SEARCH), forecasting/prediction (AI.FORECAST, AI.PREDICT, AI.KEY_DRIVERS), and Cloud AI service models (ML.PROCESS_DOCUMENT, ML.TRANSLATE, ML.TRANSCRIBE).
Install
npx vskill@latest install statmike/bigquery-data-science/bigquery-aiSKILL.md
BigQuery AI (bigquery-ai)
BigQuery AI brings foundation models (Gemini, TimesFM, TabFM, EmbeddingGemma, Text/Multimodal Embeddings) and pre-trained Google Cloud AI services directly into SQL and Python (bigframes.bigquery.ai) with zero model training.
This skill packages a verified, field-tested 4-Lens reference distilled from live-executing all 29 functions and 14 composed workflows in bigquery-ai/.
Decision Tree (Lens 1 → Lens 2)
- Do you want free-form or structured schema output per row (summaries, multi-field JSON/STRUCT extraction, typed scalars, token counting)? → see `reference/general-purpose-generation.md`
- Do you want a managed, zero-config judgment per row or group (boolean filter
AI.IF, numeric ratingAI.SCORE, fixed-category labelAI.CLASSIFY, or group synthesisAI.AGG)? → see `reference/managed-functions.md` - Do you need to embed text/multimodal content, compute pairwise similarity, or run vector/hybrid RRF search? → see `reference/embeddings-and-search.md`
- Do you need zero-training predictions — forecast a time series (
AI.FORECASTon TimesFM 2.5 / 3.0), detect anomalies (AI.DETECT_ANOMALIES), or predict tabular targets without training (AI.PREDICT+AI.EVALUATEon TabFM)? → see `reference/predictive-ai.md` - Do you need to explain why a summable metric moved (`AI.KEY_DRIVERS`), or estimate the causal impact of an intervention (`AI.CAUSAL_EFFECT`)? → see `reference/augmented-analytics.md` (which also routes
AI.CAUSAL_EFFECTto `../bigquery-ml/reference/workflows-and-pipelines.md`) - Are you extracting structured records from PDFs/images or passing `ObjectRef` media into `AI.*` functions? → see `reference/document-processing.md`
- Do you need a pre-trained Cloud AI service (`REMOTE_SERVICE_TYPE`) with a fixed API schema and per-row status column (
ML.TRANSLATE,ML.UNDERSTAND_TEXT,ML.ANNOTATE_IMAGE,ML.TRANSCRIBE,ML.PROCESS_DOCUMENT)? → see `reference/cloud-ai-service-models.md` - Are you composing multiple capabilities into an end-to-end application (RAG, hybrid catalog search, document intelligence, log triage, content moderation, metric diagnostics)? → see `reference/workflows.md`
If the task is ambiguous between zero-training foundation functions (bigquery-ai), trained models (bigquery-ml), or production orchestration/monitoring (bigquery-mlops), consult `../bigquery-data-science/SKILL.md` first.
Composing With Sister Skills (bigquery-ml, bigquery-mlops, bigquery-data-science)
When Your bigquery-ai Task Also Needs... | Combine With... | Exact Handoff Guide | |
|---|---|---|---|
Feeding AI.EMBED or AI.GENERATE_TABLE features into a supervised classifier/regressor, distilling AI.CLASSIFY teacher labels into a fast student model (BOOSTED_TREE_* / LOGISTIC_REG), custom holiday/hierarchical forecasting (ARIMA_PLUS), > 12-dimension attribution (CONTRIBUTION_ANALYSIS), or causal inference (AI.CAUSAL_EFFECT, DiD, Synthetic Control) | [`bigquery-ml`](../bigquery-ml/SKILL.md) | `../bigquery-data-science/reference/cross-skill-playbooks.md` (Playbooks 1–4) | |
Scheduling recurring AI.EMBED + ALTER VECTOR INDEX or AI.FORECAST pipelines across the 8 orchestrators, monitoring ARRAY<FLOAT64> embedding or output drift (ML.VALIDATE_DATA_DRIFT), deterministically scoring saved AI.PREDICT / AI.CLASSIFY tables (ML.METRICS), or joining features point-in-time (ML.ENTITY_FEATURES_AT_TIME) | [`bigquery-mlops`](../bigquery-mlops/SKILL.md) | `../bigquery-mlops/reference/orchestration-and-pipelines.md` · `../bigquery-mlops/reference/monitoring-drift-and-evaluation.md` · `../bigquery-mlops/reference/feature-store-and-temporal-joins.md` |
Tool Wrapper & Generator Rules (SQL + bigframes.bigquery.ai)
- Dual Surface & Pinned Models: Always pin the explicit
endpointormodelparameter ('gemini-2.5-flash','TimesFM 2.5','TimesFM 3.0','embeddinggemma-300m','text-embedding-005','gemini-embedding-001') fromskills/pinned-models.jsonso silent default upgrades never shift outputs. Pair SQL calls withbigframes.bigquery.ai/bigframes.ml.llmwrappers when generating Python notebooks. - Per-Statement Syntax Lookup (Lens 3): Before emitting
AI.*,VECTOR_SEARCH, orOBJ.*calls, inspect `syntax/INDEX.md` (or runbigquery-data-science lookup <SYMBOL>) to read the exact< 25 KBsyntax card insyntax/*.md. - Direct `ObjectRef` Input: Pass
ObjectRefcolumns (from an Object Table'srefcolumn,OBJ.LIST(...), orOBJ.MAKE_REF(uri, connection)) directly intoAI.GENERATE*,AI.CLASSIFY,AI.SCORE,AI.IF,AI.AGG, andAI.EMBEDwithout wrapping inOBJ.GET_ACCESS_URL.
Reviewer Verification Checklist & Rubric
Before returning any bigquery-ai SQL or Python code, verify against this checklist:
- [ ] No Retired `AI.PARSE_DOCUMENT`: Reject any query using
AI.PARSE_DOCUMENT(offline since 2026-06-01); replace withML.PROCESS_DOCUMENTorAI.GENERATE+output_schema. - [ ] No Non-Existent `HYBRID_SEARCH` TVF: Use
VECTOR_SEARCH(..., options => '{"lexical_search_columns": [...]}')orAI.SEARCH(..., mode => 'HYBRID')and sizetop_k >= R/10for target semantic rankR. - [ ] `output_schema` Field Access: When
output_schemais passed toAI.GENERATEorAI.GENERATE_TABLE, select the schema field names directly (never.result, which disappears whenoutput_schemais specified). - [ ] Subquery Sampling Before `LIMIT`: Materialize or subquery-limit input rows before invoking per-row
AI.*scalar functions soLIMITdoes not evaluate and bill the entire table. - [ ] Per-Row Status Check on Cloud AI TVFs: Queries calling
ML.PROCESS_DOCUMENT,ML.TRANSLATE,ML.UNDERSTAND_TEXT,ML.ANNOTATE_IMAGE, orML.TRANSCRIBEinspect<function>_statusbecause per-row failures do not fail the BigQuery job.
Cross-Cutting Gotchas (Apply Across Functions)
- `AI.PARSE_DOCUMENT` is offline and its documentation has been withdrawn (since 2026-06-01). Always use
ML.PROCESS_DOCUMENT(via aCLOUD_AI_DOCUMENT_V1remote model) orAI.GENERATEoverObjectRef. - `output_schema` replaces the `result` field entirely in
AI.GENERATEandAI.GENERATE_TABLE. - `LIMIT` / `OFFSET` on an outer `SELECT` does not reduce billed LLM calls — filter or
LIMITinside a CTE/subquery before calling scalarAI.*functions. - Pass `ObjectRef` directly to multimodal `AI.*` functions —
OBJ.GET_ACCESS_URLis only needed when generating short-lived signed URLs (<= 6hours; never persist signed URLs). - There is no standalone `HYBRID_SEARCH` function — hybrid RRF retrieval (
distance = 1 - (1/(60 + rank_vector) + 1/(61 + rank_lexical))) is enabled vialexical_search_columnsonVECTOR_SEARCHormode => 'HYBRID'onAI.SEARCHover a10 * top_ksemantic pool. - Pin `TimesFM 2.5` or `TimesFM 3.0` on `AI.FORECAST`, `AI.DETECT_ANOMALIES`, and `AI.EVALUATE`; materialize
AI.PREDICT(TabFM) outputs because TabFM has no version pin and is non-deterministic across runs. - Use `AI.COUNT_TOKENS` as a free pre-flight check before running large paid generative batches.
- Cloud AI service models (`REMOTE_SERVICE_TYPE`) are handles, not trained models:
CREATE MODELdoes not validate IAM permissions (roles/serviceusage.serviceUsageConsumeron the connection's service account is mandatory),ML.EVALUATEis rejected, and errors surface per row in<function>_status.
4-Lens Index
- Lens 2 — Use-Case Decision Guides (`reference/`):
- `reference/general-purpose-generation.md` —
AI.GENERATE,AI.GENERATE_TEXT,AI.GENERATE_TABLE,AI.GENERATE_BOOL,AI.GENERATE_DOUBLE,AI.GENERATE_INT,ML.GENERATE_TEXT,AI.COUNT_TOKENS - `reference/managed-functions.md` —
AI.IF,AI.SCORE,AI.CLASSIFY,AI.AGG - `reference/embeddings-and-search.md` —
AI.EMBED,AI.GENERATE_EMBEDDING,ML.GENERATE_EMBEDDING,AI.SIMILARITY,VECTOR_SEARCH,AI.SEARCH, and hybrid RRF search - `reference/predictive-ai.md` —
AI.FORECAST,AI.DETECT_ANOMALIES,AI.PREDICT,AI.EVALUATE(TimesFM & TabFM) - `reference/augmented-analytics.md` —
AI.KEY_DRIVERSand routing forAI.CAUSAL_EFFECT - `reference/document-processing.md` —
ML.PROCESS_DOCUMENT,AI.PARSE_DOCUMENT(retired), Object Tables,OBJ.LIST,OBJ.MAKE_REF,OBJ.FETCH_METADATA,OBJ.GET_ACCESS_URL - `reference/cloud-ai-service-models.md` —
ML.TRANSLATE,ML.UNDERSTAND_TEXT,ML.ANNOTATE_IMAGE,ML.TRANSCRIBE,ML.PROCESS_DOCUMENT - `reference/workflows.md` — 14 composed end-to-end workflows (RAG, hybrid catalog search, document intelligence, tabular prediction, etc.)
- Lens 3 — Per-Statement Syntax Cards (`syntax/`, < 25 KB each): `syntax/INDEX.md` (44 H2-sliced syntax cards)
- Lens 4 — Worked Walkthroughs (`narrative/`): 43 extracted notebook narratives in
narrative/*.md(e.g., `narrative/ai_forecast.md`, `narrative/ai_generate.md`, `narrative/catalog_search.md`)
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/bigquery-ai/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/statmike/bigquery-data-science/bigquery-ai)