Skip to main content
useStream is UI-agnostic. It returns plain reactive state with messages, tool calls, loading flags, and thread history that you wire to any visual layer you choose. These pages show how different libraries integrate with LangChain frontends, each with a different philosophy for building AI chat and generative UI.

Integrations

CopilotKit

Full AI chat runtime with structured generative UI support. Add a custom CopilotKit endpoint to your LangGraph deployment, then render dynamic component trees in React.

AI Elements

Composable shadcn/ui-based components for AI chat. Drop in Conversation, Message, Tool, and Reasoning and wire them directly to stream.messages.

assistant-ui

Headless React framework with a full runtime layer. Bridge useStream to AssistantRuntimeProvider via the useExternalStoreRuntime adapter.

OpenUI

Generative UI library that lets the agent produce complete, interactive dashboards in a declarative component DSL. Purpose-built for data-rich, report-style UIs.

Choosing a library

Each library fits a slightly different integration model. The choice depends on what kind of UI you’re building:
CopilotKitAI Elementsassistant-uiOpenUI
Best forFull chat runtime plus structured generative UIChat with rich message typesFull-featured chat with minimal setupGenerated dashboards and reports
UI styleCopilotKit chat shell + custom message renderersComposable shadcn/ui componentsHeadless slots + default themePrebuilt component library with declarative DSL
CustomisationCustom backend endpoint, agent context, and renderersEdit source files directlyOverride component slotsTheme via CSS custom properties
Streaming UXRuntime-managed chat stream with structured assistant payloadsComponent-level progressive renderBuilt-in thread managementHoisting — shell appears immediately, data fills in
Tool callsVia CopilotKit runtime and custom renderersTool / ToolHeader / ToolOutputCustom via message slotsInline in the generated UI
Agent formatStructured assistant responses plus optional MarkdownAny stream.messagesAny stream.messagesAgent outputs openui-lang text
All four work well with LangChain agents, and the latter three also connect directly to useStream. CopilotKit is especially useful when you want a richer runtime layer and a dedicated endpoint that can sit alongside a LangGraph deployment.