Documentation Index
Fetch the complete documentation index at: https://developers.autoplay.ai/llms.txt
Use this file to discover all available pages before exploring further.
Available now.
When to fire (shared layer)
- Context — On each tick, build
ProactiveTriggerContextfrom your event buffer, session metadata, and any flags you maintain (URLs, workflow hints, etc.). - Triggers — Implement
ProactiveTrigger(predicate-style or custom) that returns aProactiveTriggerResult(body, optionalreply_option_labels, timings, cooldown metadata) orNone. - Registry — Wrap triggers in
ProactiveTriggerRegistryand callevaluate_first(orevaluate_all) to pick the first firing trigger. - Gate — Before sending, use Agent session states: apply v2 state checks + cooldown gating so you keep one proactive offer at a time and avoid overlap while reactive chat is active.
Why agent states are required (v2)
Treat proactive triggers as state-gated orchestration, not just predicates:thinking— only state where a new proactive offer may be initiated.proactive_assistance— a proactive offer is already shown; do not stack another proactive suggestion.reactive_assistance— user-initiated chat is active; suppress overlapping unsolicited proactive prompts.
Trigger conditions and heuristics
Not every event should fire help — that becomes noise. Encode intent and workflow conditions using your payload and memory (when available) — not ad-hoc URL rules alone — before you evaluate triggers and deliver proactive chat. Examples of situations worth detecting:- Inferred intent is stuck on the same workflow step (no forward progress toward the session goal) for more than 60 seconds
- The user hits failure signals for the same workflow three times in a row (for example validation or integration errors within one adoption flow)
- The user starts a feature workflow they have never completed before (first-time path through that workflow, not “first visit” to a URL)
- Workflow completion for a key journey stays low across attempts — for example stuck in
in_progresswith completion below a threshold while memory shows repeat struggle on that workflow
| Signal | Trigger condition | Example suggestion |
|---|---|---|
| Workflow stall (no progress on inferred goal) | Same workflow step / intent with no forward motion for several actions or minutes | ”It looks like you’re circling this step — want a nudge on what comes next?” |
| User skips a step in the golden path | Off the ideal path | ”Most users connect a data source before creating a dashboard.” |
| User returns after a gap of 3+ days | Resuming an incomplete task | ”Last time you were setting up your first integration — want to pick up where you left off?” |
| User has never completed a key workflow | Adoption gap | ”You haven’t finished exporting a report yet — here’s the short path.” |
User is in in_progress on a workflow | Repeat attempt without crossing completion | ”You got 85% through this last time — the one remaining step is verifying the success message.” |
Choose your trigger path: built-in vs custom
You can implement Step 3 in two ways:Use built-in proactive triggers
Use this path when default patterns are enough and you want quick setup withdefault_proactive_trigger_registry().
- Start with the built-in registry using
default_proactive_trigger_registry(). - Evaluate with
evaluate_first(ctx)on each tick. - State-gate delivery with
can_show_proactive_with_reasonbefore showing UI.
Build a custom proactive trigger
Use this path when you need product-specific workflow logic, custom copy, or domain-specific metadata.- Define a
PredicateProactiveTrigger(or subclassProactiveTriggerfor more complex logic). - Register it in
ProactiveTriggerRegistry(optionally prepending it before built-ins). - Evaluate with
evaluate_first(ctx)on each tick. - State-gate delivery with
can_show_proactive_with_reasonbefore showing UI.
Delivery A: Proactive chat and reply options (SDK)
The SDK is transport-agnostic for detection; you wire a firingProactiveTriggerResult into your delivery layer (chat widget message, in-app chat, toast, etc.). That is the path fully covered by the reference pages.
| Topic | Page |
|---|---|
Types, built-in IDs, connector JSON, user_page_dwell defaults (1 minute + sparse actions) | Proactive triggers |
| End-to-end authoring walkthrough | Authoring proactive triggers |
Agent State v2 (SessionState), FSM gating, idle expiry, snapshots | Agent session states |
context -> registry -> delivery) but enforce that proactive delivery happens only from thinking, with cooldown-aware state transitions.











