Skip to content

sahilbhange/snowflake-intelligence-medicare-analyst

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snowflake Intelligence Medicare POS Analyst

A hands-on Snowflake Intelligence learning repo using Medicare DMEPOS data.

What you get:

  • End-to-end SQL pipeline (ingestion, transform, search, governance).
  • Semantic model + semantic view for Cortex Analyst.
  • Cortex Search across HCPCS, devices (GUDID), providers, and CMS PDFs.
  • Cortex Agent orchestration with validation + observability trust layer.

System Architecture

System Architecture

Quick Run

Core run:

make data
make demo

Optional rerun checks:

make test

make search can take a few minutes while Cortex Search indexing/embeddings initialize. Optional trust layer add-on: run make observability-bootstrap once per environment, then make observability.

Prerequisites

  • Snowflake account with Cortex Search and Snowflake Intelligence enabled.
  • Snowsight access.
  • Snowflake CLI installed (snow --version). Make targets use snow sql.
  • SnowSQL is optional for manual script execution.

One-time CLI Setup

The Makefile defaults to Snowflake CLI connection name sf_int.

snow connection add sf_int
snow connection test -c sf_int

If you prefer another connection name:

make SNOW_OPTS="sql -c <your_connection_name>" demo

Windows Equivalent

Windows can use make if installed (for example via Chocolatey, Scoop, Git Bash, or WSL), but it is not available by default.

This repo includes a PowerShell equivalent runner:

.\Makefile.ps1 help
.\Makefile.ps1 demo
.\Makefile.ps1 deploy-all

Connection override:

.\Makefile.ps1 demo -Connection <your_connection_name>

Quickstart

Optional: run everything with a single command after setting your Snow CLI connection:

# Example: export PRIVATE_KEY_PASSPHRASE="<your passphrase>"
make demo

Make Execution Flow

Make Execution Flow

The Makefile uses sql/ingestion/stage_raw_files.sql for PUT uploads from data/. If your files are stored in a different local path, update PUT paths in sql/ingestion/stage_raw_files.sql.

  1. Create roles, warehouse, database, and schema using sql/setup/setup_user_and_roles.sql.

Update target_user before running.

  1. Download source data:
python data/dmepos_referring_provider_download.py --max-rows 1000000
bash data/data_download.sh
  1. Upload raw files to Snowflake stages:
make stage-raw

make load also runs stage-raw automatically. Run make data first so local files exist.

  1. Build the curated tables and views using sql/transform/build_curated_model.sql.

  2. Create Cortex Search services:

make search now creates all four services, prepares SEARCH.PDF_STAGE, and auto-uploads local files from pdf/cms_manuals/ when present.

Note: search service creation can take a few minutes while indexing initializes. Let the make run continue.

  1. Create instrumentation and seed eval prompts:
  1. Create metadata and quality scaffolding (optional but recommended) using sql/governance/metadata_and_quality.sql.

  2. Create semantic view used by the SQL-defined Cortex Agent:

make semantic-view
  1. (Optional) Create observability trust-layer objects:
# one-time environment bootstrap (admin role)
make observability-bootstrap

# normal runtime flow
make observability
  1. (Optional) Create the Cortex Agent:

make demo and make deploy run without admin bootstrap. If you want observability trust-layer objects, run make observability-bootstrap once per environment and then make observability.

Optional Snowsight UI path (not required for make agent):

Demo prompts

  • "Top 10 states by claim volume"
  • "What is HCPCS code E1390?"
  • "Find oxygen concentrators"
  • "Find endocrinologists in California"

Demo output sample: Demo Question Output

Repository layout

  • sql/ - Setup, ingestion, transform, search, governance, observability, and intelligence SQL.
  • models/ - Semantic model and semantic view artifacts.
  • data/ - Download helpers (raw data is gitignored).
  • docs/ - Documentation and diagrams.

Medium Series

Docs highlights

License

This project is licensed under the MIT License. See LICENSE.

About

Hands-on Snowflake Intelligence demo using Medicare DMEPOS data: SQL pipeline, semantic model/view, Cortex Search, Cortex Analyst, agent orchestration, and trust-layer observability.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors