Cortex Sense (Private Preview)

Cortex Sense builds a working model of your business from metadata your account already produces, so that Cortex Agents answer questions accurately.

Cortex Sense documentation

Cortex Sense is documented on two pages:

PageWhat it covers
Get started with Cortex Sense (this page)Start here: step-by-step setup for your first context.
Cortex Sense referenceHow Cortex Sense works, what it ingests, access control, costs, and more.

Where to build Cortex Sense

How you start depends on where you run CoCo:

SurfaceHow to startNotes
CoCo CLI (recommended)Type /sense.The best experience and the least likely to be confusing.
CoCo DesktopType /cortex-sense.A UI is coming soon. For now, everything is skill-based.
CoCo in SnowsightComing soon.

Before you begin

  • Your account is enrolled in the private preview. If it isn’t, contact your account team to be nominated.
  • You have ACCOUNTADMIN, or an administrator who can run Step 1 for you.

Step 1: Grant the required database role

Only ACCOUNTADMIN can grant the database role required to build a context.

USE ROLE ACCOUNTADMIN;

GRANT DATABASE ROLE SNOWFLAKE.CORTEX_SENSE_BUILDER TO ROLE <builder_role>;

The role that builds a context owns it. Querying a context needs only USAGE, which you grant in Step 5. See Access control and RBAC.

Step 2: Scope a use case

Open CoCo, then type /settings and point both Inference Connection and SQL Connection at the account where you want to build the context, using the role from Step 1.

Start a new context for one business domain:

  • CoCo CLI: Type /sense, choose + Start a new Cortex Sense object, and follow the prompts.
  • CoCo Desktop: Type /cortex-sense set up Cortex Sense for sales.

CoCo scans your account and proposes a scope:

Domain — sales · proposed from a fresh scan
──────────────────────────────────────────────────
Tables         SALES.CORE.* (~40)
               ORDERS, ORDER_ITEMS, PRODUCTS, CUSTOMERS, …
               SALES.ANALYTICS.* (~17)
Dashboards     2 Streamlit apps
               REVENUE_DASHBOARD · SELLER_PERFORMANCE
Semantic views REVENUE_SV, DELIVERY_SV
Tags           CERTIFICATION_STATUS (2 in scope)
──────────────────────────────────────────────────
type to refine — or: help · deeper · looks good

Refine the scope in plain language, for example “include the MARKETING.LEADS schema” or “exclude anything in staging or test”. CoCo then asks about inputs it can’t detect, such as a dbt path or business documentation. Answer what’s useful and skip the rest; you can add more later.

CoCo also asks which database and schema to create the context in.

Indexing starts only after you confirm the scope. Scope drives both answer quality and indexing cost, so see What Cortex Sense can ingest and Best practices.

Step 3: Build the context

Confirm the scope:

> looks good

The build runs in the background and takes a few hours. While it runs, you can give CoCo facts you already know (for example, “ARR lives in ANALYTICS.MARTS.FACT_ARR”), add inputs, or note questions to test against.

When the build finishes, the context is live for the role that built it, stored as a CORTEX SENSE object in the database and schema you chose, named <database>.<schema>."sales".

Step 4: Check the build

In the CoCo CLI, type /sense to open the Cortex Sense page and pick a domain, or /sense <name> to go straight to one. Tab moves between tabs and ? lists the keys.

The page has five tabs:

TabWhat it shows
OverviewBuild state, eval score, records waiting, and who has access.
ScopeEverything the object reads, grouped by kind. Exclusions sit under the rule they carve into.
InboxCorrections to what Cortex Sense believes about your data. 1–3 filter, A approves, E edits.
AccuracyEval results. 1–3 switch views; lift is accuracy minus the pre-context baseline.
ActivateOptions for using this object in an agent or a CoCo skill. CoCo CLI 1.1.94 and later.

A ready state means that the build finished, not that every source succeeded. Check Overview for per-source progress. For more about serving a context, see Where you can use Cortex Sense.

Step 5: Grant access to other roles

Grant USAGE to each role that should query the context. Keep the quotes around the context name:

GRANT USAGE ON CORTEX SENSE <database>.<schema>."sales" TO ROLE <analyst_role>;

During the private preview, give each role access to only one context. See Access control and RBAC.