When a user sends a message in Chat, an agent does not have to reply with plain text alone. Using A2UI surfaces (a2ui_surface / send_a2ui_messages) or UI component blocks (aiui.*), agents can stream rich interactive UI directly into the chat thread or split Canvas.
a2ui_surface
send_a2ui_messages
aiui.*
Every example below shows the user prompt, a live interactive simulation you can click and test right here, and the code / A2UI JSON that produces it.
User sends: "Show today's system health and active traffic."
"Show today's system health and active traffic."
<ComponentPreview title="Agent Response — KPI Dashboard">
[
{
"type": "stat_group",
"stats": [
{"type": "metric", "label": "Active Sessions", "value": "1,420", "delta": "+12.4%", "sparkline": [980, 1080, 1210, 1340, 1420]},
{"type": "metric", "label": "P95 Latency", "value": "118 ms", "delta": "-14 ms", "sparkline": [148, 138, 130, 122, 118]},
{"type": "metric", "label": "Success Rate", "value": "99.94%", "delta": "+0.08%"}
]
},
{"type": "alert", "variant": "success", "title": "All Systems Operational", "message": "4 worker pools healthy across us-east and eu-west."}
</ComponentPreview>
<Tabs>
<Tab title="A2UI v0.9 JSON">
</Tab>
<Tab title="Python">
</Tabs>
User sends: "Let me configure my research agent's model, temperature, and memory."
"Let me configure my research agent's model, temperature, and memory."
<ComponentPreview title="Agent Response — Interactive Configuration Form (try submitting)">
"type": "form_action",
"action": "save_agent_config",
"submit_label": "Apply Settings",
"children": [
{"type": "select_input", "label": "Model", "options": ["gpt-4o", "gpt-4o-mini", "claude-3.7-sonnet", "gemini-2.5-flash"], "value": "gpt-4o", "name": "model"},
{"type": "slider_input", "label": "Temperature", "value": 0.3, "min_val": 0, "max_val": 1, "step": 0.1, "name": "temperature"},
{"type": "switch_input", "label": "Enable cross-session memory", "checked": true, "name": "memory"}
}
<Tab title="A2UI v0.9 (Python)">
<Tab title="Action Handler">
User sends: "Deploy release v0.4.0 to production and scale to 4 replicas."
"Deploy release v0.4.0 to production and scale to 4 replicas."
<ComponentPreview title="Agent Response — HITL Approval Gate (click Approve or Deny)">
{"type": "callout", "variant": "warning", "title": "Human Approval Required", "content": "Paused before calling deploy_release (high risk). A live alert was also pushed to the Notification Center."},
deploy_release
{"type": "diff_viewer", "title": "deploy.yaml", "before_label": "Production", "after_label": "Proposed", "before": "release: v0.3.183\nreplicas: 2", "after": "release: v0.4.0\nreplicas: 4"},
{"type": "button_group", "buttons": [
{"label": "Approve & Deploy", "action": "approve_deploy", "variant": "primary"},
{"label": "Deny", "action": "deny_deploy", "variant": "destructive"}
]}
See the full runnable combined dashboard in 34-hitl-approvals-and-notifications.
User sends: "Compare weekly agent runs and show per-agent stats."
"Compare weekly agent runs and show per-agent stats."
<ComponentPreview title="Agent Response — Analytics Chart & Table">
"type": "chart",
"title": "Weekly Agent Runs",
"chart_type": "bar",
"x": "day",
"y": ["runs"],
"height": 200,
"data": [
{"day": "Mon", "runs": 140},
{"day": "Tue", "runs": 210},
{"day": "Wed", "runs": 265},
{"day": "Thu", "runs": 230},
{"day": "Fri", "runs": 310}
"type": "table",
"headers": ["Agent", "Model", "Runs", "Avg Latency"],
"rows": [
["Researcher", "gpt-4o", 412, "118 ms"],
["Code Reviewer", "claude-3.7-sonnet", 295, "194 ms"],
["Docs Helper", "gpt-4o-mini", 448, "76 ms"]
],
"searchable": true,
"sortable": true
User sends: "Show my RAG ingestion pipeline status and indexed files."
"Show my RAG ingestion pipeline status and indexed files."
<ComponentPreview title="Agent Response — Pipeline Status & Source Tree">
"type": "stepper",
"title": "RAG Ingestion Pipeline",
"active": 2,
"orientation": "horizontal",
"steps": [
{"label": "Fetch Docs", "description": "176 files"},
{"label": "Chunk & Embed", "description": "1,420 vectors"},
{"label": "Verify Recall", "description": "Running evals"},
{"label": "Live Index", "description": "Pending"}
"type": "tree_view",
"title": "Indexed Sources",
"default_expanded": true,
"nodes": [
{"label": "docs/a2ui/", "children": [{"label": "overview.md", "meta": "3.1 KB"}, {"label": "response-examples.md", "meta": "Live"}]},
{"label": "docs/components/", "children": [{"label": "card.md", "meta": "1.6 KB"}, {"label": "chart.md", "meta": "2.4 KB"}]}
User sends: "Generate my quick-install command and staging webhook token."
"Generate my quick-install command and staging webhook token."
<ComponentPreview title="Agent Response — Copyable Outputs & Star Rating">
{"type": "copy_field", "label": "Run A2UI Studio Example", "value": "cd examples/python/30-a2ui-canvas && python app.py", "secret": false},
{"type": "copy_field", "label": "Staging Webhook Token", "value": "aiui_stg_7d9e2c1a4b6f8e0d", "secret": true},
{"type": "rating_input", "label": "Was this response helpful?", "value": 5, "max_stars": 5, "readonly": false, "name": "feedback_rating"}
Open http://127.0.0.1:8099 to try split Chat + Canvas, full-page multi-surface Canvas, Agent Canvas, and A2UI Settings & Catalog side by side.
http://127.0.0.1:8099