Skip to main content

Interactive UI (render_ui)

Myrm ships a declarative UI artifact pipeline: the agent calls render_ui, the server emits a UI_UPDATE SSE event, and the WebUI renders interactive components inline in chat.

Enable the tool

  1. Open Agent settings in chat.
  2. Turn on Interactive UI (render_ui).
  3. On first run with a workspace, the server seeds .agent/docs/A2UI_REFERENCE.md (full props manual).
Turn1 cost is ~223 tokens for the slim tool docstring — full component props are not inlined in the prompt.

A2UI v3.1 behavior

TopicBehavior
Component whitelist23 UIComponentType values (enum SSOT, front + back)
Progressive specSimple UIs (text + field + button) need no extra read; for table / chart / tabs or 3+ components, the agent should file_read_tool .agent/docs/A2UI_REFERENCE.md first
ValidationFail-closed — unknown type, empty components, invalid graph (root_ids/children), or malformed actions return structured tool errors (no silent skip)
User actionsButton / form submissions flow back as UIActionEvent and continue the agent loop

Delivery pipeline (SSE)

Tool execution may run in a LangGraph child asyncio task where ArtifactContext ContextVars are not visible. Myrm stashes UI artifacts by assistant message_id (run-level bind + post_run pop) so UI_UPDATE SSE still reaches the WebUI before MESSAGE_END. Covered by integration wiring tests and a real LLM agent-stream E2E (not mocked on the critical path).

JSON shape (adjacency list)

{
  "title": "Feedback form",
  "components": [
    {"id": "t1", "type": "text", "props": {"text": "Rate this run"}},
    {"id": "f1", "type": "text_field", "props": {"label": "Comment"}, "bindings": {"value": "$.form.comment"}},
    {"id": "b1", "type": "button", "props": {"label": "Submit"}, "events": {"onClick": "submit"}}
  ],
  "root_ids": ["t1", "f1", "b1"],
  "data": {"form": {"comment": ""}},
  "actions": [{"id": "submit", "type": "submit", "label": "Submit"}]
}

vs competitors

ProductIn-chat generative UI
Myrm23 typed components, SSE artifact, progressive spec, fail-closed validation
OpenClaw / Codex / Claude CodeNo first-class in-chat form renderer
CopilotKit AG-UIWeb protocol catalog (~19 basic widgets); no Myrm-style workspace spec seed + enum gate
HermesText suggestions; no structured chat UI artifact
For simple clarifying questions, prefer ask_question_tool instead of building a full UI. See also: Agent configuration — tool loading.