top_sources searches for several queries, joins the hits into one list, drops repeated URLs, and ranks what’s left against the question in one decision-model call.
Join and dedupe in code
- The
mapreturns one list of hits per query, so{{searches.results}}is a list of lists. builtin__flattenjoins them into one list, andbuiltin__dedupekeeps the first hit for eachurl.- Neither makes a model call. Sorting by a field the items carry and cutting to the first
nwork the same way, withbuiltin__sortandbuiltin__take.
Rank against the question in one call
builtin__rank asks the decision model one choice question:
- The items are the options, each shown by its
snippet. stateis what they’re judged against, here the question. Keep it to what the question needs.{{best.items}}is the five most likely items, best first, and{{best.ranked}}carries each one’s probability.- With
none,{{best.no_fit}}is true when nothing in the list answers the question, so anexitgate can stop before the next step.
filter with a decide gate instead.
Related guides
Iterate with map and reduce
Run steps for each item of a list.
Select items with filter
Keep only the items that pass a check.