Support operations

Support Ticket Triage with Laya

Route a support ticket, score urgency, and detect refund intent in one typed-decision call.

Use case

Use Laya as a fast decision layer before a helpdesk workflow, human queue, or larger language model.

State

I was charged twice for invoice 441 and nobody has answered for three days. Refund the duplicate today or we are cancelling our plan.

Typed questions

choicedepartment

Which team should handle this ticket?

billingtechnicalsales
scoreurgency

How urgent is this request?

lowmediumhighcritical
noulrefund_requested

Does the customer explicitly request a refund?

Expected direction

  • department should strongly favor billing
  • urgency should rank toward the high end
  • refund_requested should return a high P(true)

Copy the implementation

Python
from laya import Router

router = Router(preload=True)

state = {
    "body": "I was charged twice for invoice 441 and nobody has answered for three days. Refund the duplicate today or we are cancelling our plan."
}

questions = {
    "department": {
        "type": "choice",
        "instructions": "Which team should handle this ticket?",
        "criteria": {
            "billing": "payments, invoices, refunds",
            "technical": "bugs and outages",
            "sales": "pricing and contracts"
        }
    },
    "urgency": {
        "type": "score",
        "instructions": "How urgent is this request?",
        "criteria": ["low", "medium", "high", "critical"]
    },
    "refund_requested": {
        "type": "noul",
        "instructions": "Does the customer explicitly request a refund?"
    }
}

print(router.predict(state, questions))
TypeScript / Node.js
import { Laya } from "@receptron/laya";

const laya = await Laya.load();
const result = await laya.systemOne(
  { body: "I was charged twice. Refund the duplicate today." },
  {
    department: {
      type: "choice",
      instructions: "Which team should handle this ticket?",
      criteria: { billing: "payments and refunds", technical: "bugs and outages", sales: "pricing and contracts" },
    },
    urgency: { type: "score", instructions: "How urgent is this request?", criteria: ["low", "medium", "high", "critical"] },
    refund_requested: { type: "noul", instructions: "Does the customer explicitly request a refund?" },
  },
);
console.log(result.answers);
await laya.close();

Related resources