comfyui_LLM_party

1625

Available Nodes

load_memo

Load Memo Node Documentation

Overview

The load_memo node is a component of the ComfyUI ecosystem within the ComfyUI LLM Party repo, designed to manage memory or session states for Large Language Models (LLMs). This node reads and updates historic user interactions with the system, allowing workflows to retain context and continuity between sessions.

Functionality

The primary function of the load_memo node is to load a session history from a specified JSON file and update the system prompt if necessary. This enables the LLM to retain previous interactions, providing a more coherent and contextual response based on past data.

Inputs

  • system_prompt (STRING): This input is the prompt or instruction given to the system. It can be a multi-line string.

  • history_path (STRING): This input specifies the path where the session history is stored. By default, it is set to "1.json". The node will look for user interaction history at this path.

Outputs

  • system_prompt (STRING): The updated system prompt after reading the history.

  • user_history (STRING): The JSON string representation of user interaction history loaded from the specified file.

  • history_path (STRING): The path to the history file, confirming where the session data was read from.

Usage in ComfyUI Workflows

In ComfyUI workflows, the load_memo node is used within pipelines that require maintaining the state or context between user interactions. It helps in:

  1. Session Management: It retrieves user interaction history from the last session so that any new interaction can consider past discussions for a coherent conversational experience.

  2. Contextual Responses: By remembering past interactions, the LLM can generate responses that align with the user's ongoing conversation, making dialogs seamless across different sessions.

  3. Dynamic System Prompts: By allowing updates to the system prompt, this node facilitates changes in system instructions based on historical data or new objectives defined by the workflow.

Special Features and Considerations

  • Automatic File Creation: If the specified history file does not exist at the given path, the node will automatically create a new JSON file with the provided system prompt. This ensures there is always a file to read and write historical data.

  • Locale Sensitivity: The node names and features can adapt to the user's system language, supporting both English and Chinese, among others, as defined in the ComfyUI language settings or configuration file.

  • Easy Integration: The node is designed to integrate seamlessly into the ComfyUI workflows, allowing for extensive customization and compatibility with various LLM input and output nodes.

In summary, the load_memo node simplifies the management of memory and context in LLM applications, enhancing their capability to deliver contextual and personalized user experiences in ComfyUI workflows.