Repository navigation
Conversation
LongTermMemory.index (from app_name) was only logged and never passed to Mem0, so apps that share one Mem0 project leaked memories across indexes for the same user_id. Pass agent_id=self.index on add/search to match how VikingDB/Redis/OpenSearch isolate by index, and align save_memory parameter order with BaseLongTermMemoryBackend.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mem0LTMBackendloggedself.index(fromLongTermMemory.app_name) but never passed it to Mem0add/search. Apps that share one Mem0 project therefore shared memories for the sameuser_id, unlike VikingDB (collection=index), Redis/OpenSearch (index name includesindex), OpenViking (app_name), and TOS ContextBucket (bucket=index).Also align
save_memory(user_id, event_strings, ...)withBaseLongTermMemoryBackend— the previous signature swapped the first two parameters, so a positional call treated the user id as the event list and failed.Fix
agent_id=self.indexon Mem0addandsearch(Mem0 1.x kwargs API that veadk pins viamem0ai>=1.0,<2).save_memory/search_memory.How to reproduce
New tests in
tests/memory/long_term_memory_backends/test_mem0_ltm_backend.pyfail on main and pass with this change (3 passed). Related memory suite: 43 passed.Test plan
pytest tests/memory/long_term_memory_backends/test_mem0_ltm_backend.py— 3 passedpytest tests/test_long_term_memory.py tests/memory/(excluding postgres endpoint) — 43 passed