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:
- Does the cited chunk exist?
- Is it active?
- Does it match the language, the country and the date?
- 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.