Snowflake Cortex

Last modified: December 17, 2024

Introduction

Snowflake Cortex AI allows users to quickly analyze data and build generative AI applications using fully managed LLMs, vector search and fully managed text-to-SQL services. It also enables multiple users to use AI models with no-code, SQL and Python interfaces.

Integrating Your Mendix App with Snowflake Cortex

To allow your Mendix app to use Snowflake Cortex GenAI functionalities, install and configure the Snowflake REST SQL connector.

Mendix also offers a Snowflake showcase app, which you can use as an example of how to implement the Cortex functionalities in your own app.

Functionalities Available in the Snowflake Showcase App

The Snowflake showcase app shows an example implementation of the following GenAI functionalities:

In addition to the above, the integration also supports the ANOMALY DETECTION ML functionality.

The showcase app has the following pages:

  • Introduction - Information about Snowflake AI and the necessary prerequisites to use it.
  • Machine Learning - Sample implementation of the ANOMALY DETECTION machine learning functionality.
  • Large Language Models - Information about the available LLM functions, as well as a sample implementation of COMPLETE and TRANSLATE.
  • Cortex Analyst - Sample implementation of Snowflake Cortex Analyst, including a chat feature that can take the SQL answer returned by Cortex Analyst, and convert it to natural language.

Under the hood, the functionalities are implemented by calling them from microflows which you can use as examples to implement the functions in your own app. For more information, refer to the following sections.

Implementing the Analyst Functionality

For more information about configuring the integration between Mendix and Snowflake Cortex Analyst, see Configuring Snowflake Cortex Analyst.

Implementing Other Functionalities

The Snowflake showcase app contains example implementations of the Analyst, ANOMALY DETECTION, COMPLETE and TRANSLATE functionalities. To examine these examples, perform the following steps:

  1. Import the sample app into your Mendix Studio Pro.

    For more information, see How to Use Marketplace Content.

  2. In Studio Pro, in the App Explorer, go to Showcase_AI_RESTQLAPI > Pages.

    This section contains the following pages:

     1. Introduction
     2. ANOMALY DETECTION (Machine Learning)
     3. COMPLETE and TRANSLATE (Large Language Models)
     4. Analyst (Cortex Analyst)
    
  3. To see how a Snowflake function is called, right-click on the corresponding SQLStatement field, and then click Go to data source microflow.

    This opens the microflow that calls the Snowflake function.

  4. To modify the call, edit the Statement_SetUp step.

    For information about the parameters required by each functionality, refer to Snowflake documentation.