Summary Node Documentation
Purpose
The "summary" logic node in Vantage is designed to analyze a complete dataset and produce a concise, AI-generated summary. Unlike traditional AI enrichment processes, which handle data row-by-row, this node examines all provided data collectively and generates a single summary row. This functionality is beneficial for users who want to quickly gain insights into datasets without manually sifting through extensive data.
Settings
The configuration for the summary node includes several settings that govern its behavior. Below is a detailed breakdown of each setting, including its name, input type, functionality, and any relevant default values:
1. promptTemplate
- Input Type: String
- Functionality: This setting allows users to customize the prompt that guides the AI in generating the summary. It defines the template structure and can include placeholders that will be replaced with actual data from the dataset.
- Default Value:
"Summarize the key trends in this data: {{data}}"(if not explicitly provided).
2. summaryType
- Input Type: Dropdown (choices:
"overview","trends","insights","custom") - Functionality: This determines the type of summary that the AI will generate. The available options include:
- "overview": A high-level summary including total records, key columns, and notable patterns.
- "trends": Focuses on identifying trends over time, including increasing or decreasing patterns.
- "insights": Aims to provide actionable business insights based on the dataset.
- "custom": A user-defined prompt that allows for flexibility in summarizing data as per specific user requirements.
- Default Value:
"overview".
3. maxRows
- Input Type: Numeric
- Functionality: This setting specifies the maximum number of rows from the dataset to include in the context for the AI summarization. Limiting the number of rows is essential for complying with large language model (LLM) token limits. The component automatically caps the number of rows to either this value or a maximum of 500, whichever is smaller.
- Default Value:
200.
How It Works
-
Data Input: The node expects a dataset passed as an input (usually, a JSON object). It unwraps this input to prepare it for analysis.
-
Data Validation: It checks if the input is a valid array or object containing an array. If no valid data is found, it returns a message indicating that no data is available.
-
Configuration Application: The settings defined in the configuration object are applied, including selecting the prompt template based on the
summaryType. -
Data Preparation: The data to be sent to the AI is formatted into a compact structure: the columns are identified, and data is transformed into a CSV-like text format.
-
Prompt Creation: A prompt is constructed by incorporating the data into the chosen template. Placeholders in the template are replaced with actual data values or summarized context.
-
AI Integration: The node retrieves the preferred AI integration for processing the request. It handles failures gracefully, catching any errors during this process.
-
AI Call: A request is sent to the AI, invoking it to generate a summary based on the prepared prompt. The AI is instructed to maintain a formal and structured analysis style.
-
Response Handling: Upon successfully receiving a response from the AI, the node formats this into a returnable structure. If an error occurs during the AI call, it captures and relays the error message instead.
Expected Data
The summary node expects a dataset that is structured as an object, typically containing key-value pairs. Each key represents a column in the dataset, and each value holds its corresponding record. The node can process nested data structures, as long as the relevant data points are extracted correctly.
Use Cases & Examples
Use Cases
-
Business Reporting: A company can utilize the summary node to generate a comprehensive overview of sales data to identify patterns and trends over a specific period, assisting in strategic planning.
-
Trend Analysis: An analytics team can use this logic to extract key trends from user engagement metrics on a digital platform, allowing marketers to adjust their strategies accordingly.
-
Customer Insights: Customer support departments can analyze feedback datasets to provide actionable insights on customer satisfaction, helping to enhance the customer experience.
Example Configuration
Use Case: Summarizing Sales Data for Business Reporting
Configuration Data:
{
"promptTemplate": "Generate a detailed overview of the following sales data: {{data}}",
"summaryType": "overview",
"maxRows": 150
}Scenario Description: A retail company has a dataset containing detailed sales records for various products across different regions. They configure the summary node to generate an overview by specifying a custom prompt template and limiting the input data to 150 rows for efficient processing. This setup allows them to quickly obtain critical insights about sales performance that can be used in quarterly business reports.