Day 3:Generative UI — Agentic Component Cards & HITL Action Pills
Battle-tested daily lesson note • 100% runnable code, interview Q&A, test suite & interactive quiz
Day 3: Generative UI — Agentic Component Cards & HITL Action Pills
1. First-Principles: Beyond Plain Markdown to Generative UI
A text-only chatbot that dumps raw JSON or markdown tables forces the user to manually copy-paste terminal commands.
In Generative UI (Component Streaming), the backend streams structured UI component definitions alongside text:
2. Interactive Human-in-the-Loop (HITL) Action Card
When an agent proposes a high-risk operation (e.g. scaling a production database or restarting pods), the UI renders an actionable card rather than plain text:
Component Payload Schema:
{
"component": "hitl_action_card",
"data": {
"action_id": "act_99182",
"service": "checkout-api",
"proposed_command": "kubectl scale deployment/checkout --replicas=8 -n prod",
"rollback_command": "kubectl scale deployment/checkout --replicas=3 -n prod",
"risk_level": "MEDIUM",
"status": "PENDING_APPROVAL"
}
}
The browser renders interactive "Approve" and "Reject" buttons that immediately dispatch a signed action callback to the backend checkpointer, seamlessly resuming the paused state graph!
In Simple English: Generative UI (Rich Interactive Cards Inside Chat)
Plain text walls are outdated in 2026–2027 AI products! When your AI inspects an incident or flight option:
- Instead of printing raw YAML, the backend streams typed Component Cards (
ui_cardevents: e.g. Cost Breakdown Chart, Runbook Step Checklist, or Approve / Reject HITL Action Pill) directly inside the chat thread! - Clicking [Approve Restart] triggers a strict verified API endpoint — keeping AI suggestions safe and human-approved!