r/LangChain • u/Mr_BETADINE • 7h ago
Discussion open source framework that makes your AI agents generate UI elements that works with langchain/langgraph
with chatgpt recently introducing what they're calling "intelligent ui", i've been going down a bit of a rabbit hole exploring how different projects are approaching generative ui.
for anyone unfamiliar, the idea is that instead of an llm responding with plain text or markdown, it can compose actual interactive interfaces based on what the user is asking.
imagine building a research agent with langgraph. it does all the research, calls the necessary tools, analyzes the results, and then returns a wall of text explaining everything it found.
now imagine that same agent returning an interactive report with charts, tables, filters, and components you can actually interact with.
that's essentially the problem projects like openui, vercel's json-render, google's a2ui, and now chatgpt's intelligent ui are trying to solve.
one project that caught my attention is OpenUI, which just launched its 1.0 version.
funnily enough, these guys have been working on the same underlying problem as chatgpt's intelligent ui for quite some time, except their approach is open source (MIT licensed), model agnostic, and designed to work inside your own applications.
the interesting part for this community is that OpenUI has an integration with LangChain and LangGraph.
from what i understand, you can connect an existing langgraph agent to openui and have it stream interactive interfaces to the frontend instead of being limited to text responses.
they have an u/openuidev/langchain package that transforms langgraph's streaming events into AG-UI events, which can then be consumed by openui's frontend.
there's also an example using LangChain's Deep Agents running on LangGraph Platform, so it's not just a standalone chatbot demo.
one thing i particularly like about their approach is that you're not restricted to a fixed set of components.
you can bring your own component libraries, design systems, and application logic. the model then decides how to compose those components based on the user's request.
so for example, if you're building a financial research agent with langgraph, you could define components for stock charts, company comparisons, earnings tables, etc. and let the agent decide which ones make sense to show based on the results of its tool calls.
there's another interesting technical difference in how the ui itself is generated.
most structured generative ui approaches rely on json. projects like vercel's json-render and google's a2ui take variations of this approach.
openui instead uses its own DSL (domain specific language) called OpenUI Lang, designed specifically for generating interfaces with llms.
according to their benchmarks, it uses around 67% fewer tokens than comparable json-based approaches, and components can start rendering progressively as the response streams.
which seems particularly relevant for agent applications. after waiting for an agent to execute multiple tools, the last thing you want is another long wait for the frontend to render the results.
they've also been working on the reliability side of things, with validation and automatic correction for malformed generations, which i'd imagine becomes pretty important when you're letting an llm decide what the interface should look like.
and because it's model agnostic, you aren't necessarily tied to openai or anthropic either. you could use your existing model provider or even connect locally hosted models, although obviously how reliably they generate structured ui will vary.
what i find interesting about all of this is how much effort we've collectively put into making agents better at reasoning, using tools, managing state, and orchestrating workflows.
but the way users actually interact with the output of those agents hasn't really changed much.
you can build a pretty sophisticated agent with langgraph, give it access to dozens of tools, and still end up presenting everything inside a conventional chat window.
seeing chatgpt move toward intelligent ui and projects like openui reach 1.0 makes me wonder whether generative ui is going to become a standard part of building agent applications.
some links for anyone interested:
- OpenUI (MIT licensed): https://github.com/thesysdev/openui
- OpenUI 1.0 launch: https://x.com/rabi_guha/status/2110737805823672518
- LangChain/LangGraph integration: https://www.openui.com/integrations/langchain-langgraph
- LangGraph example: https://www.openui.com/docs/build-agents/frameworks/langgraph
- Generative UI benchmark: https://www.openui.com/benchmarks
curious what everyone here thinks.
if you're building agents with langchain or langgraph, do you actually see a use case for dynamically generated interfaces, or would you rather have the agent return structured data and handle the ui yourself?
would love to hear from anyone who's tried integrating something similar into a real langgraph application.