Examples

Route a support ticket

Team, urgency and frustration in one request.

A support inbox needs each message sent to the right team, urgent ones flagged and angry customers noticed. One request answers all three, sharing the message's tokens.

The request

{
  "model": "myles-g-12b",
  "state": {
    "from": "customer",
    "message": "This is the third time I've been charged for order 4471. I want the extra payments back today or I'm cancelling."
  },
  "questions": {
    "team": {
      "type": "choice",
      "instructions": "Which team should handle this message?",
      "criteria": {
        "billing": "Payments, refunds, invoices and charges",
        "orders": "Delivery, returns and order changes",
        "technical": "The product or website not working",
        "other": "None of the teams above"
      }
    },
    "urgent": {"type": "noul", "instructions": "Does this need a reply today?"},
    "frustration": {
      "type": "score",
      "instructions": "How frustrated is the customer?",
      "criteria": ["Calm", "Mildly annoyed", "Clearly frustrated", "Angry, threatening to leave"]
    }
  }
}

Reading the answer

{
  "model": "myles-g-12b",
  "answers": {
    "team": {"type": "choice", "choice": "billing", "confidence": 0.94,
             "probabilities": {"billing": 0.96, "orders": 0.02, "technical": 0.01, "other": 0.01}},
    "urgent": {"type": "noul", "noul": 0.93},
    "frustration": {"type": "score", "score": 2.79, "level": 3, "confidence": 0.86,
                    "legend": {"0": "Calm", "1": "Mildly annoyed", "2": "Clearly frustrated", "3": "Angry, threatening to leave"},
                    "probabilities": {"0": 0.0, "1": 0.02, "2": 0.17, "3": 0.81}}
  },
  "usage": {"input_tokens": 196, "output_tokens": 3}
}
  • Route automatically when the top team's probability is above your threshold; otherwise put the message in a general queue.
  • Flag for a same-day reply above a high urgent threshold, such as 0.9.
  • Use the frustration level to order the queue, not to route it.

What to watch

  • The share of messages that fall below the routing threshold: it is the work left for people.
  • How often other wins. A rise usually means a new kind of request that needs its own team or a clearer description.
  • Messages a team sends back as misrouted: use them as labelled cases when you next check the thresholds.