Skip to content

Dynamic UI Generation AI Assistants

Spinning Idea edited this page Oct 15, 2026 · 1 revision

Dynamic UI Generation AI Assistants

Generative UI is when an AI agent produces the interface itself at runtime, not just text. Ask "plan a day in San Francisco" and instead of a paragraph you get an interactive map, photos, and an editable itinerary. ChatGPT's apps/widgets, Claude's artifacts, and Perplexity's answer cards are all versions of this — the libraries below let you build the same thing in your own app.

How it works

Almost every approach follows the same loop:

  1. Register a component catalog — you define which components the model is allowed to use, usually with a schema for the props (Zod, JSON Schema, or a custom format like Hashbrown's Skillet).
  2. The schema becomes tool/prompt definitions — the catalog is handed to the LLM as tools or embedded in the system prompt.
  3. The model emits a UI spec — either a tool call (render(Graph, {data})) or a stream of structured markup (OpenUI Lang, A2UI trees, MCP-UI resources).
  4. The client renders progressively — props stream in as tokens arrive, so the UI builds live rather than popping in at the end.

The key difference between solutions is how much freedom the model gets:

  • Controlled — the agent picks a component from your catalog and fills in props. Safest; your design system stays intact.
  • Declarative — the agent composes a UI tree from primitives you define; the app validates and mounts it. More layout freedom, still constrained.
  • Open-ended — the agent emits arbitrary HTML/JS (usually sandboxed in an iframe, e.g. MCP Apps). Maximum freedom, hardest to style and secure.

Frameworks & SDKs

  • https://github.com/thesysdev/open-intelligent-ui — open-source take on ChatGPT's "Intelligent UI" (~388★). A working Next.js demo where answers stream as interactive UI (maps via MapLibre, photos, charts, working tools). Best starting point to see the pattern end to end. Built on OpenUI; needs an OpenAI-compatible API key.
  • https://github.com/thesysdev/openui — the framework underneath it. OpenUI Lang is a compact, streaming-first markup language that uses up to ~67% fewer tokens than JSON specs. Framework-agnostic core with React/Vue/Svelte/Angular runtimes; ships component libraries (charts, forms, tables) and generates the model's prompt from your allowed components automatically.
  • https://github.com/vercel-labs/json-render — "The Generative UI framework" (~18.7k★, Apache-2.0). Model emits JSON constrained to a catalog you define — guardrailed and predictable by design. Renderers for React, Vue, Svelte, Solid, React Native, and React Three Fiber (3D scenes!). Ships a ready-made 36-component shadcn/ui catalog (@json-render/shadcn), so you get a real component library for free.
  • https://github.com/tambo-ai/tambo — generative UI SDK for React (~11.2k★, MIT). Register components with Zod schemas — they become tool definitions, and the agent picks one and streams props into it. Unlike pure renderers it's full-stack: runs the conversation loop, thread state, and MCP tools for you (hosted cloud or self-hosted via Docker). Supports "interactable" components that persist and update as the user refines.
  • https://github.com/liveloveapp/hashbrown — headless TypeScript framework for React and Angular (~728★). No shipped chat UI — you keep your own design system and exposeComponent() the pieces the model may render. Skillet is its LLM-optimized streaming schema language (accepts Zod/Standard Schema too). Client-side tools run in the browser with your app's state; works with OpenAI, Anthropic, Gemini, Bedrock, Azure, or Ollama.
  • https://github.com/CopilotKit/CopilotKit — frontend stack for agents & generative UI (~38k★, MIT). useCopilotAction lets an agent render your components via tool calls; also supports "agentic generative UI" (rendering intermediate agent state like progress) and shared state sync. Makers of AG-UI, so it talks to LangGraph/Mastra/Pydantic AI backends out of the box.
  • https://github.com/assistant-ui/assistant-ui — React chat UI library (~12.6k★, MIT, shadcn/Radix-style components). Not a generative UI engine itself, but its tool-UI mechanism attaches a component to each tool call so results render inline in the thread — the quickest way to get the pattern if you already use shadcn.
  • https://github.com/vercel/ai — Vercel AI SDK. streamUI/tool-call rendering is the OG generative UI pattern on Next.js + React Server Components. Lower-level than the dedicated frameworks — you wire the catalog yourself — but minimal dependencies if you're already on the SDK.
  • https://github.com/wandb/openui — different project, same name (~22.6k★, Apache-2.0). Describe a UI in plain English and get rendered HTML/Tailwind live — more "AI builds a mockup" than embedded generative UI. Useful for prototyping, not for agent answers inside an app.

Protocols & Specs

These aren't renderers — they're the wire formats/conventions the renderers and hosts converge on:

  • https://github.com/ag-ui-protocol/ag-ui — AG-UI (~16.6k★): event-based agent↔user interaction protocol. Carries agent state, tool calls, and UI intents to frontends over HTTP/SSE/WebSocket; adopted by LangGraph, Mastra, Pydantic AI, Microsoft Agent Framework, etc. Note: it's the interaction layer — pair it with a generative UI spec below for the actual rendering.
  • https://github.com/a2ui-project/a2ui — A2UI (~16.7k★, Google-originated): declarative generative UI spec. Agents propose JSON UI trees/widgets; your app validates against a catalog and mounts them. Designed for cross-platform agent surfaces (pairs with Google's A2A agent protocol).
  • https://github.com/MCP-UI-Org/mcp-ui — MCP-UI (~5.2k★): lets MCP tools return interactive UI resources (sandboxed iframes / remote DOM). This is the mechanism behind ChatGPT "apps" — a tool call comes back as a mini web app, not text.
  • https://github.com/CopilotKit/generative-ui — examples repo that maps the three patterns end to end: controlled (AG-UI), declarative (A2UI / Open-JSON-UI), open-ended (MCP Apps). Good Rosetta stone for comparing them.

Related / adjacent

  • OpenAI Apps SDK — build "apps" that run inside ChatGPT using MCP + MCP-UI resources (docs: https://developers.openai.com/apps-sdk). Worth knowing since it's the canonical production example of open-ended generative UI.
  • Vercel AI Elements (https://ai-sdk.dev/elements) — prebuilt chat/conversation components for the AI SDK. Complements generative UI (it's the chrome around it) rather than replacing it.
  • LangChain/LangGraph generative UI — LangGraph can emit UI components from graph nodes (bracesproul/gen-ui examples show the pattern).

Choosing

Need Pick
See the whole pattern working thesysdev/open-intelligent-ui demo
Guardrailed catalog, multi-framework or shadcn vercel-labs/json-render
Full-stack React (agent loop + UI + MCP included) tambo-ai/tambo
Angular, or bring-your-own chat UI liveloveapp/hashbrown
Copilot embedded in an existing app + agent frameworks CopilotKit/CopilotKit
Just add tool-result components to a chat assistant-ui/assistant-ui, Vercel AI SDK
UI over MCP / inside ChatGPT-style apps mcp-ui + Apps SDK
Wire format / interop between agent and frontend AG-UI + A2UI

Clone this wiki locally