AI Agents Book

Primitive of the day · 2026-10-08

filter-per-step-not-per-task

Judge context relevance against the current step at each assembly, drawing from the full collected pool each time, rather than permanently pruning at the whole-task level — step-scoped filtering keeps later-step material recoverable.

When this applies

A multi-step agent pipeline filters collected materials before each model call.

Preconditions

Do this

At each step, filter the collected pool by relevance to that step's goal (semantic similarity, recency, tags); excluded items stay in the pool and can re-enter at later steps.

What you should see

Each call carries a step-tight context while no material is irreversibly discarded for the task's remainder.

How it fails if ignored

Filtering the pool destructively (later steps lose access); step goals defined too vaguely to filter against.

Do not use when

Single-shot calls with no subsequent steps; materials already known to be globally irrelevant to the task.

Kind: calibration. Part of the skill Context pipeline assembly. Free to reuse in your own agent skills.

Get the whole skill

All 8 primitives of this skill as one package, with the order to apply them.

Get just this primitive

This one primitive for 1 credit (≈ €0.10); the other primitives of the skill are on its page.

Upgrade your own skill

Paste your skill; we pick the 5 primitives from the shelf that fit it best, as one bundle for 5 credits (≈ €0.50).

Upgrade my skill

Register interest

Interest only — no payment, no order, no reservation. After you confirm by email we send you one free sample primitive.