AI Agent: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
The AI Agent is an innovative dashboard component designed to display textual responses generated by language models based on user-configured prompts. This component seamlessly integrates with both case-centric and object-centric Snowflake models, to provide comprehensive insights.<br>
The AI Agent is an innovative dashboard component designed to display textual responses generated by language models based on user-configured prompts. This component seamlessly integrates with both case-centric and object-centric Snowflake models, to provide comprehensive insights.
<br>
<br>
Key features of the AI Agent include:
'''Key features of the AI Agent include''':
* '''Versatile Model Support''': The AI Agent is compatible with language models from both OpenAI and Snowflake Cortex, offering flexibility and a wide range of capabilities to meet diverse analytical needs.
* '''Versatile Model Support''': The AI Agent is compatible with language models from both OpenAI and Snowflake Cortex, offering flexibility and a wide range of capabilities to meet diverse analytical needs.
* '''Dynamic Response Generation''': By configuring specific prompts, users can tailor the AI Agent to generate relevant and context-specific textual responses, enhancing decision-making processes.
* '''Dynamic Response Generation''': By configuring specific prompts, users can tailor the AI Agent to generate relevant and context-specific textual responses, enhancing decision-making processes.
* '''Integration with Snowflake''': The AI Agent supports Snowflake's case-centric and object-centric models, allowing users to harness the full potential of their data within the Snowflake ecosystem.
* '''Integration with Snowflake''': The AI Agent supports Snowflake's case-centric and object-centric models, allowing users to harness the full potential of their data within the Snowflake ecosystem.
This component is ideal for users seeking to leverage advanced language models to extract meaningful insights and drive data-driven strategies directly from their dashboards.
This component is ideal for users seeking to leverage advanced language models to extract meaningful insights and drive data-driven strategies directly from their dashboards.
<!--
 
== Take AI Agent into Use ==
== Take AI Agent into Use ==
In QPR Cloud, the AI Agent is disabled by default. To take the AI Agent into use, please send a request to customercare@qpr.com and the AI Agent will be enabled for your environment.
In QPR Cloud, the AI Agent is disabled by default. To take the AI Agent into use, please send a request to customercare@qpr.com and the AI Agent will be enabled for your environment.


To enable the AI Agent for customers using an on-premise system, the system administrator need to configure following:
To enable the AI Agent for customers using an on-premise system, there's the option to use either Snowflake Cortex or OpenAI. See [[Snowflake_Connection_Configuration#Snowflake_Cortex|Snowflake Cortex]] or [[AI_Assistant_for_QPR_ProcessAnalyzer#Take_AI_Assistant_into_Use|OpenAI related settings]] respectively.
# Set up Snowflake Cortex or create an OpenAI account in https://openai.com, and create an OpenAI API key. Note that these are paid services and a credit card is needed for payments.
# In the PA_CONFIGURATION table in QPR ProcessAnalyzer database, define your OpenAI API key in the [[PA_Configuration_database_table#OpenAIAPIKey|OpenAIAPIKey]] field.
# Optionally, define which large language model to use in the [[PA_Configuration_database_table#OpenAIDefaultModelName|OpenAIDefaultModelName]] field.


