Behavior
- The items become the options of one
choicequestion,stateis the context they’re judged against, andinstructionsis the question. - Each option shows the item’s
describefield, or the whole item whendescribeis absent. itemsis the list sorted by probability, highest first, andrankedpairs each item with its probability. Both are cut totop_k.- Options are shown in a shuffled order seeded from the items, since decision models lean toward the first options. The same list ranks the same way on a rerun.
noneadds a “nothing fits” option. Its probability comes back asnone, andno_fitis true when it beats every item.- Lists over 254 items are ranked in chunks sent together, and each chunk’s best meet in a final choice. Items that don’t reach the final choice follow the finalists with a
nullprobability. - Needs a decision model role,
deciderby default.
When to use it
- Reranking search results, candidates or options against a question: one call instead of one per item, and no LLM.
- Keep
stateto what the question needs: the question and its context, not the items. - For an absolute yes or no per item rather than an order, use a
filterstep with adecidegate.
Input
string
Dot path into each item to show as the option, e.g.
url or meta.datestring
required
The choice question
any[]
required
The list, usually a template like {{E1.results}}
string
The decision model role; default decider
string
Text of a ‘nothing fits’ option
any
required
The context the items are judged against, e.g. {“question”: “{{input.question}}”}
integer
Keep only the best k
Output
any[]
required
boolean
number
object[]
required