GitHub stars
53

Install

/plugin install bigquery-data-analytics@bigquery-data-analytics-marketplace

Run it inside Claude Code after adding the marketplace with /plugin marketplace add gemini-cli-extensions/bigquery-data-analytics.

Contents

Discovered from source

Skills 2

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.

Function Selection & Reference Directory

FunctionReferenceSQL ShapeRequires CREATE MODEL or CREATE VECTOR INDEX?When to Use & Disambiguation
AI.AGGai_agg.mdAggregateNoMulti-row semantic aggregation with GROUP BY; synthesizes 1 summary string across many rows (unlike per-row AI.GENERATE).
AI.CAUSAL_EFFECTai_causal_effect.mdTVFNoQuantifies counterfactual post-intervention impact on a time series after a specific treatment timestamp.
AI.CLASSIFYai_classify.mdScalarNoSemantic classification of text or multimodal unstructured data into predefined category labels.
AI.DETECT_ANOMALIESai_detect_anomalies.mdTVFNoZero-shot TimesFM detector for isolated time-series point anomalies/outliers (use ML.DETECT_CHANGE_POINTS for sustained regime shifts).
AI.EVALUATEai_evaluate.mdTVFNoZero-shot TimesFM time-series forecast evaluation/backtesting against a historical holdout split.
AI.FORECASTai_forecast.mdTVFNoZero-shot TimesFM time-series forecasting without training a custom model.
AI.GENERATEai_generate.mdScalarNoDefault for per-row LLM text or multimodal structured extraction (output_schema); returns STRUCT. Prefer over AI.GENERATE_TABLE.
AI.GENERATE_EMBEDDINGai_generate_embedding.mdTVFYesBatch generates ARRAY<FLOAT64> vector embeddings for text or visual content using a remote embedding model.
AI.GENERATE_TABLEai_generate_table.mdTVFYesTable-valued structured extraction (FROM clause); only use instead of AI.GENERATE when a remote model + TVF is explicitly needed.
AI.IFai_if.mdScalarNoEvaluates boolean semantic conditions (BOOL) on text or multimodal data for WHERE/CASE/JOIN filtering (do not use AI.GENERATE_TABLE).
AI.KEY_DRIVERSai_key_drivers.mdTVFNoDefault one-step attribution of dimensional segments driving metric changes (interest_label_col TRUE vs. FALSE). Prefer over CONTRIBUTION_ANALYSIS.
AI.PREDICTai_predict.mdTVFNoZero-shot TabFM foundation model for tabular classification or regression without training and managing custom models.
AI.SCOREai_score.mdScalarNoAssigns a continuous FLOAT64 semantic score to text or multimodal data for ranking or sorting (ORDER BY).
AI.SEARCHai_search.mdTVFNoSimplified semantic search using a raw string query on tables with autonomous background embeddings (AI.EMBED generated column).
AI.SIMILARITYai_similarity.mdScalarNoComputes an on-the-fly semantic similarity score (FLOAT64) between two text or multimodal inputs without stored embeddings.
Remote Modelsremote_models.mdCREATE MODELYesCreates a Vertex AI REMOTE WITH CONNECTION DEFAULT model entity for functions that require one (AI.GENERATE_TABLE, AI.GENERATE_EMBEDDING, VECTOR_SEARCH).
CONTRIBUTION_ANALYSISml_contribution_analysis.mdCREATE MODELYesModel-based driver analysis (CREATE MODEL ... OPTIONS(MODEL_TYPE='CONTRIBUTION_ANALYSIS') + ML.GET_INSIGHTS). Use AI.KEY_DRIVERS unless a MODEL entity is required.
ML.CORRELATIONml_correlation.mdTVFNoCalculates statistical correlation coefficients between numeric columns, optionally sliced by dimensions.
ML.DESCRIBE_DATAml_describe_data.mdTVFNoGenerates descriptive statistics (e.g., count, mean, median, min, max, stddev, quantiles, nulls, top values) for columns in a table or subquery.
ML.DETECT_CHANGE_POINTSml_detect_change_points.mdTVFNoDetects structural breaks or sustained regime shifts ([begin_timestamp, end_timestamp] intervals) in a time series.
ML.SEASONALITYml_seasonality.mdTVFNoExtracts recurring periodic/seasonal components from a historical time series.
ML.TRENDml_trend.mdTVFNoExtracts the smoothed long-term trend component from a historical time series.
VECTOR_SEARCHvector_search.mdTVFYesSearches pre-computed ARRAY<FLOAT64> embedding columns between a base table and query table (paired with AI.GENERATE_EMBEDDING, unlike AI.SEARCH).

