CookbookSupport bot that won't hallucinate

A support bot that won’t invent your policies

Problem. Your RAG support bot answers from your help docs — until a customer asks something at the edge, and the model confidently states a refund window or SLA that isn’t in your docs. The customer believes it. Now it’s your problem.

Fix. Run the answer through verified.create with your retrieved chunks as sources. Anything the model can’t quote from your docs is caught in unsupported[] instead of being shipped — and if coverage is low, you hand off to a human instead of guessing.

import { MaxModel } from 'maxmodel'
const mx = new MaxModel({ apiKey: process.env.MAXMODEL_KEY! })
 
async function answer(question: string) {
  const chunks = await retrieve(question)            // your existing retriever
  const sources = chunks.map((c) => ({ id: c.id, text: c.text }))
 
  const out = await mx.verified.create({
    model: 'gpt-5.5-pro',
    messages: [{ role: 'user', content: question }],
    sources,
    minCoverage: 0.7,        // if <70% of the answer is grounded, flag it as abstained
  })
 
  if (out.abstained || out.coverage < 0.7) {
    return { reply: "I don't want to guess on this — connecting you to a teammate.", escalate: true }
  }
  return {
    reply: out.text,                       // grounded answer with [source] markers
    citations: out.citations,              // show the receipts in your UI
    dropped: out.unsupported,              // log these — they're what the model tried to invent
  }
}

What changed. Before, a hallucinated policy looked identical to a real one. Now:

  • grounded sentences ship with a verbatim quote + the source id you can render as a chip;
  • anything not in your docs goes to unsupported[] (log it — it’s a goldmine of “what our docs don’t cover”);
  • low coverage → deterministic hand-off, not a confident wrong answer.

Tip. unsupported[] is a free content-gap report. The questions your bot keeps failing to ground are the docs you should write next.

See verified.create for the full parameter and response surface, and How verification works for why the check is exact, not a model judge.