# Cortex Intelligence Agent

The `CLINICOGENOMICS_AGENT` is a Snowflake Cortex Analyst-powered AI agent that lets you query the data warehouse using natural language. It is backed by 48 semantic views that define the data model, dimensions, measures, and synonyms.

## What it is

Instead of writing SQL, you ask a question in plain English and the agent generates and runs the query against the semantic layer. It is best for quick aggregation questions; for guaranteed reproducibility, use direct SQL.

## How to access

1. Open Snowsight (`app.snowflake.com`).
2. Navigate to **AI & ML → Intelligence** in the left sidebar.
3. Select `CLINICOGENOMICS_AGENT` from `CLINICOGENOMICS.LIMS_PUB`.
4. Type your question in natural language.

> **Required role**
>
> `RWD_ANALYST_PHI_ROLE` or higher — it needs `SELECT` on the semantic views plus AI warehouse access. The agent runs on `RWD_PRODUCTION_AI_WH`.

## Example prompts

- “How many patients are in the Vertex sponsored cohort?”
- “Show me the monthly trend of OH biweekly deliveries in 2025.”
- “What are the top 10 providers by case volume in the APOL1 cohort?”
- “Compare patient counts across all oncology cohorts.”

## Known limitations

- Results may vary between identical prompts (non-deterministic AI).
- Complex multi-join queries may time out or return incomplete results.
- For guaranteed reproducibility, use direct SQL queries instead.
