Overview
This node uses a MySQL database to store and manage chat history for AI agents, enabling persistent memory across sessions. It is useful for applications where maintaining conversational context is important, such as chatbots or virtual assistants. The node supports storing chat messages in a specified table, retrieving previous interactions for context, and clearing chat history for specific sessions.
Use Case Examples
- A chatbot that remembers previous user interactions by storing chat history in MySQL, allowing it to provide contextually relevant responses.
- An AI assistant that clears chat history for a user session upon request to reset the conversation context.
Properties
| Name | Meaning |
|---|---|
| Table Name | Specifies the name of the MySQL table where chat history is stored. |
| Session ID | The key used to identify and store the chat memory for a particular session. |
| Context Window Length | Defines how many previous interactions to consider for providing context in the conversation. |
| Options | Additional options such as clearing chat history and specifying which session ID's history to clear. |
Output
JSON
success- Indicates whether the operation (e.g., clearing history) was successful.message- Provides a message about the operation performed or status.error- Contains error message if an operation failed.
Dependencies
- MySQL database connection via provided credentials
Troubleshooting
- Ensure MySQL credentials are correctly configured and accessible by the node.
- Verify the specified table name exists in the MySQL database and has the correct schema for storing chat messages.
- If clearing history fails, check that the session ID provided exists and the database user has permission to delete records.
- Common error messages include connection failures to MySQL or SQL errors due to incorrect table or column names.