CertSafari
    Snowflake SnowPro Specialty: Gen AI (GES-C02)· Lessons

    Domain 2 · Lesson 4/15

    Analysing documents, audio and images with Cortex AI

    Perform data analysis given a use case.

    12 min read
    7.6% of exam
    6 sources
    Published 21 Oct 2026
    Docs as of 4 Oct 2026

    What you will be able to do

    • Tell from a use case whether it needs the unstructured path (parse, chunk, search) or the structured path (semantic view and Cortex Analyst)
    • Choose between AI_PARSE_DOCUMENT modes and AI_EXTRACT for a document workload
    • Configure a Cortex Search service's embedding model and explain what hybrid retrieval and semantic reranking contribute
    • Pick AI_SIMILARITY, AI_EMBED, AI_MULTI_EMBED, AI_TRANSCRIBE or image input to AI_COMPLETE and AI_CLASSIFY for a multimodal analysis

    Key concept

    Structured path versus unstructured path — Every Cortex analysis use case starts with one question: is the answer in rows and columns already, or locked inside text, documents, audio or images? Rows and columns go to Cortex Analyst through a semantic view. Everything else is first turned into text or vectors, then searched, extracted or compared.

    1.Reading a use case for its data shape

    The shape of the data in a scenario decides which Cortex feature fits, more than the business goal does. The general rule is taught in Choosing the Cortex feature: AI Functions vs Cortex Search vs Cortex Analyst vs Cortex Agents. Applying it to a scenario comes down to one thing: find the noun that holds the answer. "Quarterly revenue by region" lives in a table. "What does our warranty policy say about water damage" lives in a PDF.

    Structured questions go to Cortex Analyst. It answers questions about structured data in Snowflake by generating SQL against a semantic view. Unstructured questions follow a longer path. You parse the files into text, split that text into chunks, index the chunks with Cortex Search, and let an LLM answer from whatever the search returns. Cortex Search is built for this: its documentation describes it as a RAG engine for chat applications over your text data.

    Signals in a scenario and the path they point to
    Signal in the use casePathFirst Cortex step
    Metrics, KPIs, tables, "how many", "by month"StructuredSemantic view queried by Cortex Analyst
    PDFs, manuals, contracts, free-text transcriptsUnstructuredAI_PARSE_DOCUMENT, then chunking and Cortex Search
    Specific fields wanted from many similar documentsUnstructured to structuredAI_EXTRACT into columns, then ordinary SQL
    Call recordings, photos, scanned imagesMultimodalAI_TRANSCRIBE, or image input to AI functions

    The third row is the one people miss. A stack of invoices looks unstructured, but if the question is "total owed per vendor", the right move is to pull fields out into a table and then aggregate them with SQL. No search index is involved.

    Checkpoint 1 of 7· Match them up

    Match each use case to the first Cortex step its data shape calls for.

    Tap a term, then the definition that fits it.

    Sources12

    2.Parsing whole documents versus extracting fields

    For a document Q&A use case, AI_PARSE_DOCUMENT (OCR vs LAYOUT, page_split) is the first step. It reads files from a stage and preserves reading order along with structural elements such as tables and headers. OCR mode gives fast, high-quality text from scanned or text-heavy files. LAYOUT mode is the default recommendation for complex documents, and it is the one to pick when the downstream step needs structure. LAYOUT output comes back as Markdown, so headings survive as # lines that a splitter can cut on.

    LAYOUT parse of a staged PDF, one Markdown page per entrysql
    SELECT AI_PARSE_DOCUMENT (
        TO_FILE('@docs.doc_stage','research-paper-example.pdf'),
        {'mode': 'LAYOUT' , 'page_split': true}) AS research_paper_example;

    AI_EXTRACT and responseFormat answers a different question. It doesn't return the whole document. It pulls out structured information (entities, lists and tables) that you name. A finance team that wants invoice number, total and due date from thousands of vendor invoices in mixed layouts should use AI_EXTRACT. The output is a table they can filter, join and sum. To analyse line items across a whole document set, add a grouping column such as Invoice Number to the extracted table. That lets you join results from every document into one table and analyse them with plain SQL.

    Checkpoint 2 of 7· Check yourself

    A procurement team has 5,000 supplier contracts in mixed layouts on a stage. They want the supplier name, contract value and renewal date for each contract so they can total contract value per supplier in SQL. Which function should they start with?

    Checkpoint 3 of 7· Exam question

    A team has a stage full of scanned insurance claim PDFs (image-only, no embedded text layer) and needs the full document content converted into text that preserves reading order and section layout for downstream semantic search. Which function and mode should they use?

    Checkpoint 4 of 7· Exam question

    A finance team wants to pull the invoice number, total amount, and due date from thousands of vendor invoices in various formats into a structured table with defined columns. Which function is purpose-built for this?

    Sources34

    3.Chunking, embedding models and reranking in Cortex Search

    Retrieval quality depends on what a chunk carries. LAYOUT Markdown fits well with Text splitting helpers (SPLIT_TEXT_RECURSIVE_CHARACTER, SPLIT_TEXT_MARKDOWN_HEADER). If you split on Markdown headers, each chunk stays inside one section and keeps that section's heading. A chunk that reads "Exclusions > Water damage" can be found by a question about flooding. The same sentence cut loose from its heading may not be. Chunk size is a trade-off. Large chunks blur several topics into one vector. Very small chunks lose the context that made the passage answerable.

    The chunks then become the source of a Cortex Search service. For a given use case you make two choices: which column to search, and which embedding model turns that column into vectors. The embedding model is used in the vector stage of retrieval. Pricing differs between the hosted models, so a large multilingual corpus and a small English FAQ may justify different choices.

    A search service that indexes a text column, exposes a filter attribute and names its embedding modelsql
    CREATE OR REPLACE CORTEX SEARCH SERVICE transcript_search_service
      ON transcript_text
      ATTRIBUTES region
      WAREHOUSE = cortex_search_wh
      TARGET_LAG = '1 day'
      EMBEDDING_MODEL = 'snowflake-arctic-embed-l-v2.0'
      AS (
        SELECT
            transcript_text,
            region,
            agent_id
        FROM support_transcripts
    );

    Every query runs through three stages. Vector search finds semantically similar chunks. Keyword search finds lexically similar ones, which matters for part numbers and error codes that embeddings handle poorly. Semantic reranking then reorders the combined candidates so the most relevant ones come first. Reranking doesn't fetch anything new. It only decides which of the retrieved candidates reach the LLM. You can change scoring with numeric boosts, time decays and component weights, or turn reranking off, but the defaults aim for good quality with little tuning.

    Checkpoint 5 of 7· Fill the gap

    A support team is building a search service over call transcripts. They want a multilingual Arctic embedding model to turn transcript_text into vectors for the vector stage of retrieval. Which parameter in the definition picks that model?

    CREATE OR REPLACE CORTEX SEARCH SERVICE transcript_search_service
      ON transcript_text
      ATTRIBUTES region
      WAREHOUSE = cortex_search_wh
      TARGET_LAG = '1 day'
       ?  = 'snowflake-arctic-embed-l-v2.0'
      AS (
        SELECT
            transcript_text,
            region,
            agent_id
        FROM support_transcripts
    );

    Sources2

    4.Similarity scores, audio and images

    Some questions need a score, not a passage: "which support tickets are near-duplicates of this one?" AI_SIMILARITY returns the embedding similarity of two inputs directly, so you don't have to manage vectors yourself. When you do want stored vectors, AI_EMBED, the VECTOR type and vector similarity functions cover the mechanics. For this use case, the point is that AI_EMBED also accepts images, and AI_MULTI_EMBED builds embeddings from text, images, audio or video. That makes "find product photos like this one" a similarity query too.

    Audio becomes analysable text through AI_TRANSCRIBE. It reads audio and video files from a stage and returns text, timestamps and speaker information, for audio files of up to two hours. The granularity you pick depends on what the analysis needs.

    AI_TRANSCRIBE timestamp granularity and when each fits
    GranularityResultFits
    DefaultTranscription of entire audio file in one pieceSummarising or classifying a whole call
    WordTimestamps for each wordSubtitles, click-a-word-to-jump playback
    SpeakerWho is speaking, with a timestamp at each changeMeetings, interviews, agent-versus-customer analysis

    Images don't need a separate service. AI_COMPLETE takes a text string or an image. AI_CLASSIFY sorts text or images into categories you define, and AI_FILTER returns true or false for an image as well as for text. You pass a staged image with TO_FILE. A damage-photo triage pipeline can therefore classify photos into severity buckets with AI_CLASSIFY and send only the ambiguous ones to AI_COMPLETE for a written description.

    Checkpoint 6 of 7· Check yourself

    Thousands of vehicle-damage photos sit on a claims stage. The adjusters want each photo sorted into one of three severity buckets (minor, moderate, total loss) so they can route claims with SQL. What is the most direct way to do this?

    Checkpoint 7 of 7· Exam question

    Which Snowflake Cortex function computes a semantic relatedness score between two text inputs by comparing their embedding vectors?

    Sources56

    Sources

    (6)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “reliably answering business questions based on your structured data in Snowflake”
      ↩︎ Reading a use case for its data shape
      “reliably answering business questions based on your structured data in Snowflake”
      ↩︎ Key concept
    2. 2.
      “Use Cortex Search as a RAG engine for chat applications with your text data”
      ↩︎ Reading a use case for its data shape
      “Cortex Search allows users to select a hosted embedding model to be leveraged in the vector search stage of retrieval.”
      ↩︎ Chunking, embedding models and reranking in Cortex Search
      “Keyword search for retrieving lexically similar documents.”
      ↩︎ Chunking, embedding models and reranking in Cortex Search
      “You can customize the scoring of search results by applying numeric boosts, time decays, adjusting component weights, or disabling reranking.”
      ↩︎ Chunking, embedding models and reranking in Cortex Search
      “Semantic reranking for reranking the most relevant documents in the result set.”
      ↩︎ Exam trap 2
    3. 3.
      “preserving reading order and structural elements such as tables and headers”
      ↩︎ Parsing whole documents versus extracting fields
      “OCR mode is recommended for fast, high-quality text extraction from scanned or text-heavy documents such as contracts, insurance claims, and manuals.”
      ↩︎ Parsing whole documents versus extracting fields
      “AI_PARSE_DOCUMENT returns the content in Markdown format.”
      ↩︎ Parsing whole documents versus extracting fields
      “It is optimized for extracting structured content such as tables, headers, and layout relationships, and is required for image extraction.”
      ↩︎ Prediction
    4. 4.
      “extract structured information, such as entities, lists, and tables, from text or document files”
      ↩︎ Parsing whole documents versus extracting fields
      “In this way, you can join results from the whole document set in a single table”
      ↩︎ Parsing whole documents versus extracting fields
      “AI_EXTRACT is a Cortex AI Function that lets you extract structured information, such as entities, lists, and tables, from text or document files”
      ↩︎ Checkpoint
      “lets you extract structured information, such as entities, lists, and tables, from text or document files”
      ↩︎ Checkpoint
    5. 5.
      “AI_SIMILARITY: Calculates the embedding similarity between two inputs.”
      ↩︎ Similarity scores, audio and images
      “Creates multimodal embeddings from text, images, audio, or video”
      ↩︎ Similarity scores, audio and images
      “AI_CLASSIFY: Classifies text or images into user-defined categories.”
      ↩︎ Similarity scores, audio and images
      “Extracts text (using OCR mode) or text with layout information (using LAYOUT mode) from documents in an internal or external stage.”
      ↩︎ Exam trap 1

    Continue to part 2 of 2

    Cortex Analyst text-to-SQL and choosing models for performance

    Spotted a mistake, or was something unclear? Tell us.