memory.corrections, a scoped storage/vector backend, and the embedding dependency. See correction configuration before wiring a review UI.
Record a reviewed correction
The host passes verified ownership and the run being reviewed. This fictional invoice example records a field-level mapping with explicit user scope. Validate and authorize a real correction before calling this function; the values below are demonstration data.runId or userId does not establish that authority. Follow hosted authentication, not a local router example, for user-facing access.
Build scoped regression cases
Host function: pass the Agent and an already authorized owner. The host must also have permission to read this correction store. This example selects that owner’s user-scoped records and evaluates each original input in a fresh session with the same identity.failed count is nonzero. The quality-gate project shows reporting, process exit, and cleanup. This scorer fits a code-only answer; use schema/field validation when your real output is structured.
A passing regression establishes behavior for those cases under the tested configuration. Retain held-out examples to check that a correction did not simply overfit one input. The caller closes the Agent after evaluation and other consumers settle.
Keep provenance and quality separate
A correction rate is not automatically an accuracy rate: some mistakes are never reviewed, one answer may receive several corrections, and a review can arrive later. A model’s critique score is likewise not a calibrated confidence guarantee.
More patterns
Use memory patterns for preferences/history, evaluation patterns for assertions, and external Agent hosting for another execution framework. Useregister: false and explicit cleanup for temporary Agents; registry names are not resource ownership.