You can also fine-tune the large language model, so that it better suits to your use. For example, the large language modelcan be fine-tuned with background information regarding the analyzed process and the broader business environment. More information about fine-tuning OpenAI large language models, please contact QPR or check out the OpenAI technical instructions: https://platform.openai.com/docs/guides/fine-tuning.
You can also fine-tune the large language model, so that it better suits to your use. For example, the large language model can be fine-tuned with background information regarding the analyzed process and the broader business environment. For more information about fine-tuning large language models, please contact QPR or check out the [https://docs.snowflake.com/en/user-guide/snowflake-cortex/cortex-finetuning Snowflake Cortex Fine-tuning] or [https://platform.openai.com/docs/guides/fine-tuning OpenAI Fine-tuning] technical instructions.
-->


== Using AI Agent ==
== General Settings ==
=== General Settings ===
* '''System Prompt''': Optional. Enter a system prompt for the language model if desired. This can help guide the model's responses but is not required.
* '''System Prompt''': Optional. Enter a system prompt for the language model if desired. This can help guide the model's responses but is not required.
* '''User Prompt''': Mandatory. Provide a user prompt for the language model. This field must contain valid input.
* '''User Prompt''': Mandatory. Provide a user prompt for the language model. This field must contain valid input.
* '''Input Charts''': Optional. Configure an array of zero-to-many chart configurations to be used as source data for the language model. The AI Agent can function without input charts.
* '''Input Charts''': Optional. Configure an array of zero-to-many chart configurations to be used as source data for the language model. The AI Agent can function without input charts. You can copy chart settings from another chart and and use them here as follows: Open the Chart Settings (editable) of the other chart, select all JSON and copy it to a clipboard. Come back to the AI Agent Input Charts, paste the settings to the textbox, and click Apply. Note that if the input chart's data exceeds 20000 characters, the data is cut at the end of the line where the limit is reached.
* '''LLM Name''': Select a language model from the predefined list of Snowflake Cortex models or enter a custom model name. If the OpenAI API key is configured and no LLM name is specified, the OpenAI language model will be used by default. Default language model is llama3.1-70b.
* '''LLM Name''': Select a language model from the predefined list of Snowflake Cortex models or enter a custom model name. If the OpenAI API key is configured and no LLM name is specified, the OpenAI language model will be used by default. Default language model is llama3.1-70b.
* '''LLM Parameters: Optional. Define optional parameters for the language model using a JSON object. Refer to the [https://docs.snowflake.com/en/sql-reference/functions/complete-snowflake-cortex Snowflake] and [https://platform.openai.com/docs/api-reference/chat/create OpenAI] documentation for supported parameters. Example: { "temperature": 0 }
* '''LLM Parameters''': Optional. Define optional parameters for the language model using a JSON object. Refer to the [https://docs.snowflake.com/en/sql-reference/functions/complete-snowflake-cortex Snowflake] and [https://platform.openai.com/docs/api-reference/chat/create OpenAI] documentation for supported parameters. Example: { "temperature": 0 }
* '''Title''': Set a title for the AI Agent component.
* '''Title''': Custom title for the AI Agent can be defined. Note that the AI Agent does not have an automatically created title.
* '''Description''': Provide a description for the AI Agent. Note that this description is not used as a prompt for the language model.
* '''Description''': Provide a description for the AI Agent. Note that this description is not used as a prompt for the language model.


== Layout Settings ==
== Layout Settings ==
Configure layout settings as needed, excluding the color palette.
Following layout settings are available:
* '''Background color''': Background color of the AI Agent area. The color can also contain partial transparency (alpha value) or even be fully transparent. When the A Agent background has transparency, the color of the dashboard background is visible behind the AI Agent.
* '''Border color''': Border color of the AI Agent. Like the background, border color can also contain transparency.
* '''Border width''': Border width of the AI Agent in pixels. When the width is zero, border is not visible.
* '''Border corner roundness''': Border corner roundness in pixels. Zero means sharp corners.


== Filtering Settings ==
== Filtering Settings ==
* '''Follow Dashboard Filters''': Enable this option if you want the input charts to follow the dashboard's filters.
* '''Follow Dashboard Filters''': When checked, the AI Agent is filtered by the filters in the dashboard. When unchecked, the AI Agent is not affected by filters in the dashboard, and thus the AI Agent feedback is based on data in the entire model.
* '''Chart Filter''': Apply filters to each of the input charts if they are set to follow dashboard filters.
* '''Chart Filter''': Apply filters to each of the input charts if they are set to Follow Dashboard Filters.
* '''Find Root Causes''': Enable this setting if you want the AI Agent to identify root causes within the data.
* '''Find Root Causes''': Rules to select cases used by the root causes analyses to find possible root causes for the phenomena pointed by those rules.
* '''Require Root Causes Criteria''': Specify criteria that must be met for root causes to be identified.
* '''Require Root Causes Criteria''': When enabled, the chart will show a user-friendly message if no criteria is selected for the Find Root Causes selection. This setting can be enabled for the AI Agent performing the root causes analysis, i.e., the root causes selection is mandatory for the AI Agent to show relevant results.


== Advanced Settings ==
== Advanced Settings ==
* '''Settings Available in Preview Mode''': Adjust settings that are available when the AI Agent is in preview mode.
* '''Settings Available in Preview Mode''': If there is no need for a user to change the AI Agent settings when viewing the dashboard, this option can hide the settings in the [[QPR_ProcessAnalyzer_Dashboard_Designer#Editing_Dashboards|preview mode]]. This helps to make the dashboard cleaner looking as there is no settings button in the AI Agent. Then changing the AI Agent settings can only be done in the ''edit mode''.
* '''On-Screen Settings''': Configure settings that will be available on-screen during the AI Agent's operation.
* '''On-Screen Settings''': See [[Chart_On-screen_Settings|On-screen settings]].
* '''Linked Settings''': Manage linked settings, noting that linked settings are disabled by default.
* '''Linked Settings''': See [[Chart_Linked_Settings|Linked settings]].
* '''Linked Settings Disabled''': Can be used to temporarily disable Linked Settings.
* '''Model''': Select a model for the input charts. This can be overridden in each chart's configuration.
* '''Model''': Select a model for the input charts. This can be overridden in each chart's configuration.
* '''Object-Centric Perspective Settings''': Configure these settings if an object-centric model is selected. These settings can also be overridden in each chart's configuration.
* '''Object-Centric Perspective Settings''': Configure these settings if an object-centric model is selected. These settings can also be overridden in each chart's configuration.
* '''Event Type Mapping''': Define event type mappings for the input charts, which can be overridden in each chart's configuration.
* '''Event Type Mapping''': Select the event attribute used as the event type for the input charts. The event type selection affects the process flow and for example variations and flows. When the event type mapping is defined, the input charts work similarly as if the same event type mapping had been selected in the model level. When <model default> is selected, the event type mapping defined for the model is used. Note that filters don't contain the event type mapping information, so they use the mapping that has been defined for the input charts, and thus charts with different event type mapping don't work together with filtering (usually all cases appear to be filtered out due to the mismatch).
* '''Chart Settings (Editable)''': Edit chart settings as necessary to customize the input charts used by the AI Agent.
* '''Chart Settings (Editable)''': All settings in the AI Agent are stored in a single entity that are shown here. The settings can also be edited directly. There are validations in place, so invalid settings are not accepted.
By following these steps, you can effectively configure the AI Agent to meet your specific needs and leverage its capabilities for data analysis and insights.
 
== Data Sent to LLM Providers ==
AI Agent is based on the large language models (LLM) offered by Snowflake and OpenAI through their APIs. When using Snowflake LLMs, the data is already in Snowflake. See [[AI_Assistant_for_QPR_ProcessAnalyzer#Data_Sent_to_OpenAI|Data Sent to OpenAI]] for information what is sent to OpenAI when its LLMs are used.
 
[[Category: QPR ProcessAnalyzer]]

Latest revision as of 14:26, 4 February 2025

The AI Agent is an innovative dashboard component designed to display textual responses generated by language models based on user-configured prompts. This component seamlessly integrates with both case-centric and object-centric Snowflake models, to provide comprehensive insights.
Key features of the AI Agent include:

  • Versatile Model Support: The AI Agent is compatible with language models from both OpenAI and Snowflake Cortex, offering flexibility and a wide range of capabilities to meet diverse analytical needs.
  • Dynamic Response Generation: By configuring specific prompts, users can tailor the AI Agent to generate relevant and context-specific textual responses, enhancing decision-making processes.
  • Integration with Snowflake: The AI Agent supports Snowflake's case-centric and object-centric models, allowing users to harness the full potential of their data within the Snowflake ecosystem.

This component is ideal for users seeking to leverage advanced language models to extract meaningful insights and drive data-driven strategies directly from their dashboards.

Take AI Agent into Use

In QPR Cloud, the AI Agent is disabled by default. To take the AI Agent into use, please send a request to customercare@qpr.com and the AI Agent will be enabled for your environment.

To enable the AI Agent for customers using an on-premise system, there's the option to use either Snowflake Cortex or OpenAI. See Snowflake Cortex or OpenAI related settings respectively.

You can also fine-tune the large language model, so that it better suits to your use. For example, the large language model can be fine-tuned with background information regarding the analyzed process and the broader business environment. For more information about fine-tuning large language models, please contact QPR or check out the Snowflake Cortex Fine-tuning or OpenAI Fine-tuning technical instructions.

General Settings

  • System Prompt: Optional. Enter a system prompt for the language model if desired. This can help guide the model's responses but is not required.
  • User Prompt: Mandatory. Provide a user prompt for the language model. This field must contain valid input.
  • Input Charts: Optional. Configure an array of zero-to-many chart configurations to be used as source data for the language model. The AI Agent can function without input charts. You can copy chart settings from another chart and and use them here as follows: Open the Chart Settings (editable) of the other chart, select all JSON and copy it to a clipboard. Come back to the AI Agent Input Charts, paste the settings to the textbox, and click Apply. Note that if the input chart's data exceeds 20000 characters, the data is cut at the end of the line where the limit is reached.
  • LLM Name: Select a language model from the predefined list of Snowflake Cortex models or enter a custom model name. If the OpenAI API key is configured and no LLM name is specified, the OpenAI language model will be used by default. Default language model is llama3.1-70b.
  • LLM Parameters: Optional. Define optional parameters for the language model using a JSON object. Refer to the Snowflake and OpenAI documentation for supported parameters. Example: { "temperature": 0 }
  • Title: Custom title for the AI Agent can be defined. Note that the AI Agent does not have an automatically created title.
  • Description: Provide a description for the AI Agent. Note that this description is not used as a prompt for the language model.

Layout Settings

Following layout settings are available:

  • Background color: Background color of the AI Agent area. The color can also contain partial transparency (alpha value) or even be fully transparent. When the A Agent background has transparency, the color of the dashboard background is visible behind the AI Agent.
  • Border color: Border color of the AI Agent. Like the background, border color can also contain transparency.
  • Border width: Border width of the AI Agent in pixels. When the width is zero, border is not visible.
  • Border corner roundness: Border corner roundness in pixels. Zero means sharp corners.

Filtering Settings

  • Follow Dashboard Filters: When checked, the AI Agent is filtered by the filters in the dashboard. When unchecked, the AI Agent is not affected by filters in the dashboard, and thus the AI Agent feedback is based on data in the entire model.
  • Chart Filter: Apply filters to each of the input charts if they are set to Follow Dashboard Filters.
  • Find Root Causes: Rules to select cases used by the root causes analyses to find possible root causes for the phenomena pointed by those rules.
  • Require Root Causes Criteria: When enabled, the chart will show a user-friendly message if no criteria is selected for the Find Root Causes selection. This setting can be enabled for the AI Agent performing the root causes analysis, i.e., the root causes selection is mandatory for the AI Agent to show relevant results.

Advanced Settings

  • Settings Available in Preview Mode: If there is no need for a user to change the AI Agent settings when viewing the dashboard, this option can hide the settings in the preview mode. This helps to make the dashboard cleaner looking as there is no settings button in the AI Agent. Then changing the AI Agent settings can only be done in the edit mode.
  • On-Screen Settings: See On-screen settings.
  • Linked Settings: See Linked settings.
  • Linked Settings Disabled: Can be used to temporarily disable Linked Settings.
  • Model: Select a model for the input charts. This can be overridden in each chart's configuration.
  • Object-Centric Perspective Settings: Configure these settings if an object-centric model is selected. These settings can also be overridden in each chart's configuration.
  • Event Type Mapping: Select the event attribute used as the event type for the input charts. The event type selection affects the process flow and for example variations and flows. When the event type mapping is defined, the input charts work similarly as if the same event type mapping had been selected in the model level. When <model default> is selected, the event type mapping defined for the model is used. Note that filters don't contain the event type mapping information, so they use the mapping that has been defined for the input charts, and thus charts with different event type mapping don't work together with filtering (usually all cases appear to be filtered out due to the mismatch).
  • Chart Settings (Editable): All settings in the AI Agent are stored in a single entity that are shown here. The settings can also be edited directly. There are validations in place, so invalid settings are not accepted.

Data Sent to LLM Providers

AI Agent is based on the large language models (LLM) offered by Snowflake and OpenAI through their APIs. When using Snowflake LLMs, the data is already in Snowflake. See Data Sent to OpenAI for information what is sent to OpenAI when its LLMs are used.