| name | bigquery-ai-functions |
| description | Use when calling Gemini or other generative AI models directly from BigQuery SQL — text/structured generation, classification/scoring, embeddings and semantic search, zero-training forecasting/anomaly detection, driver analysis, or document/image processing via AI.* and ML.* functions and Object Tables/ObjectRef. Covers all 24 functions in this family plus 12 composed workflows (RAG, content moderation, log triage, semantic search, etc.). |
BigQuery AI Functions
This is BigQuery's generative-AI-in-SQL surface: AI.* (and some legacy ML.*) functions call Gemini and other foundation models directly from a query — no separate serving infrastructure, no model training. It's organized per function rather than per model lifecycle, since each function is a complete, independently-callable capability.
This skill packages a verified, field-tested reference distilled from a project that built and live-tested every function and workflow listed below — specific, evidence-backed gotchas (exact error messages, exact parameter interactions, exact output-schema behavior, confirmed outages) found by actually running this in BigQuery, not general LLM-prompting advice.
Decision tree
- Do you want the model to generate free-form or structured output (summaries, extracted fields, translations)? →
reference/generation-and-structured-output.md
- Do you want a fixed-shape judgment per row (a boolean condition, a numeric score, a category label, or a group-level summary)? →
reference/classification-and-scoring.md
- Do you need to turn content into vectors, compare things for similarity, or search a corpus? →
reference/embeddings-and-search.md
- Do you need to forecast a time series or detect anomalies in one, with no training step? →
reference/forecasting-and-anomalies.md
- Do you need to explain why a metric moved (driver/key-factor analysis)? →