bigquery-ai-ml
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, measure the causal effect of an intervention, compute correlations between columns, detect change points or structural breaks, extract trend or seasonality components, or leverage generative AI capabilities in BigQuery. Do not use for general BigQuery dataset, table, or job management requests.
Summary
- Purpose
- It explains how to use BigQuery’s SQL-based machine learning and generative AI capabilities, including Vertex AI integration, for data analysis.
- When to use
- Use it when you need AI/ML-driven analysis in BigQuery SQL, rather than help managing datasets, tables, or jobs.
- Outputs
- It provides function and model references for producing results such as forecasts, anomaly detections, classifications, summaries, embeddings, and semantic or vector-search matches.
Upstream changes (6, latest included 2026-09-21)
d6b9f75 Add correlation, change point, causal effect, trend, and seasonality references to bigquery-ai-ml. The skill description and reference directory now cover causal effects, correlations, change-point detection, and trend and seasonality extraction, and the metadata version changes to 1.1.0. becc4b8 Enforce semantic versioning (MAJOR.MINOR.PATCH) for skills. The skill metadata gains a version field set to 1.0.0. 7322b87 Add new BQ AI/ML references. The skill description expands its stated use cases, and the reference directory is reorganized into a functions list with guides for AI/ML features including classification, evaluation, embeddings, search, similarity, key drivers, and vector search. 1c3a246 Add AI.KEY_DRIVERS to bigquery-ai-ml The skill description and overview add AI.KEY_DRIVERS to the documented capabilities, and the reference directory gains an AI Key Drivers entry. c75b500 Restructure the YAML frontmatter in all SKILL.md files to nest the 'category' field under the 'metadata:' block. The 'category' field is used to organize the skills in the README.md The skill frontmatter adds a metadata block containing the AiAndMachineLearning category. 872e31b Refactor BQ skills The patch creates the BigQuery AI & ML skill file with a description, references for forecasting, anomaly detection, and text generation, and a link to the BigQuery Basics skill. npx skills add "lettucebo/Skills#v2.2.0@bigquery-ai-ml" --full-depth ⚠ Available after v2.2.0 is published
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 - Multi-row semantic aggregation and summarization.
- AI.CAUSAL_EFFECT: ai_causal_effect.md - Quantifies the impact of an intervention on a time series.
- AI.CLASSIFY: ai_classify.md - Classify text.
- AI.DETECT_ANOMALIES: ai_detect_anomalies.md - Detect anomalies.
- AI.EVALUATE: ai_evaluate.md - Evaluate models.
- AI.FORECAST: ai_forecast.md - Time-series forecasting.
- AI.GENERATE: ai_generate.md - Generate text using LLMs.
- AI.GENERATE_EMBEDDING: ai_generate_embedding.md - Generate embeddings.
- AI.GENERATE_TABLE: ai_generate_table.md - Table-valued AI generation.
- AI.IF: ai_if.md - Evaluate semantic conditions.
- AI.KEY_DRIVERS: ai_key_drivers.md - Identifies key drivers, this is a TVF.
- AI.SCORE: ai_score.md - Score data.
- AI.SEARCH: ai_search.md - Semantic search.
- AI.SIMILARITY: ai_similarity.md - Semantic similarity.
- Remote Models: remote_models.md - Working with remote models (Vertex AI).
- CONTRIBUTION_ANALYSIS:
ml_contribution_analysis.md
- Finds contributing factors, key drivers of change. Requires creating a MODEL entity.
- ML.CORRELATION: ml_correlation.md - Calculates correlation between columns, optionally sliced by dimensions.
- ML.DETECT_CHANGE_POINTS: ml_detect_change_points.md - Detects structural breaks or sustained shifts in a time series.
- ML.SEASONALITY: ml_seasonality.md - Extracts seasonal components from a time series.
- ML.TREND: ml_trend.md - Extracts the long-term trend component from a time series.
- VECTOR_SEARCH: vector_search.md - Vector search best practices.
Related Skills
- BigQuery Basics Skill: SKILL.md file for core BigQuery concepts, resource management, CLI, and client libraries.