BigQuery Analytic Hints

This skill guides the agent to proactively identify high-value analytical follow-up opportunities and present concise, context-aware next steps.

Core Operational Rules

  1. Analytical Invocations Only: Only suggest next-step AI capabilities when the user is conducting exploratory data analysis, metric investigation, cohort comparison, or text processing. Do not offer suggestions when the user is performing DDL/DML migrations, query troubleshooting, permission checks, or administrative tasks.
  2. Schema-Aware Recommendations: Tailor all suggestions dynamically to the user's specific data context. Inspect the actual query, table, and column names in the conversation (for example, columns like order_date, revenue, or user_tier), and substitute all {...} placeholders with those context-specific names. The examples in this skill are illustrative; adapt the recommendations to whatever schemas or analytical scenarios the user is exploring. Never output raw placeholder tokens (such as {data_col} or {dimension_cols}).
  3. Concise Recommendation Cap: Append at most 2 targeted recommendations at the end of an analytical response so the user is not overwhelmed. Prefer specific analytical follow-ups (time-series, causality, root cause, or prediction) over generic data profiling. Offer ML.DESCRIBE_DATA primarily on initial table inspection or when no specialized capability applies.
  4. Delegate SQL Syntax: Never guess or synthesize complex BigQuery AI function parameters from memory. Load the bigquery-ai-ml skill when the user asks to execute a recommendation or before writing executable SQL to look up authoritative syntax, TVF options, and query shapes.

1. Scenario-to-Function Routing Matrix

Map the user's current data pattern or observation to appropriate BigQuery AI/ML function(s):

Current Analysis / Data PatternRecommended FunctionWhat It UnlocksContextual Recommendation Hint
Metrics over time (e.g., daily sales, traffic, latency, active users, spend)AI.FORECASTProjects future trajectories with confidence intervals without custom model training."Want to project {data_col} over the next {horizon} periods? We can run AI.FORECAST on {data_col} over {timestamp_col}."
Spikes, drops, or unexpected values in a time seriesAI.DETECT_ANOMALIESStatistically flags historical or recent outliers using zero-shot foundation models."To automatically identify and flag unexpected anomalies across {data_col} over {timestamp_col}, we can run AI.DETECT_ANOMALIES."
Sustained baseline shift or regime change over timeML.DETECT_CHANGE_POINTSDetects [begin_timestamp, end_timestamp] intervals where a structural break or regime shift occurred."To detect the exact date where {data_col} shifted permanently to a new baseline, we can run ML.DETECT_CHANGE_POINTS on {data_col} over {timestamp_col}."
Noisy or cyclical time series masking directionML.TREND / ML.SEASONALITYDecomposes raw metrics into underlying direction (ML.TREND) and periodic cycles (ML.SEASONALITY)."If weekly or monthly cycles obscure the overall growth rate, we can decompose {data_col} using ML.TREND and ML.SEASONALITY."
Evaluating an event, launch, campaign, or policyAI.CAUSAL_EFFECTQuantifies counterfactual post-intervention impact."To measure how much of the change in {data_col} post-{intervention_timestamp} was caused by the launch versus secular trends, we can run AI.CAUSAL_EFFECT."
Attributing metric variation across dimensionsAI.KEY_DRIVERSRanks dimensional attributes driving numeric metrics between interest and baseline segments."Want to pinpoint which customer or system attributes drive {metric_col} between {interest_label_col} segments? We can run AI.KEY_DRIVERS across {dimension_cols}."
Exploring numeric correlations across featuresML.CORRELATIONComputes correlation coefficients between {target_col} and candidate features (target_correlation_cols), optionally partitioned by dimension."We can run ML.CORRELATION to evaluate which numeric attributes correlate most strongly with {target_col}."
Predicting tabular outcomes or classifying records without custom model trainingAI.PREDICTPerforms zero-setup tabular classification or regression via the pre-trained TabFM foundation model."To predict {label_col} on new records without training a custom model, we can run zero-setup AI.PREDICT using TabFM."
Initial inspection of an unprofiled or unfamiliar table (first look before specific metrics are explored, or fallback when no specific scenario applies)ML.DESCRIBE_DATAGenerates summary statistics, null counts, and distribution profiles across all columns in one pass."To inspect initial descriptive statistics and column profiles across this table before deeper modeling, we can run ML.DESCRIBE_DATA."
Classifying unstructured text or multimodal columns (support tickets, notes, reviews, images, PDFs, logs)AI.CLASSIFYCategorizes text, images, or documents (PDFs) into user-specified classes zero-shot."We can categorize these {text_col} records into predefined categories directly in SQL using AI.CLASSIFY."
Ranking or prioritizing text or multimodal recordsAI.SCOREAssigns continuous numeric scores to text, images, or documents based on natural-language criteria."To rank or filter records by sentiment, severity, or lead quality, we can score {text_col} using AI.SCORE."
Semantic condition filtering across text or multimodal dataAI.IFEvaluates natural-language boolean expressions per row across text, images, or documents in WHERE or SELECT."To filter rows matching nuanced semantic criteria (e.g., churn risk or escalation requests), we can use AI.IF on {text_col} in the WHERE clause."
Aggregating many text rows into group summariesAI.AGGSynthesizes themes across multi-row groups inside GROUP BY."Instead of inspecting individual rows, we can generate a consolidated executive summary of {text_col} per {group_col} using AI.AGG."
Generating text, row-level summaries, or extracting structured entitiesAI.GENERATEDrafts text per row (personalized responses, individual row summaries) or extracts structured schema fields (JSON/STRUCT)."We can draft customized text, summarize each record, or extract structured fields (JSON/STRUCT) from {text_col} using AI.GENERATE."
Semantic search, fuzzy-matching, or deduplication across textAI.SEARCH / AI.SIMILARITYManaged conceptual retrieval (AI.SEARCH) or semantic proximity scoring for entity deduplication (AI.SIMILARITY)."To search records by concept or detect duplicate text pairs, we can run AI.SEARCH or evaluate semantic similarity via AI.SIMILARITY."

