Historical Message Storage Node
What is a Historical Message Storage Node?
The Historical Message Storage Node is a functional node in Magic Flow workflow used for recording and saving conversation messages. It acts like a memory storage unit that can save specified text information into the conversation history for subsequent queries and usage. These stored messages can be retrieved in subsequent interactions, providing conversation memory capability for AI assistants.
Image Description:
The top area is for message type selection, currently supporting text, image, and file card type messages; the bottom area is for message content input, supporting the use of "@" to add variables for dynamic content storage.
Why Do We Need Historical Message Storage Node?
In intelligent dialogue systems, memory and context management are key to providing a coherent interaction experience. The Historical Message Storage Node helps you:
- Build AI Assistant Memory: Let AI assistants "remember" important information without requiring users to repeat it
- Save Intermediate Results: Store key data and intermediate results from the workflow for subsequent processes to reference
- Maintain Conversation Coherence: Ensure conversation continuity and context awareness by storing contextual information
- Create User Profiles: Record key information provided by users to gradually build user profiles for personalized experiences
Application Scenarios
Scenario 1: User Information Collection and Memory
After users provide personal information (such as name, preferences, etc.) for the first time, the Historical Message Storage Node can be used to record this information. In subsequent conversations, the system can directly use these memories, avoiding repeated inquiries and improving user experience.
Scenario 2: Multi-turn Dialogue Memory Management
In complex multi-turn dialogue scenarios, certain key information needs to be used across multiple conversation rounds. Through the Historical Message Storage Node, important content can be selectively saved, rather than just relying on automatically remembered recent messages.
Scenario 3: Workflow Status Recording
In scenarios like handling work orders and approvals, the Historical Message Storage Node can be used to record the status and results of each step, forming complete processing records for subsequent queries and tracking.
Node Parameter Description
Input Parameters
The main input parameters of the Historical Message Storage Node include:
Parameter Name | Description | Required | Default Value |
---|---|---|---|
Message Type | Currently supports text, image, and file card type messages | Yes | Text |
Message Content | Text information to be stored, supports variable references | Yes | None |
Output Content
The Historical Message Storage Node has no standard output parameters; its main function is to write content into the system's historical message records.
Usage Instructions
Basic Configuration Steps
- Add Node: Drag the Historical Message Storage Node into the workflow editor
- Select Message Type: Choose "Text" from the message type dropdown menu
- Write Message Content: Enter the text to be stored in the message content input box
- Can directly input fixed text, such as "User preferences recorded"
- Can also reference variables using the "@" symbol, such as "User preference: @user_preference"
- Connect Nodes: Connect the Historical Message Storage Node with preceding nodes (such as conditional branches or code execution nodes) and subsequent nodes
Advanced Tips
- Combined Variable Usage: Message content supports multiple variable combinations to build structured memory content
- Use Conditional Filtering: Work with conditional branch nodes to store information only when specific conditions are met
- Format Storage Content: Use well-formatted text templates for easier subsequent retrieval and processing
Important Notes
Storage Quantity Limitations
- Store Moderately: Don't store too much unnecessary information, which may lead to overly lengthy historical records
- Focus on Key Points: Only store key information valuable for subsequent interactions to improve storage efficiency
Content Security
- Sensitive Information Handling: Avoid storing user privacy and sensitive information, such as passwords, detailed contact information, etc.
- Compliant Usage: Ensure stored content complies with data privacy regulations
Content Format
- Clear Structure: Design structured storage formats for easier subsequent retrieval and understanding
- Length Control: Overly long content may be difficult to process in subsequent queries, recommend controlling reasonable length
Common Issues
Cannot Find Stored Content in Subsequent Processes
Solutions:
- Confirm the workflow execution order is correct; storage nodes must execute before query nodes
- Check the time range settings of historical message query nodes to ensure they cover the time point of stored messages
- Increase the maximum number of records setting in historical message query nodes to ensure coverage of stored messages
Stored Variable Content is Incorrect
Solutions:
- Check if variable references are correct, ensure using correct variable names
- Verify if preceding nodes successfully output expected variable values
- Use code execution nodes to print variable content for debugging, confirm correct variable transmission in the workflow
Common Paired Nodes
Node Type | Pairing Description |
---|---|
Historical Message Query Node | Use storage and query together for complete memory management |
Large Model Call Node | Provide stored historical information to large models to enhance context understanding |
Conditional Branch Node | Decide whether to store specific information based on conditions |
Code Execution Node | Process and format content to be stored |