semantic-view-vqr-suggestions

Generate verified query suggestions for Snowflake semantic views from Cortex Analyst and query history.

Updated Jun 9, 2025
One-click install
npx skills add https://github.com/RajaPoseidon/snippets_repo --skill semantic-view-vqr-suggestions-rajaposeidon
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: semantic-view-vqr-suggestions
Source: https://github.com/RajaPoseidon/snippets_repo/tree/main/snowflake/skills/vqr_suggestions
Command: npx skills add https://github.com/RajaPoseidon/snippets_repo --skill semantic-view-vqr-suggestions-rajaposeidon

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Writing verified queries (VQRs) manually for a Snowflake semantic view is slow and guesswork-driven. This Skill mines real Cortex Analyst request history and Snowflake query history to automatically suggest VQRs grounded in actual usage patterns. ## Core Features & Use Cases - Dual-Mode Mining: Runs both ca_requests_based and query_history_based suggestion modes in parallel and merges the results automatically. - Speed Control: Offers a fast mode using Snowscope and a slow mode that also scans information_schema when fast mode returns too few results. - Structured Output: Saves suggestions as JSON with question, SQL, source mode, and occurrence count for each candidate. - Use Case: After creating a new semantic view, ask for VQR suggestions to bootstrap verified queries from what users are actually asking, then validate the SQL and add them to the view. ## Quick Start Suggest verified queries for my semantic view ANALYTICS.PUBLIC.SALES_VIEW based on recent usage history.

Frequently Asked Questions about semantic-view-vqr-suggestions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate verified query suggestions for a Snowflake semantic view?▼

Run the get_vqr_suggestions.py script with the fully qualified semantic view name (DB.SCHEMA.VIEW). It mines Cortex Analyst request history and Snowflake query history in parallel and outputs suggested questions and SQL as JSON.

What are verified queries in Snowflake Cortex Analyst?▼

Verified queries (VQRs) are curated question-SQL pairs that teach Cortex Analyst how to answer specific questions correctly for a semantic view. They improve response accuracy by providing validated examples grounded in real usage.

What is the difference between fast and slow mode for VQR suggestions?▼

Fast mode uses only Snowscope as the query history source and is the default. Slow mode additionally scans information_schema, which is significantly slower but useful when fast mode returns insufficient suggestions.

Why did VQR suggestion generation return no results?▼

Empty results usually mean the semantic view is new with no query history or has no Cortex Analyst traffic. Try again later, switch to slow mode, or create verified queries manually from the semantic model YAML.

Can I validate suggested VQR SQL before adding it to a semantic view?▼

Yes. Use the SVA inline validation workflow to compile-check candidate SQL before writing it to the YAML, stripping verified_queries from the model payload. Then add validated suggestions with semantic_view_set.py.