Objective
Downstream text drifts from its source: a product description contradicts the supplier specification, or text extracted from a document names the wrong invoice. NLI assists the wording review — after your application has matched exact identifiers. This recipe shows both the wins and the trap.
Run it in SQL (v2.1.2-ce+)
After your application matches the identifier (do that with an exact key, not NLI), use SQL to review the wording:
SELECT JSON_UNQUOTE(JSON_EXTRACT(NLI_VERIFY('nli-default',
'The casing of SKU ZX41 is made of aluminum.',
JSON_ARRAY('SKU ZX41 has an aluminum casing.')), '$.verdict')) AS agrees_with_spec;
Expected: TRUTH.
SELECT JSON_UNQUOTE(JSON_EXTRACT(NLI_VERIFY('nli-default',
'The casing of SKU ZX41 is made entirely of steel.',
JSON_ARRAY('The casing of SKU ZX41 is made entirely of aluminum and contains no steel.')), '$.verdict')) AS contradicts_spec;
Expected: LIE. The trap: NLI assists the wording review only after exact
identifiers are matched — it will not tell you whether two records refer to the
same SKU.
Step 1: Supplier spec, faithful description
curl -s -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{
"model": "nli-default",
"statement": "The casing of SKU ZX41 is made of aluminum.",
"truth_anchors": ["SKU ZX41 has an aluminum casing."],
"closed_world": false,
"contradiction_threshold": 0.6, "entailment_threshold": 0.6
}' http://localhost:8080/v1/ai/nli/verify
Expected: entailment.
Step 2: Material conflict
curl -s -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{
"model": "nli-default",
"statement": "The casing of SKU ZX41 is made entirely of steel.",
"truth_anchors": ["The casing of SKU ZX41 is made entirely of aluminum and contains no steel."],
"closed_world": false,
"contradiction_threshold": 0.6, "entailment_threshold": 0.6
}' http://localhost:8080/v1/ai/nli/verify
Expected: contradiction. Preserve qualifiers like "entirely", "coated", "contains" — they carry the meaning the classifier reasons over.