Repository navigation
fix(mem0): preserve nested filter objects in search requests - #75
Merged
yuluo-yx merged 1 commit intoNov 10, 2026
Merged
Conversation
Member
|
lgtm |
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.
Describe what this PR does / why we need it
AND/OR/NOT currently serialize their children to strings before serializing the parent, so
/searchreceives quoted JSON instead of nested filter objects. Build maps/lists recursively and serialize once at the existing public String boundary.Does this pull request fix one issue?
Refs #56. This addresses client encoding; complete deployed-service acceptance remains unverified.
Describe how you did it
Preserve comparison mappings, operand order, values and user/agent/run scope fields. AND/OR contain object lists; NOT contains a singleton object list, following the self-hosted OSS contract checked at Mem0 2.2.1 (
94c3fe9f238f3dbf29c9ce98643bd71eb13077cd).Compatibility change: malformed logical operands or arity now throw
IllegalArgumentExceptioninstead of silently dropping conditions.Filter.Groupremains unsupported and is explicitly rejected; this does not add grouped-text-expression support.Describe how to verify it
From the repository root, with Maven 3.9.7:
The focused tests pass all 30 cases on both JDK 17.0.11 and JDK 21.0.13. The same test sources fail 16 of 30 cases on the unchanged base (
4b542248e81bc08147c2abde114e8baf1877c0f7, JDK 21). The JDK 21 module run passes 57 tests, including those 30; these counts overlap. All passing runs have zero failures, errors or skips. The reactor already setsfailIfNoSpecifiedTests=falsefor prerequisite modules.Coverage includes mixed nesting, comparison/membership operators, operand order, special characters, invalid structures and actual Java HTTP request bodies with user-only, agent-only, run-only and combined scopes. HTTP tests use a loopback stub. Changed-file formatting and selected-reactor Checkstyle pass.
Special notes for reviews
A separate local contract harness exercises unchanged extracted Mem0 2.2.1 search/validation/preprocessing/Qdrant translation methods with Qdrant local mode and Java request-body replays. It does not initialize a complete Memory instance or run the REST service, authentication, embeddings, scoring, reranking or network Qdrant. The deployed Mem0 release is unknown; the repository's
v1.1setting is not a package-version pin.Two upstream preprocessing limitations remain: contradictory same-field equality conditions inside AND collapse to the later value, and an AND containing two OR groups loses the earlier OR list. This client encoding fix resolves neither limitation and does not establish arbitrary nested-filter semantics across backends/releases. Whole-repository build/tests and CI are not claimed.
AI assistance disclosure: implementation, tests, independent local review and this PR text were prepared with AI assistance.