B Blengi docs

Build your agent

Playground (platform admins)

Diese Seite ist noch nicht auf Deutsch verfügbar, daher lesen Sie sie auf Englisch.

Platform administrators only. Customers test their agent with the live preview — the real widget, on the Appearance and Personality tabs and floating on every other page of the agent. The Playground at /app/agents/{id}/playground is the diagnostic twin: a separate chat that also shows which pages were retrieved, how confident the reranker was, and the exact prompt the model received. It was hidden from customers because a second chat that looks like the widget but is not one confused more than it helped. Conversations here are flagged is_playground and never count toward the billing meter, conversation counts, or Leads.

What you can test

  • Site type — switch between ecommerce, saas, documentation, help_center, marketing, internal_kb, or generic without mutating the agent's persisted column. Useful for "what would my agent say if treated as ecommerce vs documentation?".
  • Page context — paste a URL and metadata (title, description, og tags, JSON-LD, h1/h2, visible body text) so the agent answers as if the visitor were on a specific page. Six ready-made templates (Shopify product, SaaS pricing, Docusaurus docs, help-center article, marketing landing, blank) cover the common shapes.
  • Reply language — pick any locale the workspace ships translations for (132 by default, auto-discovered from lang/*.json). Useful for sanity-checking that the agent answers in the right language and that RTL scripts mirror.
  • Sample prompts — buyer-realistic test prompts per vertical (5–6 chips per site type) so you can fire a typical question with one click.
  • Compare mode — toggle to split the chat into two columns and run the same question against two different site types side-by-side. The differentiator for picking the right vertical.

Right-pane tabs

Scenario

Site type override + reply language + sample prompts. The capability badges below the site-type select show which rich blocks (product_card, pricing_card, case_study_card, escalation_button) the selected vertical can emit.

Note: not every capability has a widget renderer yet. Today the widget's RENDERABLE set in resources/widget/src/core/capabilities.ts only whitelists ticket_escalation (the escalation_button block). Other blocks (product_card, pricing_card, case_study_card) are emitted by the server when the LLM asks for them, but the public widget will silently drop them until their renderer is added to the RENDERABLE set + a Preact component in ui/blocks.tsx. The Playground previews them because it ships every renderer for design purposes — what you see in Playground may be richer than what your visitors see in the live widget.

Page context

Form-driven editor for the page_context the visitor would send. Use the Use template dropdown to drop in a realistic Shopify product page or Stripe pricing page, then tweak the URL / title / og fields. JSON-LD accepts pasted JSON.

Diagnostics

Read-only inspection of the last turn:

  • Latency — first-token and total time.
  • Confidence — how closely the knowledge base matched the question: the best pre-boost retrieval score, 0.3 when nothing was retrieved (no page-snapshot floor).
  • Retrieved sources — top-k chunks with both ANN and rerank scores plus a snippet, ordered as the LLM saw them. Each is labelled when it is a product record (Catalog record, Register record) or a product, category or policy page, and the line above the list shows what was searched for — a follow-up question searches with its subject restored, as on the widget.
  • Tool calls — every server-side tool fired during the turn, with arguments.
  • Inline blocks — count and types of rich blocks the LLM emitted (e.g. product_card).
  • System prompt — the full system message used, including the vertical fragment and any custom system prompt. Click to expand.

The answer is built exactly as the widget builds it: the same search query, the product records a turn brings along (the product register and the product catalog, including the record of a product the visitor names when nothing else matched), the register's product list on a turn that found nothing, the owner's sales arguments on a price objection, and the page kinds in the prompt. Before, the Playground skipped all of these, so a strict shop could refuse here while answering on the widget.

Endpoints

All three are session-authenticated and scoped by AgentPolicy::update:

  • GET /app/agents/{agent}/playground — Inertia render with the verticals preview map keyed by slug.
  • POST /app/agents/{agent}/playground/stream — SSE stream. Body: {message, conversation_id?, site_type_override?, language_override?, page_context?}. Emits start, retrieval, prompt, token, block, tool_call, done events.
  • POST /app/agents/{agent}/playground/reset — clears the cached conversation history. Body: {conversation_id}.

Notes

  • Playground turns reuse the same Redis history key as production widget conversations. Reset is the explicit way to start from an empty context — closing the tab leaves history in place for two hours.
  • Site-type and language overrides do not mutate the agent's persisted columns. Once you've found the combination that works, head to Advanced › Type of website of the AI employee to save it.
  • Page-context payloads are sanitized server-side identically to the visitor widget — same key allow-list, same 8 KB cap, same canonical-URL collapse.