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.
| Signal | What it captures |
|---|---|
| User query | What the user is asking right now |
| Real-time product events | What the user is actively doing in your product |
| Conversation history | What has already been discussed in this session |
| Knowledge base | Retrieved docs or chunks from your KB (when configured) |
autoplay_sdk.rag_query provides the framework to assemble these signals into a single, structured context block ready for any chat LLM.
This is not
RagPipeline (ingestion β vector store). rag_query is specifically for answering a user message using structured, multi-signal context at query time.What it optimizes for
User query
The current message from the user β the question being answered right now.
Real-time events
What the user is doing in your product at this moment, including optional delta activity since their last chat message via
session_activity_since.Conversation history
Prior turns in the conversation, surfaced via
ChatMemoryProvider.conversation_turns.Knowledge base
Retrieved records from your KB via
KnowledgeBaseRetriever on RagChatProviders when configured. The SDK is vendor-agnostic β swap in Zep, Postgres, Atlas, or any other backend behind the provided protocols.Entry point
system_text bundles all three signals β query, events, and history β into a single prompt your LLM can reason over without additional orchestration.
Delta activity: since last chat message
To give your LLM visibility into product actions that happened after the userβs previous message, persist an inbound watermark per thread and pass its value into assembly.Load the previous inbound timestamp
Before calling
assemble_rag_chat_context, retrieve the watermark from your store:ChatWatermarkScope(conversation_id=..., product_id=...) (plus optional tenant_id) to key threads consistently across your store.
For the store itself:
- Production: implement
InboundWatermarkStorebacked by Redis or SQL. - Development / testing: use the built-in
InMemoryInboundWatermarkStore.
Default prompts
The SDK ships versioned prompt dicts (each withname, description, version, and content fields):
| Prompt | Purpose |
|---|---|
RAG_SYSTEM_PROMPT | Primary system prompt for RAG chat assembly |
REASONING_PROMPT | Guides multi-step reasoning over retrieved context |
RESPONSE_PROMPT | Shapes the final user-facing answer format |
autoplay_sdk.prompts or use the root package re-exports.
Observability
The SDK does not configure logging for you. Enable debug output from the assembly step:| Outcome | Log level | Whatβs emitted |
|---|---|---|
| Success | DEBUG | Structured extra only: product_id, conversation_id, session_id, coarse flags (has_memory, has_kb, has_delta_activity), and character lengths β never full message text or prompt content |
| Failure | WARNING | exc_info=True with the same correlation IDs, then re-raises the original exception (providers are not silently swallowed) |
autoplay_sdk.* namespace, lazy % formatting, and safe extra fields.
See also
RagPipeline
Embedding and upsert from the event stream β the ingestion side of RAG.
ContextStore
enrich(session_id, query) for retrieval queries at the overview level.










