Cortex Analyst (beta)

Cortex Analyst allows users to query Snowflake data using natural language.

1. Permissions

We recommend creating a dedicated role for Cortex usage. Cortex requires SELECT permissions on the underlying tables to function properly (e.g. for semantic view validation and sample data loading). To avoid mixing access patterns and keep ingestion roles separate from AI ones, use a separate role just for Cortex-related use cases.

-- Create a new role
CREATE ROLE <role_name>;

-- Grant the new role to the Select Star user
GRANT ROLE <role_name> TO USER <select_star_user>;

-- Grant usage on the database and schema where semantic views will be created
GRANT USAGE ON DATABASE <db_name> TO ROLE <role_name>;
GRANT USAGE ON SCHEMA <schema_name> TO ROLE <role_name>;

-- Grant the privilege to create semantic views in that schema
GRANT CREATE SEMANTIC VIEW ON SCHEMA <db_name>.<schema_name> TO ROLE <role_name>;

-- Grant select privileges on the underlying tables/views the semantic view will use
GRANT SELECT ON TABLE MY_DB.MY_SCHEMA.TABLE_A TO ROLE <role_name>;
GRANT SELECT ON TABLE MY_DB.MY_SCHEMA.TABLE_B TO ROLE <role_name>;

2. Enable Cortex Analyst in Select Star

To get Cortex Analyst up and running:

  1. Confirm that you have the Admin role.

  2. Navigate to Settings.

  3. In the sidebar, select your Snowflake data source.

  4. Click the Cortex Analyst tab.

  5. Hit the Enable button.

Enable Cortext Analyst

You'll be prompted to provide:

  • Database Name: This is where your semantic views will be created.

  • Schema Name: This is the schema within that database where the semantic views will live.

  • Role: The role that has the necessary permissions to create semantic views and access the underlying tables.

3. Generate Semantic Views

Once Cortex Analyst is enabled, you can generate semantic views directly from the dashboard list page (for any data source) or the table list page (for Snowflake data sources only).

Show AI assist button
  1. Go to the dashboards page.

  2. Click the AI Assist button.

  3. Select Generate Snowflake Semantic View.

A modal will appear, asking you to provide a Display Name and a Description for your semantic views.

Generate Semantic View

4. Leverage Semantic Views in Your Chatbot

Now that your semantic views are generated, they're automatically available to all users in your organization. They'll provide rich, relevant context for your chatbot, making interactions more informed and insightful.

Cortext Analyst Ask AI

Last updated

Was this helpful?