Introduction to ReQL

Recombee Query Language (ReQL) provides an elegant way for applying bussiness rules or any other rules to the recommendations. It allows expressions to be evaluated on candidate items, telling the recommender how to handle each item based on the values of the item’s properties.

Each recommendation request has two parameters, which take ReQL:

  • filter – for selecting a subset of items which can be used in recommendation
  • booster – for preferring some items over the others

Definition of the attributes and their values for individual items is done through API methods (see Item Properties and Item Property Values) and is left to the user. Different properties may be defined for different recommendation domains. All the items have one automatically created property itemId.

Filtering and Boosting

In filtering, the expression must return boolean value for each item. If the value returned is true, the item passed the filter; if the value is false, the item does not pass and will be discarded.

Read more about filtering

In advanced applications, besides filtering, you may wish to boost recommendation rates of some items. In contrast to filtering, where items may be completely blocked, in boosting, you may tell the recommender to prefer some items among others. Indeed, by default, it is a task of the recommender itself to select the items which are the most relevant. However, it may be your policy to purposefully bias the recommender toward your business goals.

Read more about boosting