Generative UI

Ragz answers don't have to be plain text. After the model drafts a response, an optional visualize step can emit structured UI blocks alongside it — cards, charts, tables, source references, follow-up chips — so an answer about, say, quarterly numbers can render as an actual table and a chart instead of a wall of prose.

Best-effort, never on the critical path

The visualize step is a constrained, additional model call made after the text answer is already generated. If it's slow, errors, or the global setting is off, the block array is simply empty (null/[]) — it can never delay or break the underlying text answer.

Block types

BlockRenders as
textPlain markdown text.
chartA chart (bar/line/etc. — ChartKind).
info_cardA compact info card.
image_cardA card with an image.
ranked_listAn ordered/ranked list of items.
source_refsClickable source/citation cards.
tag_badgesA row of small status/tag badges.
article_cardA larger card (standard or hero layout) for a document/article.
calloutAn inline admonition within the answer.
tableA GFM-style structured table.
formAn interactive input form (text/select/etc. fields).
follow_upsSuggested follow-up question chips.
stepsA numbered/step-by-step list.
buttonsPrimary/secondary action buttons.
tabsTabbed content panels.
accordionCollapsible expandable sections.
carouselA horizontally scrollable set of items.

Frontend renderers for each block type live under frontend/src/features/chat/blocks/ (e.g. article-card.tsx, source-refs.tsx, accordion.tsx, carousel.tsx, steps.tsx, follow-ups.tsx, form-block.tsx, action-buttons.tsx), dispatched by a single block-renderer.tsx.

The global setting

Rich generative UI (generative_ui_enabled) is a superadmin-wide gate in Admin → Settings, on by default. When on (and a completer model is configured), every eligible chat answer gets a visualize pass; when off, the visualize step is skipped entirely and answers render as plain text with citations — no per-workspace or per-user override.

Web-result images

A second, narrower setting controls whether generative UI can pull in images from web search results:

generative_ui_imagesBehavior
off (default)No image fetch, no image blocks — regardless of web search results.
web_resultsImages already present in the turn's web-search results (when using a provider that returns them, e.g. Tavily) may be surfaced in image_card/article_card blocks.

Images are never fetched and embedded directly — they're served through the same signed, SSRF-guarded image proxy used elsewhere in the app: the model references an image by a short-lived signed ref, and the browser fetches it through the proxy route rather than dialing the original URL (or any attacker-supplied URL) itself.

Configuring

From Admin → Settings → Generative UI:

  1. Toggle Rich generative UI on/off — the global kill switch.
  2. Set Web-result images to off or web_results.
  3. Save — takes effect on the next chat turn.
curl -X PATCH https://your-ragz-host/api/v1/admin/settings/providers \
  -H "Authorization: Bearer $SUPERADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "generative_ui_enabled": true,
    "generative_ui_images": "web_results"
  }'

What it looks like

With generative UI on, a question like "compare our Q1 and Q2 revenue by region" can come back as a short text summary, a table block with the raw numbers, a chart block visualizing the trend, source_refs pointing at the exact document/page each number came from, and a row of follow_ups chips suggesting the next question — all in one turn, all still grounded in your indexed documents.