Modern organizations face the challenge of managing both structured data (like metrics and KPIs) and unstructured data (such as customer conversations, emails, and meeting transcripts). The ability to analyze and derive insights from both types of data is crucial for understanding customer needs, improving processes, and driving business growth.
In this quickstart, you'll learn how to build an Intelligent Sales Assistant that leverages Snowflake's capabilities for analyzing sales conversations and metrics. Using Cortex Agents and Streamlit, we'll create an interactive and intuitive assistant.
What is Snowflake Cortex?
The platform leverages three powerful Snowflake Cortex capabilities:
Cortex Analyst
- Converts natural language questions into SQL queries
- Understands semantic models defined in YAML files
- Enables querying data without writing SQL manually
- Handles complex analytical questions about sales metrics
- Achieves over 90% accuracy through user-generated semantic models that capture domain knowledge and business context
Cortex Search
- Delivers best-in-class search performance through a hybrid approach combining semantic and keyword search
- Leverages an advanced embedding model (E5) to understand complex semantic relationships
- Enables searching across unstructured data with exceptional accuracy and speed
- Supports real-time indexing and querying of large-scale text data
- Returns contextually relevant results ranked by relevance scores
Cortex Agents
The Cortex Agents is a stateless REST API endpoint that:
- Seamlessly combines Cortex Search's hybrid search capabilities with Cortex Analyst's 90%+ accurate SQL generation
- Streamlines complex workflows by handling:
- Context retrieval through semantic and keyword search
- Natural language to SQL conversion via semantic models
- LLM orchestration and prompt management
- Enhances response quality through:
- In-line citations to source documents
- Built-in answer abstaining for irrelevant questions
- Multi-message conversation context management
- Optimizes application development with:
- Single API call integration
- Streamed responses for real-time interactions
- Reduced latency through efficient orchestration
These capabilities work together to:
- Search through sales conversations for relevant context
- Go from Text to SQL to answer analytical questions
- Combine structured and unstructured data analysis
- Provide natural language interactions with your data
What You'll Learn
- Setting up a sales intelligence database in Snowflake
- Creating and configuring Cortex Search services
- Building a Streamlit interface for sales analytics
- Implementing semantic search for sales conversations
- Creating a question-answering system using LLMs
What You'll Build
A full-stack application that enables users to:
- Search through sales conversations using semantic similarity
- Analyze sales metrics and patterns
- Ask questions about sales data and get AI-powered responses
What You'll Need
Before you begin, make sure you have the following:
- Snowflake Account: Access to Snowflake with sufficient privileges to create databases, schemas, tables, and upload files. You will also need to set up an RSA public key for the user in (Snowflake)[https://app.snowflake.com].
- Cortex Agents Access: You will need access to Snowflake Cortex service, Cortex Agents, Cortex Search, and Cortex Analyst features.