Cortex Search & Cortex Analyst
Two managed services answer questions instead of transforming text. Cortex Search retrieves the most relevant passages from unstructured text, the retrieval half of a RAG application. Cortex Analyst answers business questions over structured tables through a semantic view, returning the SQL it generated, which the app then runs on a warehouse under the user's role. Unstructured versus structured is the entire decision.
THE ANSWER IS WRITTEN IN DOCUMENTS (TEXT)
QUESTION"How do we handle VATon partial refunds?"
SERVICECortex Searchsearches indexed text
RESULTRelevant passagesfrom 40,000 policy docs
THE ANSWER IS A NUMBER IN TABLES
QUESTION"What were Q2 refundsby region?"
SERVICECortex Analystwrites SQL from a semantic view
RESULTGenerated SQLthe app runs it
Cortex Search is created against a text column and maintains its own hybrid index (vector similarity plus keyword matching, then semantic reranking), refreshed on a TARGET_LAG you declare, the same freshness contract dynamic tables use. The warehouse named in the service runs each refresh, and change tracking must be on for the source tables. Youness watches it for a governance reason that's easy to miss: searches run with the service owner's rights. Anyone with USAGE on the service (and on its database and schema) can retrieve every passage it indexed, whatever their own privileges or row access policies on POLICY_DOCS. Control access with the source query and with who gets USAGE on the service.
The bill has four meters: the warehouse that builds and refreshes the index (nothing when a refresh finds no changes), tokens to embed new or changed rows, serving compute per GB per month of indexed data even when nobody searches, and storage.
CREATE CORTEX SEARCH SERVICE policy_search ON bodyATTRIBUTES doc_type, countryWAREHOUSE = build_whTARGET_LAG = '1 hour'AS SELECT body, doc_type, country FROM policy_docs;
BUILD TIME (OWNER)
TABLEPOLICY_DOCStext column
reads
WAREHOUSEBUILD_WHruns the source query as the service owner
SEARCH SERVICEPOLICY_SEARCHindex of passages, fresh to TARGET_LAG
index billed per GB per month, even when nobody searches
question
QUESTION TIME (ALICE)
APPAlice’s chat appneeds USAGE on the service
RESULTTop passagesmost relevant text
answer
AI MODELAI_COMPLETEquestion + passages
SECURITYOwner’s rights: USAGE on the service exposes everything it indexedFilter the source query, or build one service per audience
Cortex Analyst works the other way around: no index over text, but a semantic view, a schema object where Thomas declares what "revenue" means, which table holds it, how regions join, and which synonyms business users say. Older projects keep the same definitions in a YAML semantic model file on a stage; Snowflake recommends semantic views for new work. The service turns "Q2 refunds by region" into SQL against exactly those definitions, using only the model's metadata (names, types, descriptions), never table rows. It returns that SQL, and the app runs it on a warehouse under the caller's role, which is what makes it safe to expose to Safia's team: it can't invent a join that isn't in the model, and her privileges and policies still apply. A role needs SNOWFLAKE.CORTEX_USER or the narrower SNOWFLAKE.CORTEX_ANALYST_USER, plus SELECT on the tables. Analyst bills per successful message, plus the warehouse that runs the SQL. Cortex Code (next page) helps people who write SQL; Analyst takes SQL out of the conversation for business users. The audience is the tell. Snowflake now recommends Cortex Agents for new conversational apps; an agent can call Analyst as one of its tools.
ONE QUESTION, START TO FINISH
QUESTIONSafia’s question"Q2 refunds by region?"
asks
SERVICECortex Analystwrites SQLbilled per message
SEMANTIC VIEWREFUNDS_SVtables, joins, metrics, synonyms
SQL
WAREHOUSEWarehouseruns the SQL as Safia’s role
rows
RESULTAnswer + SQLher privileges and policies applied
- Search retrieves from text, Analyst answers from tables. Search pays a warehouse for refreshes, tokens to embed new or changed rows, and serving per GB per month even when nobody searches. Analyst pays per successful message, plus the warehouse that runs its SQL.
- Search is the retrieval layer of RAG; pair it with AI_COMPLETE to build the "chat with our documents" app everyone asks for.
- Analyst's SQL runs under the caller's role, so policies apply. Search runs with its owner's rights, so USAGE on a search service exposes everything it indexed.

