Skip to main content
This feature is coming soon. The endpoint and SDK helper described on this page are not yet available. This page documents the planned interface.

What it is

When you onboard with Autoplay, your product’s golden paths are indexed in Autoplay’s managed vector database. A golden path is a curated sequence of steps that represents the ideal journey a user takes to successfully adopt a feature — for example, the optimal path from sign-up to first meaningful action in your product. Your chatbot can query this knowledge base at inference time to retrieve the most relevant adoption guidance for any question a user asks.

Why it matters

Real-time session data (delivered via the SDK) tells your chatbot what a user is doing right now. The knowledge base tells it what they should be doing — and how to bridge the gap. Together, they give the chatbot two sources of structured context:
SourceWhat it containsHow it’s delivered
Real-time session streamLive UI actions + session summariesActionsPayload / SummaryPayload via SSE or webhook
Knowledge baseGolden paths, feature guides, adoption stepsGET /knowledge-base/{product_id}?query=...

How it fits in the pipeline

User asks: "How do I set up my first dashboard?"

Chatbot retrieves two sources in parallel:
  1. Real-time session context  ←  EventBuffer / RedisEventBuffer
  2. Relevant golden paths      ←  GET /knowledge-base/{product_id}?query=...

Both are injected into the LLM context window

Chatbot answers with structured, product-specific guidance

Endpoint

GET /knowledge-base/{product_id}?query=<text>&top_k=<int>

Path parameters

product_id
string
required
Your product identifier — the same one used for the SSE stream and webhook.

Query parameters

query
string
required
The user’s question or the session context snippet to use as the search vector. The endpoint embeds this text and performs an ANN lookup against your product’s golden paths.
top_k
integer
default:"3"
Number of golden path results to return. Higher values give the LLM more context but consume more tokens.

Authentication

Pass the same Unkey API key used for the SSE stream:
Authorization: Bearer <api_key>

Chatbot integration example

Inject the knowledge base results alongside the live session context in your system prompt:
import httpx
from autoplay_sdk import AsyncConnectorClient, ActionsPayload

CONNECTOR_URL = "https://your-connector.onrender.com"
API_KEY = "unkey_xxxx..."
PRODUCT_ID = "acme-corp"


async def build_context(user_message: str, session_buffer: list[str]) -> str:
    """Fetch golden paths and combine with real-time session context."""
    async with httpx.AsyncClient() as client:
        resp = await client.get(
            f"{CONNECTOR_URL}/knowledge-base/{PRODUCT_ID}",
            params={"query": user_message, "top_k": 3},
            headers={"Authorization": f"Bearer {API_KEY}"},
        )
        resp.raise_for_status()
        kb = resp.json()

    golden_paths = "\n\n".join(
        f"## {r['title']}\n" + "\n".join(f"- {s}" for s in r["steps"])
        for r in kb["results"]
    )

    session_context = "\n".join(session_buffer) if session_buffer else "No session activity yet."

    return f"""
## What the user is doing right now
{session_context}

## Relevant adoption guidance
{golden_paths}
""".strip()


async def answer(user_message: str, session_buffer: list[str]) -> str:
    context = await build_context(user_message, session_buffer)
    # Pass `context` as part of your system prompt to the LLM
    ...

Combining with RedisEventBuffer

For the best results, retrieve the user’s recent session activity from your buffer at the same time as fetching golden paths:
from autoplay_sdk import RedisEventBuffer

buffer = RedisEventBuffer(
    redis_url="redis://...",
    session_id=current_session_id,
)

# Drain the buffer and fetch knowledge base in parallel
session_payloads, kb_response = await asyncio.gather(
    buffer.drain(),
    fetch_knowledge_base(user_message),
)

session_text = "\n".join(p.to_text() for p in session_payloads)

Golden path management

Golden paths for your product are managed through two surfaces: Autoplay Chrome extension (recommended) Record a golden path directly in your product — no manual writing required. Open the extension, start recording, walk through the ideal user journey in your app, then save. The extension captures each step automatically and adds it to your product’s knowledge base. Autoplay dashboard
  • Add and edit golden paths manually for each feature or workflow
  • Edit step descriptions to match your UI terminology
  • Archive paths for deprecated features
  • Preview how paths are retrieved for sample queries
Contact your Autoplay account manager to configure your product’s knowledge base.