Cortex Code CLI workflow examples¶
This topic provides workflow examples for common tasks to help you get the most out of Cortex Code CLI. It covers data discovery, synthetic data generation, building dashboards, and creating Cortex Agents.
Use cases: Data discovery and querying¶
This section walks through creating a synthetic dataset and performing basic analysis to generate a dashboard.
Connect to a Snowflake account¶
Or connect interactively:
Discover and explore data¶
Search your data catalog, understand lineage, and find relevant tables:
Ensure you have the right role with the correct permissions¶
Diagnose access issues and understand role privileges:
Generate synthetic data¶
Here are some examples of generating synthetic data for different use cases.
Fraud analysis for a fintech company:
Pharma trial data:
Customer churn data:
Perform basic queries against this data¶
Build interactive dashboards¶
Create and deploy Streamlit apps with charts, filters, and interactivity.
Tip
Open an example dashboard you like (or find one online) and copy it to your clipboard. You can paste images directly into Cortex Code (Ctrl+V) as design references.
Once you’ve verified that the dashboard is working and looks good, upload it to Snowflake:
Congratulations! You should now have a working Streamlit dashboard that displays the dataset you created.
Use cases: Building Cortex Agents¶
This section walks through creating a Cortex Agent to answer questions about your data in Snowflake Intelligence. We’ll augment the existing synthetic data with customer call transcripts.
Create a Semantic View for Cortex Analyst¶
Create a semantic view so you can use Cortex Analyst with your data. Use the defaults for all the questions it asks:
Create a Cortex Search service¶
First, generate synthetic data containing customer service calls:
Then create a Cortex Search service that indexes the transcripts:
Create a Cortex Agent¶
Build a Cortex Agent that uses both the Analyst and Search services:
Deploy to Snowflake Intelligence¶
Deploy the agent to Snowflake Intelligence:
Congratulations! You have successfully created and deployed a Snowflake Intelligence agent.
You should now be able to access this agent in Snowflake Intelligence and ask it questions like:
“What are customers complaining about in their calls?”
“Show me high-risk customers with monthly charges over $100”
See also¶
- Cortex Code CLI
Get started with installation and first prompts
- Skills
Specialized skills for semantic models, agents, and documents
- Cortex Analyst
Cortex Analyst documentation