Skip to content

Mem0 question #4411

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

Open
vijaykammili opened this issue May 9, 2025 · 7 comments
Open

Mem0 question #4411

vijaykammili opened this issue May 9, 2025 · 7 comments

Comments

@vijaykammili
Copy link
Contributor

Hey @whysosaket , @toi500 , @HenryHengZJ - Thanks for adding the mem0 node, it's great! I'm looking to implement user memory search across sessions to recall past interactions in new sessions. Any advice on how to achieve this?

For Ex:

User: X
Session: 11111 (Runid)
User Input: My name is X

User: X
Session: 22222 (Runid)
User Input: I like cars

User: X
Session: 33333 (Runid)
User Input: Tell me about myself
Retrieved Memories: Name is X, Likes cars
Agent: Your name is X and you like cars.

I've tried a few different ways but couldn't seem to get the mem0 node to behave this way? Any suggestions?

@toi500
Copy link
Contributor

toi500 commented May 9, 2025

Isn't that what the mem0 node does by default? As soon as you hardcode the User ID in the node, mem0 will construct a set of memories for that user ID, for that whole flow, independently from where the user query it.

So, you can have Flowise Session IDs 11111, 22222, 33333 all pointing to the same User ID (in Mem0).

Image

Here is an example. I provide my name and say I love cars in 2 different Flowise sessions ID still, in another new session ID, the AI puts both pieces of knowledge together from Mem0.

Image

Image

@vijaykammili
Copy link
Contributor Author

vijaykammili commented May 10, 2025

Thank you @toi500 - Yes that is accurate, if you leave everything default. However, When i try to pass a user id and run id via overrrideconfig, it doesn't behave this way. It forgets the information i provided in the past two sessions.

Here is what gets inserted into mem0 with defaults.

Image

Here it is with overrideconfig values of user id of "vj" and unique run ids for each session

Image

I think the sessionid is being inserted as the user id and user id as agent id when performing an overrride config

Image

@toi500
Copy link
Contributor

toi500 commented May 11, 2025

Could you share what your Flowise Mem0 node looks like? Additional Para included.

@vijaykammili
Copy link
Contributor Author

Sure.

Mem0 node:
Image

Additional Params:

Image Image

Here is the payload.

{
"question": "Hi my name is vj",
"streaming": false,
"chatId": "11111",
"overrideConfig": {
"sessionId": "11111",
"user_id": "vj",
"run_id" : "11111"
}
}

Response: Hello How can i help you?

Image Image

{
"question": "What is my name?",
"streaming": false,
"chatId": "11112",
"overrideConfig": {
"sessionId": "11111",
"user_id": "vj",
"run_id" : "11111"
}
}

Response: Your name is vj.

Image Image Image

2nd session

{
"question": "What is my name?",
"streaming": false,
"chatId": "22222",
"overrideConfig": {
"sessionId": "22222",
"user_id": "vj",
"run_id" : "22222"
}
}

Image Image

@whysosaket
Copy link
Contributor

Hey @vijaykammili, sorry for the late reply! The issue is happening because we used get_all instead of search.

In our setup, user_id is tied to long-term memories, while run_id is used for short-term memories. The get_all method only fetches based on one ID, so you’d need to pass both user_id and run_id to get the full context.

This is handled properly in search, which takes both into account. The good news is that this will be resolved once we roll out the semantic search in Flowise Node — check out PR #4273 for details.

@toi500
Copy link
Contributor

toi500 commented May 12, 2025

I was not aware of this limitation. Thank you @vijaykammili for pointing it out and @whysosaket for the explanation and the PR.

cc: @HenryHengZJ

@vijaykammili
Copy link
Contributor Author

@whysosaket. Thank you so much. That makes sense.

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

No branches or pull requests

3 participants