Segmentations
Balance recommendation results across buckets — genre, price tier, brand — so one category does not dominate a carousel. Link a segmentation to a scenario with itemsPerSegment.
Segmentation types
| Setting | Type | Default | Description |
|---|---|---|---|
| property | type | — | Segment by scalar or set property, e.g. category. |
| auto-nextql | type | — | Expression returns set of segment names per item. |
Property segmentation
POST /segmentations
{
"name": "By category",
"segmentationId": "by-category",
"type": "property",
"property": "category",
"propertyType": "string"
}Use case
Max 2 items per category on homepage
Scenario: segmentationId: "by-category", itemsPerSegment: 2,autoExpandSegments: true.
auto-nextQL segmentation
Expressions return segment name sets. Use conditionals for price tiers — there is no separate "filter in segment" field; conditions inside the expression define membership.
{
"name": "Price tiers",
"segmentationId": "by-price-tier",
"type": "auto-nextql",
"expression": "if 'price' < 20 then {"Budget"} else (if 'price' > 60 then {"Premium"} else {"Mid-Range"})"
}Use case
Genre + accolade tag
'genre' + (if 'rating' > 4.5 then {"Top Rated"} else {})Use case
Monthly release buckets
map(lambda 'x': {string('releaseDate', '%Y-%m')}, 'category')Scenario linkage
| Setting | Type | Default | Description |
|---|---|---|---|
| segmentationId | string | — | ID of segmentation config. |
| itemsPerSegment | number | — | Max items per segment in results. |
| autoExpandSegments | boolean | true | Increase slots when below minItems. |
Validate expressions: POST /segmentations/validate-expression. Preview segments: GET /segmentations/:id/segments.
