bulkMessageAnalysis Documentation
Purpose
The bulkMessageAnalysis component is designed for sending a batch of messages to an AI service for aggregate analysis. This functionality allows users to gain insights from message data, such as sentiment analysis, topic extraction, and trend identification. It provides summaries and detailed breakdowns that are useful for understanding communication patterns over time across various channels.
Settings
The bulkMessageAnalysis component is configured with the following settings, each outlined in detail below:
1. messageColumn
- Input Type: String
- Description: This setting specifies which column of the input data contains the message text that needs to be analyzed. Changing this setting alters the source of the analyzed content. If set to a non-existent column, analysis will be ineffective as the component will process empty data or defaults.
- Default Value:
"body"
2. analysisType
- Input Type: Dropdown (options:
overview,trends,sentiment_distribution,topics,custom) - Description: This setting defines the type of analysis the AI will perform. Selecting
overviewprovides a high-level summary, whiletrendsidentifies key trends,sentiment_distributionbreaks down sentiment scores, andtopicsextracts main themes. Thecustomoption allows for user-defined prompts usingcustomPrompt. The chosen analysis type will dictate the structure and content of the AI's output. - Default Value:
"overview"
3. customPrompt
- Input Type: String
- Description: When the
analysisTypeis set tocustom, this prompt will be sent directly to the AI for analysis. This allows for tailored requests but requires careful design to ensure usefulness. If left empty, the analysis will default to the preset templates depending on theanalysisType. - Default Value:
""(an empty string)
4. maxRows
- Input Type: Numeric
- Description: This setting limits the number of messages sent to the AI for analysis. It helps to manage the volume of data processed and can prevent excessive costs or performance hits from analyzing enormous datasets. Adjusting this value downward means fewer messages are analyzed, potentially sacrificing insight depth, while higher values increase analysis scope but risk overwhelming the integration.
- Default Value:
200
5. includeMetadata
- Input Type: Boolean
- Description: This setting determines whether to include additional metadata associated with each message, such as the channel or category breakdown. If set to
true, the analysis will contain richer context; iffalse, only the message text will be analyzed. This can significantly impact the quality of the AI's insights. - Default Value:
true
How It Works
-
Data Preparation: The component first checks the input data. It attempts to extract message data from a potentially complex structure. If valid messages are not found, it returns an empty analysis result.
-
Data Limitation: The configuration of
maxRowslimits the number of messages sent to the AI, ensuring the payload does not exceed manageable sizes. -
Payload Construction: Based on the
includeMetadatasetting, the component constructs the payload that will be sent to the AI. This payload is formatted according to the chosenmessageColumnand captures all relevant details. -
Prompt Resolution: The prompt for analysis is decided based on the
analysisTypeand potentially modified by thecustomPrompt. The template used is replaced with the message data to create a tailored request for the AI. -
AI Integration: The AI integration is retrieved based on user and client details. If successful, the constructed prompt is sent to the AI backend for processing.
-
Response Handling: The response from the AI is captured, and the resulting summary and other details are structured and returned to the caller.
Data Expectations
The bulkMessageAnalysis component expects the input data to be in an array format, where each element represents an individual message object. Each message should ideally contain the following structure (though it can include other fields as well):
{
"body": "The content of the message...",
"timestamp": "2023-01-01T12:00:00Z",
"channel": "Email",
"category": "Support"
// other metadata fields as needed
}- The presence of at least one valid field that matches the
messageColumnis necessary for analysis.
Use Cases & Examples
Use Cases
-
Customer Support Analysis:
- A customer support team can analyze trends in support tickets to understand most common issues, measure response times, and assess overall sentiment towards service resolutions.
-
Social Media Engagement:
- A marketing team might want to analyze social media messages to identify topics currently trending among customers, sentiment related to recent campaigns, and feedback on products.
-
Internal Communication Insights:
- An HR team can assess internal communication patterns to gauge employee sentiment, highlight common themes in feedback, and identify areas needing improvement.
Detailed Example
Use Case: Customer Support Analysis
To analyze support messages for trends and insights, the following configuration may be employed:
{
"inputs": {
"input1": [
{"body": "I am having issues with my order.", "timestamp": "2023-10-01T10:00:00Z", "channel": "Support"},
{"body": "The product did not meet my expectations.", "timestamp": "2023-10-01T12:00:00Z", "channel": "Support"},
{"body": "How do I return an item?", "timestamp": "2023-10-02T09:15:00Z", "channel": "Support"}
// add more messages as needed
]
},
"config": {
"messageColumn": "body",
"analysisType": "trends",
"customPrompt": "",
"maxRows": 100,
"includeMetadata": true
},
"context": {
"clientId": "client_123",
"userId": "user_456"
}
}In this configuration:
- The
messageColumnis set to"body"to analyze the text of each message. - The
analysisTypeis"trends"to identify overarching trends in support queries. - Metadata is included to enhance the context of the messages being analyzed.
- The
maxRowsis set to100, allowing the analysis of up to 100 messages, prioritizing relevant data without overload.