Skip to main content

Module query_parser

Module query_parser 

Source
Expand description

Filter query parser for memory search.

Parses GitHub-style filter syntax like:

  • ns:decisions - Filter by namespace
  • tag:rust - Filter by tag (AND with other tags)
  • tag:rust,python - Filter by tags (OR logic)
  • -tag:test - Exclude memories with tag
  • since:7d - Filter by time
  • source:src/* - Filter by source pattern
  • status:active - Filter by status
  • project:github.com/org/repo - Filter by project identifier
  • branch:main - Filter by branch name
  • path:src/main.rs - Filter by file path
  • entity: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.