Snowflake previews source citations in AI_EXTRACT
A single SQL result can pair an extracted value with a page location in a document or the character offsets of a passage in plain text.
Snowflake previewed optional source citations in its Cortex AI_EXTRACT SQL function. Snowflake lists citations as an open preview for all accounts with cross-region inference enabled. The company says reviewers can see an extracted value alongside the document region or text passage it identifies as the source.
Passing citation => TRUE returns the extracted fields in response and their source locations in a separate citations object in the same result. Citations are off by default. Snowflake’s examples select the value from response and use LATERAL FLATTEN to return one row per citation for that field. Setting OUTER => TRUE in FLATTEN keeps the extracted value in the result when the citation array yields no rows.
In the invoice example, the query pairs response.invoice_number with entries in citations.bounding_boxes.invoice_number. Each entry gives a page number starting at 1 and the top-left and bottom-right corners of a box. A document viewer can use those coordinates, expressed as percentages of page width and height from the page’s top-left corner, to highlight the cited region.
For plain text, the query pairs response.product_code with entries in citations.text_spans.product_code. The span-start and span-end offsets count Unicode characters from zero and exclude the end position. To display the cited passage, the query uses SUBSTR on the original text, with span-start plus one as the starting position and span-end minus span-start as the length. Snowflake’s example puts double quotes around the hyphenated keys in SQL paths.
Snowflake says reviewers can use citations to check extracted values against the source. The company cautions that a citation alone cannot establish a value’s accuracy.
Using AI_EXTRACT requires a role granted the SNOWFLAKE.CORTEX_USER database role. Snowflake’s SQL reference lists a 1,000-page limit for file extraction with cross-region inference enabled. Snowflake says requesting citations adds no charge beyond standard AI_EXTRACT billing.
More news

Baltimore County students sue over response to canceled AI gun alert

Google separates Gemini history from AI training controls

OpenAI signs four groups for embedded model-safety assessments
