21/38
Part 4 of 6 · Generation and latencyLearn and do

Check each step before the agent sees it

A cheap second pass checks each step:

  1. Does the cited chunk exist?
  2. Is it active?
  3. Does it match the language, the country and the date?
  4. Does it support the step?

The last check is an entailment question: does the chunk imply the step? A small model or an LLM judge can answer it within a tight budget, about 40 ms per step in the latency budget.

A step that fails is dropped or flagged, never shown as fact.

In the editor, write verify(steps, chunks, ticket): the steps that pass all four checks. chunks holds each chunk's tags, and entails stands in for the small model of check 4: it says yes only for the pairs in SUPPORTS.