Build RAG and Agent-based AI Apps with Anthropic’s Claude 3.5 Sonnet in Snowflake Cortex AI
Today, we are excited to announce the general availability of Claude 3.5 Sonnet as the first Anthropic foundation model available in Snowflake Cortex AI. Customers can now access the most intelligent model in the Claude model family from Anthropic using familiar SQL, Python and REST API interfaces, within the Snowflake security perimeter. This native integration allows data and engineering teams to efficiently tackle some of the most common challenges, per MIT Technology Review Insights poll 2024, in AI deployment including data governance, privacy and integration.
With Sonnet 3.5 in Cortex AI, enterprises can further unlock the full potential of their data through conversational assistants and large-scale language processing. Claude's advanced language models will further enhance how developers can build agents that can run ad hoc analytics, extract answers from documents and other knowledge bases and execute other multistep workflows. You can build applications within the security perimeter of Snowflake with the models next to your governed data. The ease of use coupled with the trusted environment expedites delivery of enterprise-ready AI.
Snowflake Cortex AI
Snowflake launched Cortex AI, a suite of integrated features and services that include fully managed LLM inference, fine-tuning and RAG for structured and unstructured data, to enable customers to quickly analyze unstructured data alongside their structured data and expedite the building of AI apps. The unified AI and data platform makes it easy for many organizations to go from AI concept to reality within a few days. Organizations of all sizes and industries can now accomplish a range of use cases from text summarization and sentiment analysis to the development of powerful AI chatbots.
Claude 3.5 Sonnet
Claude 3.5 Sonnet is a foundation model from AI safety and research company Anthropic. The model raises the industry bar for intelligence, outperforming competitor models as well as the Claude 3 Opus on a wide range of evaluations including a new state-of-the-art achievement for SWE-bench, a software engineering evaluation. Claude 3.5 Sonnet excels at industry benchmarks for graduate-level reasoning (GPQA), undergraduate-level knowledge (MMLU) and coding proficiency (HumanEval). Also, it has improved performance with grasping nuance, humor and complex instructions. The reasoning capabilities combined with performance make Claude 3.5 Sonnet ideal for complex tasks such as providing context-sensitive customer support and orchestrating multistep workflows.
“As a composable CDP leader, generative AI is key to our ability to easily extract unknown or untapped value of customer data in Snowflake. Gaining access to Anthropic's industry-leading Claude 3.5 models within Snowflake Cortex AI empowers us to more quickly unlock value for our shared clients in a way that is secure and governed. This unified governance over data and AI gives us the ability to move quickly and greatly enhances how we serve our customers with AI.”
Jason Davis
Using Anthropic’s model in Cortex AI
With Snowflake Cortex AI, accessing LLMs is easy. You don’t have to manage integrations; governance is consistent across data and AI. You can access the models in one of the supported regions. Also, you can access from other regions with cross-region inference enabled.
You can access the model quickly on the Cortex Playground accessible via the AI/ML Studio tab to test prompts and evaluate different inference configurations. Also, you can compare models, analyze response variations with different settings and enable Cortex Guard to filter out potentially inappropriate or unsafe responses.
SQL and Python
The model can be integrated into a data pipeline or a Streamlit in Snowflake app to process multiple rows in a table. The COMPLETE function, accessible in both SQL and Python, can be used for this integration. Also you can access Claude models from a Snowflake Notebook or your IDE of choice using OAuth for custom clients.
SELECT SNOWFLAKE.CORTEX.COMPLETE('claude-3-5-sonnet', CONCAT(‘Summarize this customer feedback in bullet points: <feedback>', content, '</feedback>');
Access additional templates and details on how to use the SQL function here or learn about the syntax in Python here.
REST API
To enable services or applications running outside of Snowflake to make low-latency inference calls to Cortex AI, the REST API interface is the way to go. Here is an example of what that looks like:
curl -X POST \
"model": "claude-3-5-sonnet",
"messages": [
{
"content": "Summarize this customer feedback in bullet points: <feedback>”
}
],
"top_p": 0,
"temperature": 0
}' \
https://<account_identifier>.snowflakecomputing.com/api/v2/cortex/inference:complete
Get started: Build a RAG-based document search app
Claude 3.5 Sonnet in Cortex AI makes it easy to build apps alongside your data with other features such as Streamlit (frontend development in Python) and Cortex Search (RAG engine with integrated embedding generation, vector management and hybrid search).
What's next for Anthropic and Snowflake
With the availability of Claude in Cortex AI, Snowflake's agentic AI products, including Snowflake Intelligence (private preview soon) and Cortex Analyst (public preview), are planning to leverage Claude as one of the key LLMs, with more details to come.
With Claude's industry-leading accuracy and expansive context window, enterprises can confidently build mission-critical AI apps that deliver more reliable, accurate responses across their data. We are excited to hear about the applications you build on the AI Data Cloud with Claude Sonnet!
To learn more about generative AI in Snowflake and use cases you can build, check out Gen AI day on Jan. 22.
Note: This article contains forward-looking statements, including about our future product offerings, and are not commitments to deliver any product offerings. Actual results and offerings may differ and are subject to known and unknown risk and uncertainties. See our latest 10-Q for more information.