fix(mem0): include agent-attributed memories in read filter (closes #38424)#38444
Closed
alaamohanad169-ship-it wants to merge 1 commit into
Closed
fix(mem0): include agent-attributed memories in read filter (closes #38424)#38444alaamohanad169-ship-it wants to merge 1 commit into
alaamohanad169-ship-it wants to merge 1 commit into
Conversation
The Mem0 provider writes memories with both user_id and agent_id (see _write_filters), but _read_filters only queried by user_id. The Mem0 Platform API matches filters strictly, so agent-attributed memories were invisible to mem0_profile, mem0_search, and prefetch. Fix by using an OR filter that matches both: - older user-only memories (no agent_id) - newer memories saved with both user_id and agent_id Closes NousResearch#38424
Collaborator
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
The Mem0 provider writes memories with both
user_idandagent_id(see_write_filters), but_read_filtersonly queried byuser_id. The Mem0 Platform API matches filters strictly, so agent-attributed memories were invisible tomem0_profile,mem0_search, and prefetch.Fix
Changed
_read_filters()to use anORfilter that matches both:agent_id)user_idandagent_idBefore
After
Verification
Closes #38424
Notes
_read_filters()and the corresponding test assertions changed.