T2 chain · customer support: one schema-typed call classifies the WHOLE queue (enums keep the categories honest), jq slices the urgent ones, and the escalation fires only when there’s something to escalate.
The job
It’s 8:55. There are 40 tickets from overnight. Someone reads them all, tags them, writes first replies, and pages on-call if anything’s on fire. This file does the reading, tagging and drafting (under a sortable v7 batch id) and pages only whenurgent is non-empty.
The shape
The file
support-triage.nika
How it works
1
Enums make classification honest
category and urgency are schema enums: the model cannot invent
a « kinda-urgent » tier. Typed output means the jq filter downstream
can trust the values.2
jq slices, the model doesn't re-read
urgent filters urgency == "high" or "critical" out of the typed
list: no second model call to ask « which ones were urgent? ».3
v7 uuids sort by time
nika:uuid version: v7 is timestamped: triage boards land on disk
already in chronological order.Constructs you just used
Run it
What it needs: A local model (Ollama serving
qwen3.5:4b) and the sample queue. ONCALL_WEBHOOK_URL matters only on the escalation path: the sample carries an outage ticket, so a real model opens that gate, and an unset variable then fails loudly (NIKA-VAR-001).1
Rehearse it
nika try names the hosts a step may reach: may reach: hooks.slack.com — the mock replaces the model, not the network.2
Get your own copy
Save the file above as
support-triage.nika in a new folder, then download the sample it reads:3
Check it, then run it
out/triage-<batch id>.json.Any other model works: pass --model <provider>/<name> with its key, and cap a cloud model with --max-cost-usd.Make it yours
- Push the first replies as DRAFTS into your helpdesk via its API (
nika:fetch method: POST): humans still hit send. - Track sentiment over time: append each batch’s stats to a CSV with
nika:write. - Speed matters at 9am: swap the envelope
model:for a cataloged cloud seat and cap the run with--max-cost-usd.
Next · Contract guard
The local inference example: a LOCAL model reads the contract, and a
validate + assert pair refuses bad extractions.