How it connects to OpenUI
Point fetchLLM or a direct ChatLLM implementation at an AG-UI SSE endpoint and use agUIAdapter() as the stream adapter. OpenUI maps supported lifecycle, text, tool, and error events into its chat runtime.
Integration steps
- 1
Prompt your agent for OpenUI Lang
Give the agent a system prompt generated from the same component library the client renders, so its text output is valid OpenUI Lang.
- 2
Serve AG-UI events
Expose the agent as an SSE endpoint that emits standard AG-UI run lifecycle, text message, tool call, and error events.
- 3
Connect the adapter
Point fetchLLM, or your own ChatLLM implementation, at that endpoint with agUIAdapter() as the stream adapter. Pass it to AgentInterface for a ready-made chat app, or to ChatProvider from @openuidev/react-headless for your own UI.