Snowflake ConversationalUI Bridge
Introduction
The Snowflake ConversationalUI Bridge module provides a way to easily implement the Conversational UI for Snowflake Cortex Analyst when using the Snowflake AI Data Connector.
Prerequisites
The Snowflake Conversational UI Bridge Module requires Mendix Studio Pro version 10.24.13 or above.
To use the Snowflake Conversational UI Bridge Module, you must also install and configure the following modules from the Mendix marketplace:
- Snowflake AI Data Connector – This module and its dependencies are a required dependency for Snowflake Conversational UI Bridge Module.
- Conversational UI – This module and its dependencies are a required dependency for Snowflake Conversational UI Bridge Module.
Licensing and Cost
This connector is available as a free download from the Mendix Marketplace, but the services in Snowflake to which is connects may incur a usage cost. For more information, refer to the Snowflake documentation.
Depending on your use case, your deployment environment, and the type of app that you want to build, you may also need a license for your Mendix app. For more information, refer to Licensing Apps.
Installation
Follow the instructions in How to Use Marketplace Content in Studio Pro to import the Snowflake Conversational UI Bridge module into your app.
Authentication
- Authentication with an RSA key pair according to PKCS #8 standard
- Authentication with OAUTH through an OIDC provider or PAT. You must add your OAuth token or PAT and optionally its expiration date to the BearerToken created in the ChatCompletions_CallLLM and ChatCompletions_CallCortexAgent microflows.
Configuration
After you install the Snowflake Conversational UI Bridge Module, you can find it in the App Explorer, in the Marketplace modules section. The connector provides a domain model as well as several action microflows and snippets that you can use.
Functionality
Easily implement chat interfaces for Cortex Analyst and Cortex Agent using Conversational UI with the help of the following features.
Pages
- The SnowflakeConfig_TestingPage page is a quick testing page for the different chat interfaces provided by conversational UI, as well as an example of how you can set up a chat interface for Cortex Analyst and Cortex Agent using ConversationalUI. To use it, add the page to your project navigation and start exploring.
- The CortexAnalystDeployedModel_Overview overview page is used to configure your Contex Analyst implementations by creating
CortexAnalystDeployedModels. The page requires aSnowflakeAIDataConnector.ConnectionDetailsobject. - The CortexAgentDeployedModel_Overview overview page is used to configure your Cortex Agent implementations by creating
CortexAgentDeployedModels. The page requires aSnowflakeAIDataConnector.ConnectionDetailsobject. - The Snippet_ModelConfig snippet for the Cortex Analyst Model configuration page. The page requires a
SnowflakeAIDataConnector.ConnectionDetailsobject. - The FullScreenChat_HistoryAndProviderSelection page is an example of a full screen chat with a History bar and provider selection.
Microflows
- The ChatCompletions_CallLLM action microflow for CortexAnalystDeployedModel, used in CortexAnalystDeployedModel_Create, handles calls to Cortex Analyst and maps GenAICommons requests and responses to Cortex Analyst requests and responses.
- The ChatContext_ChatWithHistory action microflow for ConversationalUI.ProviderConfig, used in SnowflakeConversationalUIBridge.ProviderConfig_GetCreate, handles pre- and post-processing for the creation of Conversational UI messages, references, and other objects.
- The ChatCompletions_CallCortexAgent action microflow for CortexAgentDeployedModel handles calls to the Snowflake Cortex Agent REST API and maps GenAICommons requests and responses to Cortex Agent requests and responses. It manages thread creation and continuity through the
Conversationentity. - The CortexAgent_ChatContext_ChatWithHistory_ActionMicroflow action microflow for
ConversationalUI.ProviderConfig, used inCortexAgent_ProviderConfig_GetCreate, handles pre- and post-processing for the creation of Conversational UI messages, references, and other objects for Cortex Agent interactions.
Example Implementation
The Snowflake showcase app contains an example implementation of the Cortex Analyst Conversational UI.For more information, see Snowflake Cortex Analyst.
Cortex Agent Implementation
The SnowflakeConfig_TestingPage page contains a reference implementation of the Cortex Agent Conversational UI that can be used as a starting point.
To set up your own implementation, perform the following steps:
- Create a new
CortexAgentDeployedModelon the CortexAgentDeployedModel_Overview page by providing the required Agent configuration details. - Wire the created
CortexAgentDeployedModelto the Conversational UI by usingCortexAgent_ProviderConfig_GetCreateto create or retrieve the associatedProviderConfig.
The ProviderConfig is then used by the Conversational UI to drive the chat interface, routing messages through ChatCompletions_CallCortexAgent and maintaining conversation continuity through the Conversation entity.