Create a context
- Open Console > Contexts and click New context.
- Give it a descriptive name such as “Homepage Feed” or “Post-purchase Sidebar”.
- Add an optional description so teammates understand its purpose.
- Select the model this context draws recommendations from.
- Choose the recommendation type:
- Item to User returns items relevant to a given user.
- User to Item returns users similar to a given item.
- Item to Item returns items similar to a given item.
- User to User returns users similar to a given user.
- Save the context and note its numeric ID. Your engineering team will pass this ID in
context_idon every recommendation request.
Filters
Filters restrict which items are eligible for recommendation. Only items that pass all active filters will appear in results. To add a filter:- In the Filters section, click Add Condition.
- Select a metadata field from your catalog (for example
category,in_stock,price). - Choose an operator:
=,!=,LIKE,NOT LIKE,>,<,>=,<=,IN,NOT IN. - Enter the value to compare against.
- Add more conditions and set each one to combine with the previous using
ANDorOR.
| Field | Operator | Value | Logic |
|---|---|---|---|
in_stock | = | true | |
category | = | Electronics | AND |
Influence rules
Influence rules adjust the score of items that match a condition, moving them up or down relative to other results without hard-filtering them out. To add an influence rule:- In the Influence section, click Add Influence Rule.
- Set the type to Promote (score higher) or Demote (score lower).
- Select the field to match on (for example
categoryor a specificitem_id). - Enter the value to match.
- Choose the weight:
+10%,+25%,+50%,2xfor promotion-25%,-50%for demotion
| Type | Field | Value | Weight |
|---|---|---|---|
| Promote | is_new_arrival | true | +50% |
Group by fields
Group by fields enforce diversity by limiting how many items from the same group can appear consecutively or within a result set. To add a group by field:- In the Group By Fields section, click Add Group By Field.
- Select the metadata field to group on, such as
categoryorbrand.
Sliding window for repeat items
The sliding window prevents items a user has recently seen from appearing again too soon.- Check Exclude items the user has already viewed.
- Set the Amount and Unit (Minutes, Hours, Days, Weeks, or All time).
Pinned and forced items
Use Ensure top X to guarantee that specific items always appear within the first results.- Check Ensure top X in the additional options.
- Set Top X count to the number of positions to fill with forced items.
- Specify the Forced items by item ID.
Random content injection
Checking Include random content in recommendations mixes a small proportion of randomly selected items into results. This introduces serendipity and helps the engine discover new interests for users who have a narrow history.Preview recommendations
Use the Preview Recommendations panel at the bottom of the context editor to test the current configuration before saving.- Select a user from the dropdown, or click Random User to pick one at random.
- The panel displays the items that would be returned for that user under the current context settings.

