The canonical changelog for releases and PyPI sdists also lives in the repository asDocumentation Index
Fetch the complete documentation index at: https://developers.autoplay.ai/llms.txt
Use this file to discover all available pages before exploring further.
CHANGELOG.md. This page mirrors that file for the documentation site, with links pointed at these docs.
[0.7.3] โ 2026-05-14
Documentation
- Added dedicated references for
UserSessionIndex,compose_chat_pipeline(...), andbuild_copilot_app(...), including lifecycle details, endpoint status semantics, and failure troubleshooting. - Updated Logging with explicit observability guidance for
autoplay_sdk.chat_pipeline,autoplay_sdk.user_index, andautoplay_sdk.serve.fastapi, including recommended app-layer log points for self-hosted bridges. - Added a clearer self-hosted quick-reference and troubleshooting section in
README.md(repository package docs), covering primitive selection and common404/identity/product-scope failure modes.
[0.7.2] โ 2026-05-14
Removed
TourDefinition.labelandTourDefinition.user_tour_existsโ these fields belong toproactive_intercom.messages, not the tour registry. Removed from the dataclass,to_dict, andfrom_dict. Legacy configs that still include these keys are silently ignored on parse.
Added
TOUR_OFFER_QUICK_REPLY_BODYโ constant ("Would you like me to show you?"); default body for the tour-offer Yes/No quick reply.tour_offer_quick_reply_body(integration_config)โ single SDK source-of-truth for the tour-offer message body; readsintegration_config.tour_offer_bodyfor product-level overrides, falls back to the constant. Call this afterresolve_tour_offer_for_inboundreturns a non-Noneflow id. Both symbols exported fromautoplay_sdk.proactive_triggers.
[0.7.1] โ 2026-05-13
Added
autoplay_sdk.install_skillsโ CLI commandautoplay-install-skillsthat copies bundled Cursor/Claude agent skills into the current project. Supports--chatbotand--user-activityflags.autoplay_sdk/skills/โ 10 agent skill files shipped inside the wheel:autoplay-core,chatbot-ada,chatbot-intercom,chatbot-botpress,chatbot-dify,chatbot-crisp,chatbot-landbot,chatbot-tidio,activity-fullstory,activity-posthog.
Documentation
- Ada tutorial (
docs/recipes/ada/), FullStory Streams tutorial (docs/recipes/fullstory/how-to-setup.mdx), and quickstartautoplay-install-skillstip block.
[0.7.0] โ 2026-05-12
Added
autoplay_sdk.agent_state_v2โSessionStateFSM withTHINKING/PROACTIVE/REACTIVEstates, timeout-only exit rules, andInvalidTransitionError. Coexists with v1AgentStateMachine.autoplay_sdk.proactive_triggers.trigger_configโProactiveTriggerConfig,TriggerMessage, and recursiveProactiveCriteriafor config-driven proactive triggers.autoplay_sdk.proactive_triggers.tour_registryโTourDefinitionandTourRegistry; per-tourinteraction_timeout_s/cooldown_period_soverrides;get_by_user_tour_id().SessionState.record_tour_step(),SessionState.set_visual_guidance(),SessionState.tick(tour_registry=None).parse_tour_registry(integration_config, product_id)helper inproactive_intercom_config.
Changed
integration_config.proactive_intercomโ now a list ofProactiveTriggerConfigobjects (was a single dict).TriggerMessageโ renamedoffers_tourโuser_tour_exists,flow_idโuser_tour_id; backward-compatible properties retained.
Documentation
- Intercom proactive triggers step 2, Agent session states โ agent state v2 accordion.
[0.6.8] โ 2026-05-05
- SDK branch release tag/version for current branch cut.
AgentStateMachine.enter_reactive_from_user_messagedocs + behavior notes now include rejection logging and preservedInvalidTransitionErrorsemantics.
[0.6.7] โ 2026-04-30
Agent FSM, Intercom proactivequick_reply, autoplay_sdk.proactive_triggers (replaces integrations.proactive), registry timings/entity, context builders, scope validation, product-scoped context-store buckets, and proactive idle teardown for chat: run_proactive_idle_expiry, ProactiveIdleExpiryHooks, ProactiveIdleExpiryResult, Intercom DELETE /conversations/{id} helpers (build_intercom_delete_conversation_request, etc.).
For full Added / Changed / Breaking detail, see the same version in the repository CHANGELOG.md.
Removed
autoplay_sdk.integrations.proactiveโ useautoplay_sdk.proactive_triggers(importpaths and submodules mirror the old layout).
Added
autoplay_sdk.agent_statesโAgentState,AgentStateMachine,TaskProgress,SessionMetrics,InvalidTransitionError,InvalidSnapshotError; five-state FSM;transition_on_disengagement();to_snapshot()/from_snapshot();can_show_proactive_with_reason().autoplay_sdk.agent_states.AgentStateMachineโexpire_proactive_to_thinking_if_idle.autoplay_sdk.integrations.intercomโquick_replyhelpers,INTERCOM_PROACTIVE_QUICK_REPLY_DEFAULT_BODY,proactive_trigger_canonical_url_ping_pong, connector helpers forPOST /intercom/proactive/{product_id},IntercomProactivePolicyConfig.autoplay_sdk.proactive_triggersโProactiveTriggerContext,ProactiveTriggerResult, registry,CanonicalPingPongTrigger,default_proactive_trigger_registry, timings (ProactiveTriggerTimings,ProactiveTriggerEntity,interaction_timeout_s,cooldown_s).autoplay_sdk.proactive_triggers.defaultsโProactiveTriggerIds,get_proactive_trigger_ids(),DEFAULT_PROACTIVE_QUICK_REPLY_BODY.PredicateProactiveTrigger;from_actions_payloads/from_slim_actions;DEFAULT_PROACTIVE_CONTEXT_*exports;scope(ScopePolicy, validation helpers);validate_scope(require_conversation).autoplay_sdk.context_storeโactions_bucket_id, optionalproduct_idonget,enrich,reset; composite_actionskeys whenActionsPayload.product_idis set.
Changed
autoplay_sdk.integrations.intercomโINTERCOM_PROACTIVE_QUICK_REPLY_DEFAULT_BODYaliasesproactive_triggers.defaults.ProactiveTriggerContextโ optionalrecent_actions, summaries,context_extra.from_slim_actions/from_actions_payloadsโ defaultscope_policy=STRICT(useLENIENTto relax).POST /intercom/proactive/{product_id}documented as always-on when authenticated (ENABLE_INTERCOM_PROACTIVE_PROMPTSremoved).
Documentation
Breaking changes
expire_proactive_to_thinking_if_idleโ returnsProactiveIdleExpiryResult(useif result:/result.transitioned, notis Trueon the return value). SeeCHANGELOG.md.- Migrate imports from
autoplay_sdk.integrations.proactivetoautoplay_sdk.proactive_triggers. - Strict scope defaults;
LENIENTfor old permissive behaviour. - Match
product_idon context-store reads when payloads carryproduct_id.
[0.6.6] โ 2026-04-23
Added
-
SlimAction/ActionsPayloadโ optionalconversation_id(Intercom thread when linked); merge semantics unchanged at batch level. -
autoplay_sdk.rag_queryโ query-time RAG assembly (assemble_rag_chat_context, providers,ChatContextAssembly, formatters). -
autoplay_sdk.promptsโ versioned Adoption Copilot defaults (RAG_SYSTEM_PROMPT,REASONING_PROMPT,RESPONSE_PROMPT). -
autoplay_sdk.rag_query.watermarkโ delta activity watermarks for Intercom / connector chat. -
autoplay_sdk.prompts.intercom_readabilityโ sharedINTERCOM_READABILITY_RULESfragment for Messenger replies.
Changed
-
Root
__all__documents query-time RAG vs ingestionRagPipeline. -
RAG_SYSTEM_PROMPT/RESPONSE_PROMPT(1.2) and connectorINTERCOM_CHAT_PROMPT(5) โ readability + guidance framing for product how-to questions. -
assemble_rag_chat_contextโ structured DEBUG / WARNING logging.
Documentation
- Chatbot context assembly โ delta activity and observability cross-links.
Breaking changes
None for JSON consumers โ new fields remain optional.[0.6.4] โ 2026-04-23
Added
-
SlimActionโ optional per-actionsession_id,user_id, andemail(aligned with batch-level payload identity). Present on each entry inactionsfor SSE, push webhooks, and typed parsing. -
RedisEventBufferโ serialized JSON now includes those fields per action so buffered events round-trip cleanly.
Documentation
- Payload schema and Typed payloads โ document per-action identity fields; payload schema clarifies shared shape for SSE and push webhooks.
Breaking changes
None โ new fields are optional (None when omitted).
[0.6.2] โ 2026-04-16
Added
POST /productsterminal feedback โ TTY-only Rich stderr spinner and stdout success/failure lines inpost_register_product_payload; no output when stdout is not a TTY.
Changed
run_product_onboardingโ singlePOST /products; connector performs Redis + Render when configured.render_sync_performedreflects connectordual_writein the JSON response.unkey.pyis now a default dependency โ plainpip install autoplay-sdkincludes operator onboarding (autoplay_sdk.admin/ Unkey).
Removed
autoplay-sdk[admin]extra โ installautoplay-sdkonly.
[0.6.1] โ 2026-04-14
Added
ConversationEvent(autoplay_sdk.chatbot) โ dataclass for chatbot session-link webhooks.BaseChatbotWritersession-link webhook flow โSESSION_LINK_WEBHOOK_TOPICS,extract_conversation_event(),_parse_session_link_webhook_payload()(subclasses override parse only).autoplay_sdk.integrations.intercomโ webhook topic constants,intercom_chatbot_webhook_url(), optionalformat_reactive_session_link_script(no logging from this subpackage).
Removed
format_proactive_session_start_scriptand the proactive/sessions/startsnippet โ use Intercom webhooks toPOST /chatbot-webhook/{product_id}; optionalformat_reactive_session_link_scriptremains forPOST /sessions/link.
Documentation
- Logging โ logger hierarchy, app-owned
loggingconfiguration, third-party subclass guidance, changelog cross-link. - README โ logging section aligned with the above; metrics pointer (
SdkMetricsHook). - Intercom integration โ SDK helpers and connector mapping (webhooks, optional snippet, inbox UX).
Breaking changes
format_proactive_session_start_scriptremoved fromautoplay_sdk.integrations.intercom.
Deprecations
None.[0.6.0] โ 2026-04-13
Documentation
-
BaseChatbotWriter โ Note body format โ BaseChatbotWriter now documents the full plain-text contract for
_post_notebodies (header viaformat_chatbot_note_header, sorted 1-based action lines, binning vs post-link, empty list, summary notes)._format_notedocstring points to that page as the single source of truth. -
Logging โ New Logging reference page (module loggers,
%formatting,exc_info, structuredextra, secrets guidance including HTTP bodies, common logging mistakes). Quickstart links to it for discoverability.
Bug fixes / observability
-
BaseChatbotWriterโ pre-link flush failurewarningnow includes structuredextra(session_id,product_id,conversation_id). -
BaseChatbotWriterโ post-link debounced flush: if_post_notereturns no part id after the debounce buffer was popped, logs awarningwith the sameextrashape and explains that this flush is not retried automatically.
Breaking changes
None.Deprecations
None.[0.5.0] โ 2026-04-10
New features
-
ActionsPayload.merge(payloads)โ class method that merges a non-empty list ofActionsPayloadobjects for the same session into one. Actions are concatenated and re-indexed from0;user_id/emailresolved from the first non-Nonevalue;forwarded_atset to the latest timestamp. RaisesValueErroron empty input. -
AsyncAgentContextWriter(debounce_ms=N)โ new optional constructor parameter for a per-session trailing-edge accumulation window. When> 0, multipleadd()calls arriving within the window are merged viaActionsPayload.merge()beforewrite_actionsis called, reducing destination API calls during event bursts. Default is0(no debounce โ existing behaviour unchanged). -
BaseChatbotWriter(autoplay_sdk.chatbot) โ new public base class providing the complete pre-link/post-link delivery policy for building chatbot destinations. Subclass it and implement_post_noteand_redact_part; pre-link buffering (sliding window), at-link flush (binned note), and post-link debouncing are all included.IntercomChatbotin the event connector already extends this class.
Breaking changes
None. All changes are additive:AsyncAgentContextWriter.__init__gainsdebounce_ms: int = 0โ existing code passing positional or keyword arguments is unaffected.ActionsPayload.merge()is a new class method; no existing method is renamed or removed.BaseChatbotWriteris a new public export; no existing symbols are removed.
Deprecations
None.Bug fixes / error handling improvements
-
BaseChatbotWriter.on_session_linkedโ now no-ops when the sameconversation_idis passed again (idempotent guard). The product worker includes the conv_id on every batch for already-linked sessions; without this guard, each batch would cancel the in-flight 150ms post-link debounce task and restart the window, causing notes to be delayed indefinitely during fast user interactions. -
BaseChatbotWriter.on_session_linkedโ pre-link buffer (_pending) is now only cleared after_post_noteconfirms success (returns a non-Nonepart id). Previously the buffer was popped before the API call; a transient Intercom failure would permanently lose those events. On failure the buffer is now preserved and the_conv_mapentry is rolled back so the nexton_session_linkedcall retries automatically. -
BaseChatbotWriter.write_actions: the post-link debounceasyncio.Tasknow has adone_callbackthat logs any unhandled exception atERRORlevel with structuredextra(previously silent โ Python only emitted aDEBUG-level โTask exception was never retrievedโ). -
AsyncAgentContextWriter._flush_sessiondone-callback: now includesproduct_idin the log message andextradict for structured log filtering.
Migration notes
AsyncAgentContextWriter + BaseChatbotWriter โ avoid double-debouncing
BaseChatbotWriter already coalesces rapid write_actions() calls via its post_link_debounce_s window (default 150 ms). When wiring an AsyncAgentContextWriter to a BaseChatbotWriter subclass, keep debounce_ms=0 (the default):
debounce_ms > 0 only when write_actions points to a raw destination with no internal coalescing (e.g. a direct Zendesk or Salesforce API call).
[0.4.0] โ 2026-04-09
Bug fixes
- Fixed TOCTOU race in
RedisEventBuffer._get_redis(): concurrent callers could each create their own connection pool; now serialised withasyncio.Lockand double-checked locking. - Fixed
AsyncSessionSummarizer.flush()cancellation safety: replaced sequentialfor q in queues: await q.join()withasyncio.gather(*[asyncio.shield(q.join()) for q in queues])so all queues are drained even when the caller is cancelled.
Other
- Added
CHANGELOG.mdto document breaking changes and new features going forward.
[0.3.0] โ 2026-04-09
Breaking changes
AsyncSessionSummarizer.get_context(session_id)is nowasyncโ callers mustawaitit.AsyncSessionSummarizer.reset(session_id)is nowasyncโ callers mustawaitit.AsyncSessionSummarizer.active_sessionsis now anasyncproperty โ callers mustawaitit.AsyncSessionSummarizer.add()now returns immediately โ the LLM call is dispatched to a background worker queue rather than awaited inline. Code that relied on the LLM having completed by the timeawait add()returned must callawait summarizer.flush()before inspecting state.
New features
AsyncSessionSummarizer.flush()โ waits for all queued payloads to be fully processed; cancellation-safe viaasyncio.gather+asyncio.shield.SdkMetricsHookprotocol (autoplay_sdk.metrics) โ a@runtime_checkable Protocolthat customers can implement to receive Prometheus / Datadog / OTEL counters for: dropped events, summarizer latency, Redis operation latency, queue depth, and semaphore timeouts.metrics=constructor parameter onConnectorClient,AsyncConnectorClient,AsyncSessionSummarizer, andRedisEventBuffer.initial_backoff_s,max_backoff_s,max_retriesconstructor parameters on both SSE clients โ exposes and documents the reconnect policy with configurable jitter-backed exponential backoff.- Per-session ordering guarantee in
AsyncSessionSummarizerโ each session now has its ownasyncio.Queue+ backgroundasyncio.Taskworker, ensuring that concurrentadd()calls for the same session are always processed in arrival order, even if an earlier LLM call fails. py.typedmarker โ the package is now PEP 561-compliant; static type-checkers will find type stubs automatically.
Bug fixes (v0.2.x โ v0.3.0)
The following 24 items were addressed across two audit passes: Concurrency & correctness- Fixed
AsyncSessionSummarizerordering bug: concurrent adds during an LLM failure could produce out-of-orderon_summarycallbacks (replaced single lock with per-session queue). - Fixed TOCTOU race in
RedisEventBuffer._get_redis(): concurrent callers could each create their own connection pool; now serialised withasyncio.Lockand double-checked locking. - Replaced
asyncio.Semaphore._value(private API, breaks across CPython minor versions) with an explicit_TrackedSemaphorecounter. - Replaced
asyncio.get_event_loop()(deprecated) withasyncio.get_running_loop()inapp.pyandasync_client.py. - Replaced
asyncio.ensure_future()withloop.create_task()inasync_client.py. - Added
done_callbackon fire-and-forgetasyncio.Tasks to log unhandled exceptions instead of silently swallowing them.
RedisEventBuffer._payload_from_json()now wrapsjson.loadsintry/except json.JSONDecodeError; corrupt ZSET members no longer crash the drain loop.ConnectorClientnow setsself._running = FalseonKeyboardInterruptso callers can inspect the state after shutdown.- All
exceptclauses that were swallowing exceptions now passexc_info=Trueto the logger so tracebacks appear in structured logs.
RedisEventBufferZSET members now carry a unique UUID prefix, preventing silent deduplication when two events arrive at the same millisecond timestamp.SessionSummarizernow deletes_history[session_id]and_counts[session_id]after summarisation to prevent unbounded memory growth.AsyncConnectorClient._session_semaphoreschanged from plaindicttocollections.OrderedDictwith LRU eviction to cap memory when many short-lived sessions are processed.
- Extracted
LazyRedisClienthelper (storage/_redis.py) so all storage modules share one lazily-initialised, thread-safe Redis client instead of each implementing the same racy pattern. session_storenow usesLazyRedisClientand exposes aSessionState.from_redis_link()classmethod that owns the full reconstruction logic (preventing silent field omissions on restore).SessionStategains anerror: Optional[str]field to surface last-known error reason through the API.
- Replaced custom
_JsonFormatterinapp.pythat ignoredextra={}fields with a correct implementation that merges them into the JSON line. - All structured log calls now use
extra={}dicts consistently. - Metrics instrumentation added at every observability-relevant site: event drops, queue depth, semaphore timeouts, summarizer latency, Redis add/drain latency.
- Added
__all__exports to__init__.pysofrom autoplay_sdk import *is well-defined. - Added
__version__ = "0.3.0"to__init__.py. - Added
py.typedmarker for PEP 561 compliance. - Removed dead
_dropped_count/_total_countmetrics fields that were incremented but never surfaced. - Standardised public API:
on_dropcallback signature is now consistent acrossConnectorClient,AsyncConnectorClient, andRedisEventBuffer.











