Skip to content

Break a problem into decisions

At the end, a fuzzy job is a few small questions with fixed answers, each tried on a real message and saved in one toolbox.

1. Write down the decisions a person makes

Section titled “1. Write down the decisions a person makes”

"Handle this support message" has no answer you can check. A person doing the job makes three decisions:

  • Does the customer request a refund? A yes or no, from decide.
  • What is the message about? One of billing, shipping or other, from choose.
  • How urgent is it? A number from routine to urgent, from score.

Each has a small answer, so you can check it against what you would have said.

Try each question on one real message with --text. Set a low and a high bar, so a message the model can't settle comes back not sure:

Terminal window
thinkthen decide --low 0.2 --high 0.8 \
--text 'I was charged twice for one invoice.' \
'Does the customer request a refund?'

Output

unsure

Not sure: a double charge might be a refund request, or might not. That is the message a person should read.

Terminal window
thinkthen choose \
--choice billing --choice shipping --choice other \
--text 'I was charged twice for one invoice.' \
'What is the message about?'

Output

billing

Billing: a double charge is about an invoice.

Terminal window
thinkthen score --level routine --level urgent \
--text 'I was charged twice for one invoice.' \
'How urgent is the request?'

Output

0.45

The answer is a number from 0 for routine to 1 for urgent.

Save the three questions in a toolbox, with the same bars:

inbox.json
{
"questions": {
"refund": {
"function": "decide",
"question": "Does the customer request a refund?",
"threshold": {"low": 0.2, "high": 0.8}
},
"topic": {
"function": "choose",
"question": "What is the message about?",
"choices": ["billing", "shipping", "other"]
},
"urgency": {
"function": "score",
"question": "How urgent is the request?",
"levels": ["routine", "urgent"]
}
}
}

annotate asks all three at once and prints each answer by its name:

Terminal window
thinkthen annotate \
--text 'I was charged twice for one invoice.' \
inbox.json

Output

refund=unsure	topic=billing	urgency=0.45

The same three answers come back in one call: not sure, billing and the urgency.

  • Each answer is one you could have given yourself. If you can't say whether an answer is right, the question is still too big; split it again.
  • Name everything the model needs in the question itself: the allowed values, and any date or amount rule.
  • Code routes, counts and acts on the answers. The model only answers. A person reads the not-sure cases.

Triage a support inbox asks these questions about a whole inbox and sends each message to its queue.