Add SQL filter compilation for properties JSON#1291
Open
edwinyyyu wants to merge 4 commits intoMemMachine:mainfrom
Open
Add SQL filter compilation for properties JSON#1291edwinyyyu wants to merge 4 commits intoMemMachine:mainfrom
edwinyyyu wants to merge 4 commits intoMemMachine:mainfrom
Conversation
6ccc211 to
7715ed4
Compare
Contributor
Author
|
Need to support system-defined metadata too. Will combine with existing compile_sql_filter. |
7715ed4 to
a9e83e5
Compare
This was referenced Apr 2, 2026
Contributor
Author
|
Discovered client tests were wrong all along -- filters silently failed before. Need to fix. |
842325b to
631cc96
Compare
Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
631cc96 to
e431c68
Compare
Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
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.
Purpose of the change
Needed for SQLAlchemySegmentStore, SQLite VectorStore implementations.
Description
Old:
Based on #1201 for some utilities.
New:
Based on #1296.
Add unified, well-tested way to encode/decode properties as SQL JSON to avoid repeated reimplementation.
Consumers of existing behavior are modified to use raw JSON encoding -- they may be moved to properties JSON in the future if appropriate. In particular, existing consumers of existing compile_sql_filter do not handle datetimes (no way of handling type collisions -- the new method uses a discriminated union).
Type of change
Breaking: filters will no longer ignore unknown keys.
It's confusing and potentially dangerous (especially with more complex filters including NOT, AND, OR) what treating unknown keys as None is supposed to mean. New behavior: If a filter is meant to be sent to multiple memories simultaneously, then all memories must support those fields.
It maybe would be okay if it obeyed SQL 3VL, but there is no case where a filter on one memory's field should affect the filter for another memory.
How Has This Been Tested?
Checklist
[Please delete options that are not relevant.]
Maintainer Checklist