aiConditional Documentation
Overview
The aiConditional is a flow control logic component within the Vantage analytics and data platform that enables routing of data rows into different output branches based on AI classification. It leverages a language model (LLM) to classify rows in batches, making it suitable for processing large datasets efficiently. Each output branch is defined by the user, allowing for custom classification based on data attributes.
Purpose
The purpose of the aiConditional component is to facilitate advanced data processing by harnessing AI for conditional logic. This component is particularly useful for applications such as sentiment analysis, categorization of customer feedback, and any scenario where data classification is required based on user-defined criteria.
Settings
The configuration for the aiConditional component consists of multiple settings that define its operation. Below is an exhaustive explanation of each setting:
1. branches
- Name:
branches - Input Type: Array of Objects
- Description: This setting defines the classification branches. Each branch is represented as an object containing a
labeland optionally adescription. Changing the contents of this array directly affects the output routing; any rows classified as a particular label will be directed to their corresponding output port. - Default Value: An empty array
[].
2. promptTemplate
- Name:
promptTemplate - Input Type: String
- Description: This template is used to structure the prompt sent to the AI model. It can incorporate dynamic data using placeholders. Modifying this template changes how the AI interprets the data it needs to classify. If left empty, a default prompt will be used.
- Default Value: An empty string
''.
3. batchSize
- Name:
batchSize - Input Type: Numeric
- Description: This setting determines the number of rows processed in each batch. Adjusting the batch size can impact performance; a larger size may increase throughput, but it can also lead to memory issues if the dataset is too large. The batch size is capped at 50.
- Default Value:
10.
4. classifyColumn
- Name:
classifyColumn - Input Type: String (optional)
- Description: This setting specifies a particular column for the AI to focus its classification efforts. If defined, the AI will use only the values from this column to determine the output category. Not setting this value defaults classification to use all columns.
- Default Value: An empty string
''.
How it Works
The aiConditional component processes incoming data as follows:
- Data Retrieval: It unwraps the input data, ensuring it is in the expected format, typically an array of objects.
- Branch Setup: It initializes output buckets based on the defined branches, providing a structured way to categorically store processed data.
- AI Integration: It connects to the preferred AI integration to facilitate classification.
- Batch Processing: It classifies incoming data in batches, utilizing the LLM to maintain performance on large datasets.
- Data Routing: After classification, it routes each row of data to the appropriate output bucket based on AI-derived classifications.
- Error Handling: If classification fails, or if data cannot be classified, the component directs affected rows to a default
elsebucket.
Expected Data
The aiConditional component expects the following data type:
- Incoming data is expected in the format of an array of objects, where each object represents a row of data to be classified. Ideally, these objects contain various attributes linked to the classification criteria.
AI Integrations
The aiConditional component is designed to integrate with external AI models through the Vantage platform. It utilizes chat-based completions from an AI service, which allows for natural language processing capabilities. The efficiency of the AI model may vary based on the chosen integration and configuration settings.
Billing Impacts
Using the aiConditional component may incur additional costs based on the volume of data processed and the number of AI requests made. Since the component leverages batching for efficiency, a higher batchSize may impact the billable API requests. Users should monitor usage and optimize configuration to manage costs effectively.
Use Cases & Examples
Use Case 1: Sentiment Analysis of Customer Feedback
Businesses can use aiConditional to classify customer feedback into sentiment categories (e.g., Positive, Negative). This classification helps in understanding customer satisfaction and improving service quality.
Use Case 2: Categorization of Support Tickets
Support teams can automatically route support tickets based on their content (e.g., Billing Issues, Technical Support). This ensures that the right team addresses user inquiries swiftly.
Use Case 3: Classification of Marketing Emails
Marketing departments can classify emails or messages based on intent (e.g., Promotion, Info Request, Complaint). This aids in targeted campaigns and responses.
Example Configuration
Scenario: A customer service department wants to classify support tickets based on their content.
Sample Configuration:
{
"branches": [
{ "label": "Technical Support", "description": "Issues related to software or hardware malfunctions." },
{ "label": "Billing Issues", "description": "Queries related to billing and payment." },
{ "label": "General Inquiry", "description": "General questions from users." }
],
"promptTemplate": "Classify each row according to the branch labels provided.",
"batchSize": 20,
"classifyColumn": "ticket_content"
}In this configuration:
- Three branches for ticket categorization are defined.
- The
promptTemplatehelps instruct the AI clearly on the classification task. - A larger
batchSizeallows more tickets to be processed in each request. - The
classifyColumnis set to analyze theticket_contentfor more focused classification.