Skip to main content
A correction is application evidence about a previous answer. Store what was wrong, the reviewed replacement, and the original input. Retrieval can supply that evidence to later runs; it does not guarantee the model will never repeat the mistake. These are focused host functions. Your application owns authentication, an Agent configured with 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.
Verify a correction ID is returned and the stored record has the expected scope. If your workflow intends tenant-wide or agent-wide knowledge, choose that scope deliberately. The default correction scope is agent scope; do not assume omission means private user memory. An HTTP review endpoint must verify the caller may review the referenced run and may write the selected knowledge scope. A request containing a 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.
Inspect failed cases, then make your CLI fail when the suite’s 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. Use register: false and explicit cleanup for temporary Agents; registry names are not resource ownership.