GitHub – CopilotKit/generative-ui: Generative UI examples for: AG-UI, A2UI/Open-JSON-UI, and MCP Apps.
Build Apps That Adapt to Your Users with Generative UI
Have you ever wished your app could *adjust itself* to what the user actually needs in the moment?
That’s the idea behind Generative UI. Instead of hard-coding every screen and interaction, parts of the interface are generated or controlled by an AI agent at runtime. Not just text responses, but actual UI components. Cards. Forms. Widgets. Even full interactive surfaces.
The CopilotKit Generative UI repository walks you through how this works in practice, using agentic UI protocols like AG-UI, A2UI, Open-JSON-UI, and MCP Apps. And what I love about it is that it doesn’t stay abstract. It shows real implementation patterns.
Let’s break it down.
1. Controlled Generative UI
This is the safest starting point. You pre-build your React components, and the agent decides which one to show and when. Think of it like giving the AI a remote control, but you still designed the house. CopilotKit’s useFrontendTool hook makes this surprisingly clean to implement.
2. Declarative Generative UI
Here, the agent sends a structured UI description in JSON, and the frontend renders it. Specs like A2UI and Open-JSON-UI define how components, state updates, and render signals are streamed. It feels a bit like teaching the agent a design language so it can sketch interfaces on the fly.
3. Open-ended Generative UI
This is the wild west. The agent can return a full UI surface, sometimes HTML or an iframe, and the app acts as a container. Powerful, yes. But you’ll want to think carefully about security and consistency.
One demo that stood out to me is the MCP-powered diagramming app. You describe something in chat and instantly get an editable Excalidraw diagram back. That kind of interaction changes how we think about “interfaces.” They’re no longer static screens, they’re evolving workspaces.
If you’re building AI-powered apps, this shift matters. We’re moving from fixed layouts to adaptive systems. And honestly, once you see it in action, it’s hard to go back.
Take a look at the repo and explore the examples. This space is still young, but it’s heading somewhere exciting.



Kommentar abschicken