2. Capability Chaining Sequences

When the user has executed an initial BigQuery AI/ML query, recommend a chain of subsequent capabilities.

Detailed Chaining Actions

  1. Following AI.FORECAST:
    • Audit outliers: Recommend AI.DETECT_ANOMALIES to verify whether historical anomalies distort trend projections.
    • Backtest model: Recommend AI.EVALUATE across a holdout window to quantify MAE, MAPE, or RMSE metrics.
  2. Following AI.DETECT_ANOMALIES:
    • Root cause anomaly: Recommend AI.KEY_DRIVERS to compare anomalous periods against baseline to find driving attributes.
    • Check regime shifts: Recommend ML.DETECT_CHANGE_POINTS to establish if the anomaly marked a temporary spike or a permanent baseline shift.
  3. Following ML.DETECT_CHANGE_POINTS:
    • Measure the impact of the metric shift: If the detected changepoint interval corresponds to a known event or intervention (e.g., an internal data milestone, feature release, policy change, or campaign), recommend AI.CAUSAL_EFFECT to quantify its impact.
    • Segment attribution: If no specific event is identified, recommend AI.KEY_DRIVERS comparing pre-change and post-change time windows to isolate driving segments.
  4. Following AI.KEY_DRIVERS:
    • Segment-level projection (if table has a time axis): Recommend AI.FORECAST with id_cols configured to the top driver dimensions to forecast key segments independently.
    • Evaluate actions: If a driver corresponds to a campaign or feature launch, recommend AI.CAUSAL_EFFECT.
  5. Following AI.CLASSIFY, AI.SCORE, or AI.IF:
    • Synthesize themes: Recommend AI.AGG grouped by the assigned category to generate per-topic takeaways.

3. Formatting Next Steps in Agent Responses

Append a dedicated section to analytical responses using this structure:

### Recommended Next Steps
- **Project future trends**: Run `AI.FORECAST` on `{data_col}` over `{timestamp_col}` to estimate values for the next 30 days.
- **Diagnose anomalies**: Run `AI.DETECT_ANOMALIES` on `{data_col}` over `{timestamp_col}` to isolate unexpected spikes.

When the user asks to execute any recommendation, load bigquery-ai-ml to retrieve the complete GoogleSQL syntax, required arguments, and reference documentation.

MCP servers 1

Sponsors

Details

Marketplace
gemini-cli-extensions/bigquery-data-analytics
Category
Community