skills/codex/bigquery-ai/SKILL.md
<!-- AUTO-GENERATED by export-skills.py — DO NOT EDIT --> --- name: bigquery-ai description: BigQuery AI and ML patterns for Gemini-powered analytics. Use when building natural language SQL, ML.GENERATE_TEXT pipelines, Cortex Framework data foundations, or grounding agents in warehouse data. --- > **Platform Note:** This skill was designed for multi-agent execution. In Codex, treat sub-agent instructions as sequential steps to complete thoroughly within a single agent context. # BigQuery AI fo
npx skillsauth add frank-luongt/faos-skills-marketplace skills/codex/bigquery-aiInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Platform Note: This skill was designed for multi-agent execution. In Codex, treat sub-agent instructions as sequential steps to complete thoroughly within a single agent context.
Use BigQuery as the data foundation for AI agents with Gemini-powered analytics, natural language SQL, and Cortex Framework enterprise data models.
-- Summarize customer feedback directly in BigQuery
SELECT
feedback_id,
customer_id,
feedback_text,
ml_generate_text_result['candidates'][0]['content']['parts'][0]['text'] AS summary
FROM
ML.GENERATE_TEXT(
MODEL `my_project.my_dataset.gemini_model`,
(SELECT feedback_id, customer_id, feedback_text,
CONCAT('Summarize this customer feedback in 2 sentences: ', feedback_text) AS prompt
FROM `my_project.my_dataset.customer_feedback`
WHERE DATE(created_at) = CURRENT_DATE()),
STRUCT(256 AS max_output_tokens, 0.2 AS temperature)
);
-- Connect BigQuery to Vertex AI Gemini model
CREATE OR REPLACE MODEL `my_project.my_dataset.gemini_model`
REMOTE WITH CONNECTION `my_project.us.my_connection`
OPTIONS (ENDPOINT = 'gemini-2.0-flash');
-- Create embeddings for knowledge base articles
CREATE OR REPLACE TABLE `my_project.my_dataset.article_embeddings` AS
SELECT
article_id,
title,
content,
ml_generate_embedding_result['predictions'][0]['embeddings']['values'] AS embedding
FROM
ML.GENERATE_EMBEDDING(
MODEL `my_project.my_dataset.embedding_model`,
(SELECT article_id, title, content FROM `my_project.articles`),
STRUCT(TRUE AS flatten_json_output)
);
-- Similarity search
SELECT
base.article_id,
base.title,
distance
FROM
VECTOR_SEARCH(
TABLE `my_project.my_dataset.article_embeddings`,
'embedding',
(SELECT ml_generate_embedding_result['predictions'][0]['embeddings']['values'] AS embedding
FROM ML.GENERATE_EMBEDDING(
MODEL `my_project.my_dataset.embedding_model`,
(SELECT 'How do I reset my password?' AS content)
)),
top_k => 5,
distance_type => 'COSINE'
);
-- Cortex Framework pre-built SAP data model
-- After deploying Cortex Framework, query normalized SAP data:
-- Sales performance from SAP S/4HANA
SELECT
MaterialText_MAKTX AS product,
SoldToParty_KUNAG AS customer,
SUM(NetPrice_NETWR) AS revenue,
COUNT(SalesDocument_VBELN) AS order_count
FROM `cortex_sap.SalesOrders`
WHERE DATE(CreationDate_ERDAT) BETWEEN '2025-01-01' AND '2025-12-31'
GROUP BY 1, 2
ORDER BY revenue DESC
LIMIT 20;
from google.cloud import bigquery
client = bigquery.Client()
def query_warehouse(sql: str) -> list[dict]:
"""Execute a BigQuery query and return results as dicts.
Used as a tool function for AI agents.
"""
query_job = client.query(sql)
results = query_job.result()
return [dict(row) for row in results]
# Agent tool: natural language -> SQL -> results
def answer_data_question(question: str) -> str:
"""Convert natural language to SQL and execute."""
from google import genai
ai_client = genai.Client(vertexai=True, project="my-project", location="us-central1")
schema_context = get_table_schemas() # Your schema loader
response = ai_client.models.generate_content(
model="gemini-2.0-flash",
contents=f"""Given this schema:\n{schema_context}\n\n
Generate a BigQuery SQL query to answer: {question}
Return ONLY the SQL, no explanation.""",
)
sql = response.text.strip().strip("```sql").strip("```")
results = query_warehouse(sql)
return str(results[:20])
development
<!-- AUTO-GENERATED by export-skills.py — DO NOT EDIT --> --- name: grpo-rl-training description: GRPO reinforcement learning training with TRL. Use when applying Group Relative Policy Optimization for reasoning and task-specific model training. --- # GRPO/RL Training with TRL Expert-level guidance for implementing Group Relative Policy Optimization (GRPO) using the Transformer Reinforcement Learning (TRL) library. This skill provides battle-tested patterns, critical insights, and production-r
tools
<!-- AUTO-GENERATED by export-skills.py — DO NOT EDIT --> --- name: graphql-architect description: Master modern GraphQL with federation, performance optimization, --- ## Use this skill when - Working on graphql architect tasks or workflows - Needing guidance, best practices, or checklists for graphql architect ## Do not use this skill when - The task is unrelated to graphql architect - You need a different domain or tool outside this scope ## Instructions - Clarify goals, constraints, and
development
<!-- AUTO-GENERATED by export-skills.py — DO NOT EDIT --> --- name: grafana-dashboards description: Create and manage production Grafana dashboards for real-time visualization of system and application metrics. Use when building monitoring dashboards, visualizing metrics, or creating operational observability interfaces. --- # Grafana Dashboards Create and manage production-ready Grafana dashboards for comprehensive system observability. ## Do not use this skill when - The task is unrelated
development
<!-- AUTO-GENERATED by export-skills.py — DO NOT EDIT --> --- name: gptq description: GPTQ post-training quantization for generative models. Use when quantizing large models to 4-bit with calibration-based weight compression. --- # GPTQ (Generative Pre-trained Transformer Quantization) Post-training quantization method that compresses LLMs to 4-bit with minimal accuracy loss using group-wise quantization. ## When to use GPTQ **Use GPTQ when:** - Need to fit large models (70B+) on limited GPU