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
| Block | Renders as |
|---|---|
text | Plain markdown text. |
chart | A chart (bar/line/etc. — ChartKind). |
info_card | A compact info card. |
image_card | A card with an image. |
ranked_list | An ordered/ranked list of items. |
source_refs | Clickable source/citation cards. |
tag_badges | A row of small status/tag badges. |
article_card | A larger card (standard or hero layout) for a document/article. |
callout | An inline admonition within the answer. |
table | A GFM-style structured table. |
form | An interactive input form (text/select/etc. fields). |
follow_ups | Suggested follow-up question chips. |
steps | A numbered/step-by-step list. |
buttons | Primary/secondary action buttons. |
tabs | Tabbed content panels. |
accordion | Collapsible expandable sections. |
carousel | A 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_images | Behavior |
|---|---|
off (default) | No image fetch, no image blocks — regardless of web search results. |
web_results | Images 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:
- Toggle Rich generative UI on/off — the global kill switch.
- Set Web-result images to
offorweb_results. - 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.