Back to Documentation

Advanced Metadata Filtering

Complex AND/OR/NOT queries with 12+ operators for precise memory filtering

Overview

Memphora supports powerful metadata filtering with a MongoDB-like query syntax. You can combine comparison operators, array operators, logical operators, and nested conditions to create precise filters for your memories.

💡 Tip: All metadata filtering is done on the metadata field of your memories. You define the structure and can query it however you need.

Supported Operators

Comparison Operators

  • $gt - Greater than
  • $gte - Greater than or equal
  • $lt - Less than
  • $lte - Less than or equal
  • $eq - Equal
  • $ne - Not equal

Array Operators

  • $in - In array
  • $nin - Not in array

Other Operators

  • $regex - Regular expression
  • $exists - Field exists

Logical Operators

  • AND - All conditions must be true
  • OR - At least one condition must be true
  • NOT - Negates a condition

Operator Examples

Click on each operator to see a detailed example:

Best Practices

  • •Keep filters simple: Start with basic conditions and add complexity only when needed.
  • •Use AND sparingly: Too many AND conditions can over-filter your results.
  • •Index important fields: Frequently filtered fields should be simple types (string, number, boolean).
  • •Test incrementally: Build complex queries step by step, testing each part.
  • •Document your metadata: Keep a schema or guide for what metadata fields you use.