Credentials. Your LangChain model provider keys must be stored in environment variables on the server and kept out of client code.
Who it is forAn AI engineer who already runs a LangChain or LangGraph agent and wants its answers shown as interactive UI in a chat app.
The problemAgent responses arrive as text, so structured results such as tables and charts need custom plumbing to reach the screen.
The outcomeAn agent whose output streams through AG-UI as OpenUI Lang and renders as components in the client.
What you need first
- Node.js with npm and npx, since the README install and scaffold commands use them
- An LLM provider you can call from your backend, because OpenUI sends a generated system prompt to your model
- A component library to use or define; the README provides built-in libraries in @openuidev/react-ui
Steps
- In your agent project, run
npm install @openuidev/langchain @langchain/langgraph - Add the OpenUI agent transformer and server helpers from @openuidev/langchain to your agent server.
- Define the component library the agent is allowed to use and include its prompt in the agent instructions.
- Connect the client renderer so AG-UI events are displayed as they stream.
- Run one agent request and check that structured output renders as UI.
Prompt for your agent
In the thesysdev/openui repo, wire the @openuidev/langchain transformer into the LangGraph agent at <target agent path> so its output streams as OpenUI Lang over AG-UI. Expected output is a streamed UI response in the client; verify by running one request that returns a table or form component.
Caveat. The README names LangChain and LangGraph and AG-UI but does not document the transformer's exact API, so the wiring steps rely on the package docs.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for thesysdev/openui and "Stream a LangChain agent's output as live UI"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer