ModelRig Quickstart Routing & reliability Route bundles Probes Bake-offs & replay How it fits Grade protocol Optimization loop Caching lifecycle Bring your traces (OTLP) Observe a pipeline Migration playbook (T0–T2) Recognition playbooks Tenants & statements Published receipts Provenance & trust Artifact content custody The MCP oracle Use-case templates Template: ticket triage Template: document extraction Template: CS next action Template: lead qualification Template: compliance review Template: catalog cleansing Template: call disposition QA Template: financial classification Template: medical classification Leaderboard

Template: catalog cleansing

Normalize a product-catalog record into your own taxonomy and attribute shape, correct what is clearly wrong, and flag the ones a person should check. This page is one of the use-case templates — a starting point, not a finished route. Cleansing usually runs as a batch over a backlog of raw records; you grade a representative sample and let the grades stand in for the rest. The machine-readable source is node_modules/modelrig/templates/catalog-cleansing.json.

Does this task fit?

Catalog cleansing fits the shipped teach → calibrate → grade → optimize loop when four conditions hold. (1) Your catalog taxonomy and attribute set are stable enough that a rule that cleaned last month's records still cleans this month's — if the taxonomy is still being redrawn, settle it before you calibrate. (2) Someone who owns the catalog can write down what a correctly cleansed record is, field by field, which is the grading guide below. (3) You have corrected records on hand — rows a person already fixed — so a grader can be calibrated against that ground truth. (4) You process enough records that calibration and optimization pay back. Cleansing usually runs as a batch over a backlog of raw records rather than one at a time; the loop still applies — you grade a representative sample of the batch and let the grades stand in for the rest. This template gives you a taxonomy shell and a grading guide to fill in; it does not assume your fields, and it makes no claim about how well any model cleanses a record — that is what your goldens and grades measure.

Starter schema

Replace every TODO with your own taxonomy; the enum slots ship without values on purpose, so an unfilled template refuses to look finished.


{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$comment": "STARTER SCHEMA. Replace every TODO with your own taxonomy and attributes before use. The template runs as-is: free-text fields validate immediately. TODO markers show where adding your own enum values tightens grading to your catalog; do not copy example words from the docs.",
  "title": "CatalogCleansing",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "category",
    "needs_human"
  ],
  "properties": {
    "category": {
      "type": "string",
      "description": "The catalog category this record belongs in. TODO(enum): constrain this to YOUR own category labels by adding an \"enum\": [ ... ] here. It runs as free text immediately; add your own enum values here to tighten validation and grading to your taxonomy.",
      "$comment": "TODO(enum): add your catalog categories as the enum for this field."
    },
    "corrected_attributes": {
      "type": "object",
      "description": "The cleansed attribute values. TODO: replace this placeholder with one named property per attribute you normalize (e.g. brand, unit_size, color), each with its own type and description. Keep additionalProperties false once you have listed them so nothing extra is invented.",
      "additionalProperties": true,
      "$comment": "TODO(fields): replace with your real attribute set; add a required list once you know which attributes must always be present."
    },
    "duplicate_of": {
      "type": "string",
      "description": "The id of an existing record this one appears to duplicate, when you run dedupe. Leave absent when the record is not a suspected duplicate; the model should flag a suspected merge, never perform it."
    },
    "needs_human": {
      "type": "boolean",
      "description": "True when the record is too ambiguous or conflicting to cleanse confidently and a person should review. Pairs with the escalation band in the grading guide."
    }
  }
}

Starter grading guide

The starter criteria run as written — sharpen each one in your team's own words as you grade. They are in the exact jsonb shape the set_task_settings write path validates — binary checks, each with a one-sentence pass and fail. There is no pass_threshold here: that lives in the route's grade: block.

category-correct — Category is correct

corrections-grounded — Corrections are grounded in the record

preserves-correct-data — Already-correct data is preserved

human-flag-when-unsure — Ambiguous or conflicting records are flagged for a human

The guide's escalation band starts at epsilon: 0.1: a grade within that distance of the route's pass threshold is treated as judge-uncertain and sent to a human. It is a starting band — tune it as your grader calibrates.

Golden checklist

Roughly twenty examples that cover:

Escalation starter

Start by escalating to a person whenever the model sets needs_human, and whenever a suggested duplicate merge would combine records that a person has not confirmed. The machine-side band lives in starter_guide.escalation.epsilon: a grade within that distance of your route's pass threshold is treated as judge-uncertain and sent to the review queue. The 0.1 here is a starting band — widen it while you build trust on a fresh batch, narrow it as your grader calibrates against your corrected records.

Apply it

By hand: replace the placeholder corrected_attributes object with one named property per attribute you normalize, each with its own type; replace the TODO category taxonomy with your own labels; sharpen each starter criterion in your team's words; gather the goldens the checklist describes; set the escalation band.

From a coding agent: the template feeds through the tools that already exist — create_route drafts the route bundle from the starter schema (files only, never your source), and set_task_settings (the task-settings scope) authors the grading guide as-is — the starter criteria run as written; sharpen them to your own rules as you grade. No new tool is involved. See the use-case templates overview for the full two-path walkthrough.