You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it might be worth pushing the scope filter down to the DB layer rather than relying on in-memory filtering. The SQLite backend already supports json_extract-based filtering on nested payload paths via _json_path_for_key (sqlite_vector_store.py:20) — it just needs the adapter to translate the logical key to the backend-specific path:
OceanBase: scope → filter on the metadata JSON column directly
Both list() and count() on the vector stores already accept arbitrary filter keys with dotted nesting. If the adapter does this translation, the has_extra_filters / fetch-all / in-memory paginate branch could be dropped, keeping pagination and counting at the DB level and avoiding the large-fetch risk on bigger datasets.
Thanks for the suggestion. I pushed an update that translates logical metadata filters before calling the vector store, so list/count no longer fetch all rows for scope filtering. SQLite and PGVector now use nested payload paths such as metadata.scope, while OceanBase keeps scope so its metadata JSON column filter is used directly.\n\nValidation done:\n- targeted scope/list tests passed\n- full unit suite passed: 421 passed\n- started the API server locally and verified the real GET /api/v1/memories flow: created 4 memories with personal/group scopes, confirmed scope=personal returned total 3 with correct paginated results, confirmed scope=group returned total 1, then cleaned up the 4 test memories
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
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
Closes #1014.
scopequery parameter toGET /api/v1/memoriesfor metadata scope filtering.limit/offset.Validation
pytest tests/unit/test_list_memory_filters.py tests/unit/test_memory.py -qPYTHONPATH=src pytest tests/unit -qpython3 -m flake8 src/server/api/v1/memories.py src/server/services/memory_service.py src/powermem/core/memory.py src/powermem/storage/adapter.py tests/unit/test_list_memory_filters.py --select=F601,F821,E999git diff --check