What Cortex is: Snowflake's native AI/ML layer. Runs LLMs and ML functions directly inside the warehouse — data never leaves Snowflake. Why Pfizer uses it: compliance, data sovereignty, no external API calls with patient/HCP data.
1Cortex Analyst — Natural Language to SQL
User types a question in plain English → Cortex writes SQL → runs it → returns an answer
Example: "Who are the top 10 HCPs for oncology in the Northeast?" → Cortex generates SELECT → returns ranked list.
Testing question: Did it query the RIGHT table? RIGHT column? RIGHT filter? A valid SQL query can return wrong results if it queries
hcp_tier_2024 instead of
hcp_tier_2026. This is the
#1 failure mode.
How to test: Ask the AI → inspect the generated SQL (Cortex shows it) → verify the SQL matches what a data analyst would write.
Wrong answer from correct SQL = data quality. Wrong answer from wrong SQL = query generation failure. They look identical to the user. Different fixes.
2Cortex Search — Vector / Semantic Search
Converts documents and records to embeddings (vectors). Returns semantically similar records even if exact words don't match.
Example: Search "care gaps in cardiovascular patients in Southeast" → returns relevant records without exact keyword match.
How to test: Compare retrieved records against a known-correct SQL query on the same data. If AI retrieves 5 records but SQL returns 12 → retrieval gap = failure. The gap
is the finding.
3Cortex Complete — LLM Inference / Generation
Runs a prompt + context through an LLM (LLaMA, Mistral, or others) inside Snowflake. Summarizes, classifies, or generates text from structured data.
Example: Summarize all care gap notes for a given HCP into a rep briefing.
How to test: Compare LLM summary against the source records directly. Any claim not traceable to a source record = hallucination. Check for fabricated NPI numbers, HCP names, dates — numerics and proper nouns are highest-risk.
4Document AI — Unstructured Extraction
Extracts structured data from PDFs, images, unstructured text.
Example: Extract HCP specialty, address, NPI number from a scanned enrollment form.
How to test: Compare extracted fields against the source document visually, or against an existing reference record. Fabricated or missing NPI = critical failure.
Cortex ML Functions (orientation only): Built-in forecasting, anomaly detection, classification — no model building needed. Example: forecast which care gaps will widen next quarter. Testing angle: are the predictions being used correctly downstream? Are thresholds set appropriately for business decisions?