Skip to content

Conversation

@NTLx
Copy link
Contributor

@NTLx NTLx commented Jan 31, 2026

This PR implements advanced search filtering capabilities, addressing Issue #140.

🚀 Features

  • Standardized Filter Parser: Introduced src/powermem/utils/filter_parser.py to translate high-level API filters into storage-compatible queries.
  • Time Range Filtering: Supports start_time and end_time filters (mapped to created_at range queries).
  • Tag Filtering: Supports tags filtering (list or single value).
  • Type/Category Filtering: Maps type filter to internal category field.
  • Importance Filtering: Supports importance threshold filtering.
  • Integration: Integrated the parser into PySeekDBVectorStore, enabling these features for the new backend.

🛠 Implementation Details

  1. Filter Logic: The parser converts user-friendly keys like start_time into operator-based queries (e.g., {'': ...}) compatible with vector databases like Chroma/SeekDB.
  2. Extensibility: The parser is designed as a standalone utility, making it easy to apply consistent filtering logic across other storage backends (OceanBase, PGVector) in the future.
  3. PySeekDB Support: Updated the PySeekDBVectorStore implementation to utilize this parser in both search() and list() methods.

✅ AI Contribution Details

  • Analysis: Analyzed the existing SearchRequest model and identified that the service layer already supports passing filters, isolating the work to the storage/utility layer.
  • Design: Designed a non-intrusive utility function to standardize filter parsing without modifying core Service logic.
  • Implementation: Implemented the parser and integrated it into the storage adapter.

Ready for review! 🔍

@Teingi
Copy link
Member

Teingi commented Jan 31, 2026

There are merge conflicts in this pull request. Please resolve them before we can proceed with the review.

@NTLx
Copy link
Contributor Author

NTLx commented Jan 31, 2026

Hello @Teingi, I have resolved the merge conflicts in pyseekdb_store.py. The advanced filter logic has been correctly integrated with the latest base code. The PR is now ready for further review. Thanks!

Copy link
Member

@Teingi Teingi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Teingi Teingi merged commit b51774f into oceanbase:main Jan 31, 2026
14 of 15 checks passed
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.

2 participants