Support-Response Grounding with NLI
Objective
A drafted support reply promises something the approved support guide may not back — "yes, phone support is included" costs real money when it isn't. Split the draft into atomic claims and verify each against the guide passage for the customer's actual plan, in-process, before the reply is sent.
Step 1: A claim the guide supports
curl -s -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{
"model": "nli-default",
"statement": "Email support is included in the standard plan.",
"truth_anchors": ["The standard plan includes email support."],
"closed_world": false,
"contradiction_threshold": 0.6, "entailment_threshold": 0.6
}' http://localhost:8080/v1/ai/nli/verify
Expected (verified on v2.1.1-ce): verdict TRUTH on a qualifying entailment (0.99+) — the paraphrase is supported. This clears one claim, not the whole reply.
Step 2: A claim the guide explicitly excludes
curl -s -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{
"model": "nli-default",
"statement": "The standard plan includes phone support.",
"truth_anchors": ["The standard plan does not include phone support."],
"closed_world": false,
"contradiction_threshold": 0.6, "entailment_threshold": 0.6
}' http://localhost:8080/v1/ai/nli/verify
Expected (verified): verdict LIE, contradiction 1.00, the violated anchor named in the response — the draft reverses the guide. Route the reply back for correction.
Step 3: Why compound claims must be split
curl -s -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{
"model": "nli-default",
"statement": "The standard plan includes email support and phone support.",
"truth_anchors": ["The standard plan includes email support."],
"closed_world": false,
"contradiction_threshold": 0.6, "entailment_threshold": 0.6
}' http://localhost:8080/v1/ai/nli/verify
Expected (verified): verdict UNVERIFIED_PLAUSIBLE, neutral 1.00 — one supported clause cannot establish the extra clause. Split compound sentences into atomic claims and verify each on its own.
Use it from your app
Wire this as the last gate in your reply pipeline: generate → segment into
claims → select the guide passages for the customer's plan → /verify each
claim → block or flag on any non-entailment. Retrieving the right guide version
and splitting sentences is your application's job; the classifier checks
exactly the text you give it.
Key Concepts Learned
- Verify claims one at a time — compound claims dilute to neutral.
- An explicit exclusion in the evidence turns an optimistic promise into a detectable contradiction.
- One entailment approves one claim, never the whole response.