Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Mem0): Add option to use Flowise Chat ID #4257

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

toi500
Copy link
Contributor

@toi500 toi500 commented Apr 4, 2025

Description:

This PR enhances the Mem0 memory node by adding a new toggle option: "Use Flowise Chat ID".

  • When Enabled: The node will ignore the hardcoded "User ID" input field and use the internal Flowise chatId (session ID) as the user_id for all Mem0 operations (saving context, loading variables, clearing memory).
  • When Disabled (Default): The node behaves as before, using the value provided in the "User ID" input field for Mem0 operations.

Changes:

  • Added a "Use Flowise Chat ID" boolean input toggle to the Mem0 node UI.
  • Updated internal logic (getEffectiveUserId) to select the correct ID (Flowise chatId or the input field value) based on the toggle state.
  • The "User ID" input field is now only strictly required if the "Use Flowise Chat ID" toggle is disabled.

This provides users with more flexibility, allowing them to easily tie Mem0 memory directly to Flowise chat sessions without manual configuration if desired.

image

image

Copy link
Contributor

@HenryHengZJ HenryHengZJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @toi500 , looks good!

@toi500
Copy link
Contributor Author

toi500 commented Apr 7, 2025

I have tested it on prpduction too, and it works as expected. This modification allows us to segregate groups of memories, as per example, an email AI agent that wants to access user-annotated memories per email address or by user name if the customer is logged in, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants