# Automating Report Commentary with Snowflake Cortex AI Functions: From Metrics to Narrative

DevFeed: [Automating Report Commentary with Snowflake Cortex AI Functions: From Metrics to Narrative](<https://devfeed.tech/articles/automating-report-commentary-with-snowflake-cortex-ai-functions-from-metrics-to-narrative-78483.md>)

Original publisher: [Read original article](<https://medium.com/snowflake/automating-report-commentary-with-snowflake-cortex-ai-functions-from-metrics-to-narrative-b91f0ca553be?source=rss----34b6daafc07---4>)

Author: Sharon Li

Published: 2026-09-30T19:01:02Z

Content type: tutorial

Language: en

Sources: [Snowflake Builders](<https://devfeed.tech/sources/snowflake-builders.md>)

Topics: [AI Integration Strategies](<https://devfeed.tech/topics/ai-integration-strategies.md>), [Data pipelines](<https://devfeed.tech/topics/data-pipelines.md>), [Finance](<https://devfeed.tech/topics/finance.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [analyst](<https://devfeed.tech/tags/analyst.md>), [analysts](<https://devfeed.tech/tags/analysts.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [automate](<https://devfeed.tech/tags/automate.md>), [automated](<https://devfeed.tech/tags/automated.md>), [breach](<https://devfeed.tech/tags/breach.md>), [building](<https://devfeed.tech/tags/building.md>), [business](<https://devfeed.tech/tags/business.md>), [commentary](<https://devfeed.tech/tags/commentary.md>), [cortex](<https://devfeed.tech/tags/cortex.md>), [coverage](<https://devfeed.tech/tags/coverage.md>), [daily](<https://devfeed.tech/tags/daily.md>), [data](<https://devfeed.tech/tags/data.md>), [data-engineering](<https://devfeed.tech/tags/data-engineering.md>), [datasets](<https://devfeed.tech/tags/datasets.md>), [functions](<https://devfeed.tech/tags/functions.md>), [metrics](<https://devfeed.tech/tags/metrics.md>), [report](<https://devfeed.tech/tags/report.md>), [snowflake](<https://devfeed.tech/tags/snowflake.md>), [snowflake-cortex](<https://devfeed.tech/tags/snowflake-cortex.md>), [software-engineering](<https://devfeed.tech/tags/software-engineering.md>)

## AI overview

The excerpt describes generating first-draft report commentary from structured metrics with Snowflake Cortex AI. A SQL SELECT calls AI_COMPLETE once per row, combining task instructions, a business data dictionary, and row values; the draft is intended for human review. Its example prompt prohibits inventing causes, figures, or remedial actions and requires preserving qualifiers and using natural language. To avoid repeat token costs, a stored procedure fingerprints assembled prompts with SHA2 and uses MERGE to insert new results, update changed ones, and skip unchanged rows. The described approach runs within Snowflake without model-serving infrastructure or external LLM API integration; a SQL worksheet or notebook is presented as enough to try it. The excerpt does not establish performance or production results.

## Source excerpt

Introduction Companies building reports with metrics extracted from datasets on Snowflake is common practice. Those reports don't just get filed away. Analysts review the numbers and write commentary: what changed, what breached a threshold, what the trend looks like, and what it means for the business. In this post, I'll walk through how to use Snowflake Cortex AI functions to automate narrative commentary over structured report data. You'll learn how easy it is to set up an automated commentary pipeline with Cortex AI functions and what factors drive the architecture decisions. The source report The pattern is universal: a source table holds metrics, and a human writes prose summarizing each row for stakeholders. Take financial institutions as an example. In a liquidity and risk management workflow, reports land daily with dozens of metrics -- current values, limit thresholds at multiple severity levels, utilization percentages, and trend data across daily, weekly, and monthly windows. The report is already prepared. The breach levels are already calculated. But an analyst still has to sit down, read each row, and write a paragraph covering the position, the breach status, the trend direction, and any escalation required. The commentary itself is formulaic: "The Liquidity Coverage Ratio stands at 70.54%, a formal breach of the Level 3 threshold of 75.00%, exceeding the limit by 4.46 percentage points. The trend across daily, weekly, and monthly series is consistently downward, with no recovery evident in the current reporting period." An analyst isn't doing creative writing here. They're translating structured data into narrative form, row after row after row. This is exactly the kind of task where an LLM adds value -- not by replacing judgment, but by producing a first draft that an analyst reviews and approves in minutes instead of writing from scratch in hours. Manual workflow vs. automated commentary with Cortex AIThe source report: 40+ metrics per close-of-busi