langflow icon indicating copy to clipboard operation
langflow copied to clipboard

Memory not clearing

Open SavvySupport opened this issue 1 year ago • 2 comments

Bug Description

Memory is not clearing even though I clear it..

Reproduction

  1. Click on Playground
  2. Delete memory
  3. Run "Prompt" component that is connected to "Chat Memory" component
  4. Click on "Prompt Message" to see that chat memory has not been cleared. In fact, it contains memory from other flows.

See reproduction process here https://www.loom.com/share/799406c9b05c4aa7a2a6095e037d2ff1

Expected behavior

Expected to see no chat history in Prompt Message. Especially not from other flows.

Who can help?

No response

Operating System

Mac OS

Langflow Version

1.0.19.post2

Python Version

3.10

Screenshot

https://www.loom.com/share/799406c9b05c4aa7a2a6095e037d2ff1

Flow File

No response

SavvySupport avatar Nov 15 '24 06:11 SavvySupport

The issue you're experiencing with the memory not clearing in Langflow might be related to how session management and memory isolation are implemented. In Langflow, memory is managed using session IDs, which are supposed to ensure that each session is distinct and isolated. The Delete memory function is implemented through the delete_messages function, which deletes messages based on the session ID [1].

If the memory is not clearing as expected, it could be due to the session ID not being correctly managed or updated, leading to memory from other flows being retained. Here are a few things you might want to check or try:

  1. Session ID Management: Ensure that the session ID is correctly set and unique for each flow. If the session ID is not being updated or is shared across flows, it could lead to memory overlap.

  2. Clear Method: Verify that the clear method in the LCBuiltinChatMemory class is being called correctly and that it is executing the delete_messages function with the correct session ID.

  3. Logging and Error Handling: Check the logs for any errors or warnings that might indicate issues with the memory clearing process. Langflow uses logging to capture such events, which can help diagnose the problem [2][3].

If these steps do not resolve the issue, it might require a deeper investigation into how session IDs are being generated and managed in your specific setup.

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Nov 15 '24 06:11 dosubot[bot]

@SavvySupport Did you try using version v1.1.0?

carlosrcoelho avatar Nov 18 '24 13:11 carlosrcoelho

Thank you for your contribution! This issue will be closed. If you have any questions or encounter another problem, please open a new issue and we will be ready to help you.

carlosrcoelho avatar Nov 26 '24 21:11 carlosrcoelho