Expand description
Filter query parser for memory search.
Parses GitHub-style filter syntax like:
ns:decisions- Filter by namespacetag:rust- Filter by tag (AND with other tags)tag:rust,python- Filter by tags (OR logic)-tag:test- Exclude memories with tagsince:7d- Filter by timesource:src/*- Filter by source patternstatus:active- Filter by statusproject:github.com/org/repo- Filter by project identifierbranch:main- Filter by branch namepath:src/main.rs- Filter by file pathentity:PostgreSQL- Filter by entity name (memories mentioning this entity)entity:Rust,Python- Filter by multiple entities (OR logic)
Functionsยง
- parse_
duration_ ๐to_ timestamp - Parses a duration string (e.g., โ7dโ, โ30dโ) into a Unix timestamp.
- parse_
excluded_ ๐token - Parses an excluded token (prefixed with -).
- parse_
filter_ query - Parses a filter query string into a
SearchFilter. - parse_
status ๐ - Parses a status string into a
MemoryStatus. - parse_
tag_ ๐value - Parses tag values and adds them to the appropriate filter field.
- parse_
token ๐ - Parses a single filter token and updates the filter.