Liminal-State Detection
Infer the human's attentional state (just-woke, focused, winding-down, distracted) from message timing and tone, and adapt response shape so the agent meets the person where they actually are.
Problem
A stateless agent that treats every incoming turn as equal-weight produces the same kind of response at six in the morning after twelve hours of silence as it does mid-afternoon in the middle of a working session. A chirpy 'hi, what can I help with today?' greeting lands as friendly in one moment and grating in another, and the user has no way to convey the difference short of typing it out. The team has to choose between ignoring attentional state and asking the user to keep declaring it, and neither feels right.
Solution
On every incoming user message, compute a small feature set: time-of-day relative to a known anchor, gap since last message, message length and punctuation density, presence of a single emoji or interjection. Map to one of a small mode set ('just-woke', 'focused', 'winding-down', 'distracted', 'present'). Adjust response shape: shorter on winding-down; one anchor surface on just-woke; deeper engagement on focused; hold on distracted. Make the mode visible in agent telemetry so it can be tuned.
When to use
- The agent converses with the same user across very different attentional contexts (just-woke, focused, winding-down).
- Reply shape can be adapted (length, density, tone) without losing the answer's substance.
- Inference signals (timing, tone, message length, time of day) are reliable enough to drive adaptation.
Open the full interactive page →
Diagram, neighbourhood map, code examples, related patterns and full provenance.