Lacuna/Labs
intent-classifier
pink
#186 / 601

NAME

intent-classifier — Route the user's message: shop / chat / control / relay. Per §10 surprise. Matrix mod 2026-06-01: extended for STT — voice intent classification with confidence threshold + readback for ambiguity.

SYNOPSIS

id intent-classifier tier pink section §7. Pink — Sakura local (65 baseline, 131 post-matrix) trigger event tools (LLM only) source carry-forward

DESCRIPTION

Reads what the operator just said and assigns it to one of four buckets (shop / chat / control / relay). Routes the message to the right model before any expensive call fires. Cheap first, expensive only if needed.

Route the user's message: shop / chat / control / relay. Per §10 surprise. Matrix mod 2026-06-01: extended for STT — voice intent classification with confidence threshold + readback for ambiguity.

MECHANISM

PREfetchGUARDtier: pinkACTperformRESULTrenderON-ERRretry / esc
;;~ title    "Intent classifier"
;;~ author   "lacuna"
;;~ version  1
;;~ mode     automation
;;~ flavor   pink
;;~ id       intent-classifier
;;~ touches  ()
;;~ summary  "Route the user's message: shop / chat / control / relay."

;; Route the user's message: shop / chat / control / relay.
;;
;; Character loop. On-device Sakura only; never escalates to
;; cloud. The cart reads its seed from ctx and surfaces the
;; result back into the conversation via sakura/say or
;; sakura/decide. Calm voice, short, ~30 words.

(cart 'intent-classifier
  '((author    . "lacuna")
    (version   . 1)
    (read-only . #t)))

(define (start ctx)
  (let ((seed (ctx-get 'seed ctx)))
    (if (null? seed)
        (next 'invoke ctx)
        (next 'invoke ctx))))

(define (invoke ctx)
  (let ((seed (ctx-get 'seed ctx)))
    (act 'sakura/decide
         (list 'task 'intent-classifier seed)
         'check-result)))

(define (check-result ctx)
  (let ((r (ctx-result ctx)))
    (cond
      ((null? r)                  (escalate 'sakura-empty null))
      ((eq? r 'rate-limited)      (after 5 'invoke ctx))
      (else                       (next 'announce (ctx-set 'output r ctx))))))

(define (announce ctx) (done))

source: curator-web/src/scheme/carts/etsy/intent-classifier.sks · 41 lines

EXAMPLES

Example forthcoming — docs/automations/examples.json entry editable in place.

TIER

pink
Sakura local 8B · free · on-device

FITNESS

Ready

Fits any shop today — this one has no sample-size floor.

SEE ALSO

HISTORY

canonical source: curator/docs/AUTOMATIONS-CANONICAL.md · §7-pink-sakura-local-65-baseline-131-post-matrix
last regenerated: 2026-06-05 20:31 UTC (mechanical — edits land in the MD or sidecars, not here)

KNOWN BUGS

(none recorded — flag in AUTOMATIONS-CANONICAL.md or open an issue against the cart file)