All skills
google avatar

/bigquery-ai-ml

@d6b9f75
by googlegoogle/skills21k stars
1,698

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.

Use this Skill: https://skilld.dev/gh/google/skills/bigquery-ai-ml

This session only. Nothing lands on disk.

referencesai_generate_embedding.md

≈422 tokens on demand. Your agent reads this file only when SKILL.md points to it.

AI.GENERATE_EMBEDDING

Used to generate high-dimensional numerical vectors (embeddings) for text or visual content. These embeddings can be used for semantic search, clustering, and recommendation systems.

Syntax

SELECT
  *
FROM
  AI.GENERATE_EMBEDDING(
    MODEL `project.dataset.model`,
    { TABLE `project.dataset.table` | (QUERY_STATEMENT) }
    [, STRUCT(
      [TASK_TYPE AS task_type]
      [, OUTPUT_DIMENSIONALITY AS output_dimensionality]) ]
  )

Input Arguments

Argument Requirement Type Description
model Required The model resource (e.g., project.dataset.model).
input_data Required* The source table or SELECT statement containing the data to embed.
task_type Optional String The intended downstream application (e.g., RETRIEVAL_QUERY, RETRIEVAL_DOCUMENT).
output_dimensionality Optional Int64 The number of dimensions to use when generating embeddings.

* input_data is optional for matrix factorization models.

Output Schema

Column Type Description
[Input Columns] (As Input) Every column included in your input data.
embedding ARRAY<FLOAT64> The generated numerical vector.
statistics JSON Metadata about the generation, such as token count.
status STRING Execution status; contains error messages on failure.

Example: Generating Text Embeddings

-- Generate embeddings for a literal string
SELECT *
FROM
  AI.GENERATE_EMBEDDING(
    MODEL `mydataset.text_embedding`,
    (SELECT "Example text to embed" AS content)
);

Source: SKILL.md on GitHub

No alerts9d3 checks · Risk SAFE
  • Gen Agent Trust Hub9d

    This skill provides a comprehensive reference for BigQuery's built-in AI and machine learning functions. It includes a security consideration regarding potential indirect prompt injection when processing untrusted data with generative AI functions. These patterns are standard for the intended data analysis use cases and can be managed through proper prompt design and data validation.

  • Socket9d

    No alerts

  • Snyk9d

    Risk: LOW · No issues

Signed by skilld at d6b9f75. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last week
metadata
{
  "version": "1.1.0",
  "category": "AiAndMachineLearning"
}

README badge

README badge for google/skills/bigquery-ai-ml