Skip to content

fix: merge same-key filter operators instead of overwriting (#3952)#1

Open
themavik wants to merge 1 commit intomainfrom
fix/3952-filter-merge-overwrite
Open

fix: merge same-key filter operators instead of overwriting (#3952)#1
themavik wants to merge 1 commit intomainfrom
fix/3952-filter-merge-overwrite

Conversation

@themavik
Copy link
Owner

@themavik themavik commented Feb 9, 2026

Fixes mem0ai#3952

)

Root cause: In _process_metadata_filters(), when a filter like
{'created_at': {'gte': X, 'lte': Y}} was processed, each iteration
of the operator loop replaced result[key] entirely with a new dict,
causing earlier operators (e.g. 'gte') to be lost.

Fix: Initialize result[key] as a dict if not present, then merge
each operator into it instead of replacing. This affects both the
sync Memory class and async AsyncMemory class.
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.

merge filters for same key

1 participant