Table of contents
Official Content
  • This documentation is valid for:

Profile Metadata allows you to define filters that control the information retrieved by RAG Assistants.

Filters act as logical conditions that refine the results based on specific criteria. These filters are combined using the AND operator to create more complex filtering logic.

To define a filter, specify the following:

  • Key: A mandatory field that identifies the specific attribute or property to filter.
  • Operator: An optional field that defaults to $eq (equal) if not specified. It defines the comparison operator used for filtering. The available operators are:
    • $eq: Equal (default)
    • $ne: Not Equal
    • $gt: Greater than
    • $gte: Greater than or equal
    • $lt: Less than
    • $lte: Less than or equal
    • $in: In(1)
    • $nin: Not In(1)
    • $ismatch: IsMatch over the chunk content and not the metadata(2)
  • Value: This field specifies the value to be used in the comparison.

(1) - Multivalued Filter Operators
(2) - IsMatch Filter Operator

Then, each filter has the following format:

{
  "key": string, // mandatory
  "operator": string, /* optional defaults to $eq if not set*/
  "value": string | number
}

Note that only string\number data types are supported. To compare against a Date or Datetime element, you must represent it as a string, for example, using a format similar to the following:

YYYMMDD: string representation for a Date
YYYMMDDHHMMSS: string representation for a DateTime

Samples

Sample #1

Suppose you want to retrieve information about products with a price greater than $100. To do this, you can define a filter with the following structure:

"filters": [
  {
    "key": "price",
    "operator": "$gt",
    "value": "100"
  }
]

This filter will only return information about the products whose price attribute is greater than 100.

Sample #2

To retrieve information about files named "SampleFile" with a "txt" extension, you can define two filters and combine them using the AND operator:

"filters": [
  {"key": "name", "value":"SampleFile", "operator":"$eq"},
  {"key": "extension", "value": "txt", "operator": "$eq"}
]

Sample #3

To retrieve information about a sampleDate metadata element greater than 01/07/2025, store the metadata as YYYYMMDD and apply the following filter:

"filters": [
  {"key": "sampleDate", "value": "20250701", "operator": "$gt"}
]
Last update: December 2025 | © GeneXus. All rights reserved. GeneXus Powered by Globant