Feed

Rerank a list of items through an optional 3-stage pipeline: sort → diversity → limits_by_field.

Each item must have item_id; other fields are used by the pipeline stages. The final order is returned with position-based scores in [0, 1] (first item = 1.0, last = 0.0 for n > 1).

Sort Stage (optional):

  • sort: Multi-field sort. params.fields (array of field names), params.direction (array of asc or desc, same length as fields).
  • linear: Weighted sum. params is a list of { field, weight }. Items are scored by sum(field_i * weight_i) and ordered descending.
  • mix: Interleave by percentage. params is a list of { field, percentage, direction }. Percentages are normalized; items are taken in round-robin from each sorted list.

Diversity Stage (optional):

  • fields: Round-robin over groups. params.fields = list of field names. Items are grouped by field values and interleaved.
  • semantic: MMR-style diversity. params.lambda in [0, 1] (trade-off between relevance and diversity), params.horizon >= 5 (window size). Items should have an embed field (numeric array).

Limits-by-Field Stage (optional):

  • params.every_n: Slot size (>= 2). params.rules: list of { field, limit }. Within each slot of size every_n, at most limit items per distinct value of field are allowed.
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
items
array of objects
required
length ≥ 1

List of items to rank. Each must have item_id. Other fields are used by sort (numeric fields), diversity (embed for semantic), and limits_by_field (category fields).

items*
sort
object

Sort configuration for the ranking pipeline. Applied first in the pipeline.

Methods:

  • sort: Multi-field sort. params = { fields: string[], direction: ("asc"|"desc")[] }
  • linear: Weighted sum of numeric fields. params = [{ field, weight }]. Score = sum(field_i * weight_i), ordered descending.
  • mix: Interleave by percentage. params = [{ field, percentage, direction? }]. Items taken in round-robin from each sorted list.
diversity
object

Diversity configuration for the ranking pipeline. Applied after sort.

Methods:

  • fields: Round-robin over groups defined by field values. params = { fields: string[] }
  • semantic: MMR-style diversity using item embeddings. params = { lambda: number (0–1), horizon: integer (>= 5) }. Higher lambda favors relevance; lower lambda favors diversity.
limits_by_field
object

Limits-by-field configuration for the ranking pipeline. Applied after diversity. Items are grouped into slots of size every_n; within each slot, at most limit items per distinct value of field are allowed.

Responses

Language
Credentials
Bearer
API Key
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json