Dynamic UI Generation AI Assistants - spinningideas/resources GitHub Wiki
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:
- 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).
- The schema becomes tool/prompt definitions β the catalog is handed to the LLM as tools or embedded in the system prompt.
- 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). - 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).
useCopilotActionlets 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-uiexamples 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 |