LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
  • Stream
  • Overview
  • Getting started
  • useStream
  • Selectors
  • Interrupts & headless tools
  • Subagents & subgraphs
  • Fork & edit from a checkpoint
  • Submission queue
  • Multimodal media
  • Transports
  • Suspense
  • provideStream & context
  • Type safety
  • Migrating to v1
LangGraph SDK
  • Ui
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Utils
  • Server
  • Stream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
  • Store
LangGraph Checkpoint Redis
  • Shallow
  • Store
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
  • Cli
LangGraph API
LangGraph CLI
LangGraph CUA
  • Utils
LangGraph Supervisor
LangGraph Swarm
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangGraph
WebChannelsPregelPrebuiltRemoteStream
OverviewGetting starteduseStreamSelectorsInterrupts & headless toolsSubagents & subgraphsFork & edit from a checkpointSubmission queueMultimodal mediaTransportsSuspenseprovideStream & contextType safetyMigrating to v1
LangGraph SDK
UiClientAuthReactLoggingReact UiUtilsServerStream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
Store
LangGraph Checkpoint Redis
ShallowStore
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
Cli
LangGraph API
LangGraph CLI
LangGraph CUA
Utils
LangGraph Supervisor
LangGraph Swarm
Language
Theme
JavaScript@langchain/vue

@langchain/vue

Description

Classes

Class

HttpAgentServerAdapter

Public v1 name for TransportAdapter plus optional high-level

Class

MediaAssemblyError

Typed error thrown through media.stream / rejected from

Functions

Function

executeHeadlessTool

Function

filterOutHeadlessToolInterrupts

Strip headless-tool interrupts from a user-facing interrupt list.

Function

findHeadlessTool

Function

flushPendingHeadlessToolInterrupts

Execute and resume all newly seen headless-tool interrupts from a values

Function

handleHeadlessToolInterrupt

Function

headlessToolResumeCommand

Function

isHeadlessToolInterrupt

Function

parseHeadlessToolInterruptPayload

Parses a headless-tool interrupt value from the graph. Accepts both

Function

provideStream

Creates a shared useStream instance and provides it to all descendant

Function

useAudio

Subscribe to a scoped audio-media stream. Each handle is yielded

Function

useAudioPlayer

Progressive audio playback for AudioMedia handles with a

Function

useChannel

Function

useChannelEffect

Side-effect counterpart to useChannel. Instead of returning a

Function

useExtension

Subscribe to a custom:<name> stream extension — the most-recent

Function

useFiles

Subscribe to a scoped file-media stream. Pair with

Function

useImages

Subscribe to a scoped image-media stream. Pair with

Function

useMediaURL

Resolve the lazy MediaBase.objectURL promise into a

Function

useMessageMetadata

Read metadata recorded for a specific message id — today exposes

Function

useMessages

Subscribe to a scoped messages stream.

Function

useProjection

Vue primitive that composes ChannelRegistry.acquire with

Function

useStream

Vue Composition API binding for the v2-native stream runtime.

Function

useStreamContext

Accesses the shared stream instance from the nearest ancestor that

Function

useSubmissionQueue

Function

useToolCalls

Subscribe to a scoped tools (tool-call) stream. Same target and

Function

useValues

Subscribe to a scoped values stream — the most recent state

Function

useVideo

Subscribe to a scoped video-media stream. Pair with

Function

useVideoPlayer

Bind a VideoMedia handle to a caller-owned <video> element.

Interfaces

Types

Interface

AgentServerAdapter

Public v1 name for TransportAdapter plus optional high-level

Interface

AssembledToolCall

Reactive tool handle for framework bindings (stream.toolCalls,

Interface

AudioMedia

Shared surface across every media handle returned by

Interface

AudioPlayerHandle

Player controls + live state returned by useAudioPlayer.

Interface

FileMedia

Shared surface across every media handle returned by

Interface

FlushPendingHeadlessToolInterruptsOptions

Interface

HeadlessToolImplementation

Client-side implementation returned by headlessTool.implement(...).

Interface

HeadlessToolInterrupt

Represents a headless tool interrupt payload emitted by LangChain's

Interface

HttpAgentServerAdapterOptions

Interface

ImageMedia

Shared surface across every media handle returned by

Interface

LangChainPluginOptions

Configuration options for the LangChain Vue plugin.

Interface

MediaBase

Shared surface across every media handle returned by

Interface

MessageMetadata

Metadata tracked per message id. Surfaced to applications via

Interface

StreamStopOptions

Options for StreamController.stop / framework stop().

Interface

StreamSubmitOptions

Interface

SubagentDiscoverySnapshot

Lightweight discovery record for a subagent running inside the thread.

Interface

SubgraphDiscoverySnapshot

Lightweight discovery record for a subgraph running inside the thread.

Interface

SubmissionQueueEntry

Queued submission entry mirrored from the server-side run queue.

Interface

ThreadStream

High-level wrapper around a protocol connection to a specific thread.

Interface

ToolEvent

Interface

UseAudioPlayerOptions

Options for useAudioPlayer.

Interface

UseChannelEffectOptions

Options for useChannelEffect. Extends the projection options

Interface

UseStreamReturn

Vue binding return type for useStream.

Interface

UseSubmissionQueueReturn

Reactive handle on the server-side submission queue.

Interface

UseVideoPlayerOptions

Options for useVideoPlayer.

Interface

VideoMedia

Shared surface across every media handle returned by

Interface

VideoPlayerHandle

Controls + live state returned by useVideoPlayer. Mirrors

Type

AgentServerOptions

Type

AnyHeadlessToolImplementation

Type

AnyMediaHandle

Type

AnyStream

Erased handle useful as a parameter type for helpers and wrapper

Type

CustomAdapterOptions

Type

DefaultToolCall

Default tool call type when no specific tool definitions are provided.

Type

InferStateType

Unwrap the state shape from a compiled graph, a create-agent brand,

Type

InferSubagentStates

Infer the subagent → state map from a DeepAgent brand. Non-brands

Type

InferToolCalls

Infer the discriminated union of AssembledToolCall handles

Type

MediaAssemblyErrorKind

Kinds of failure that can terminate a media handle prematurely.

Type

MediaBlockType

Block types this assembler knows how to reassemble into media handles.

Type

MessageMetadataMap

Read-only map exposed via MessageMetadataTracker.store.

Type

OnToolCallback

Type

PlayerStatus

Lifecycle state of an audio or video player returned by

Type

SelectorTarget

What a selector composable can be targeted at. Callers can pass:

Type

SubmissionQueueSnapshot

Read-only snapshot of the queue. The queue store hands this out

Type

ToolCallFromTool

Infer the streaming AssembledToolCall handle for a single

Type

ToolCallsFromTools

Infer a union of tool call types from an array of tools.

Type

ToolCallState

The lifecycle state of a tool call.

Type

ToolCallStatus

High-level outcome of a single tool call.

Type

ToolCallWithResult

Represents a tool call paired with its result.

Type

UseStreamOptions

Type

UseStreamResult

Convenience alias for the fully-resolved stream handle type.

Type

VueReactiveOptions

Wraps specific option keys to accept MaybeRefOrGetter for Vue reactivity.

Type

WidenUpdateMessages

Widen an update type so its messages field also accepts

@langchain/vue

Vue SDK for building AI-powered applications with Deep Agents, LangChain and LangGraph.

The package ships a Composition-API–first binding built on top of the v2 streaming protocol. useStream returns a small, always-on root handle (values, messages, isLoading, error, …) and pushes anything namespaced (subagents, subgraphs, media, submission queue, per-message metadata) behind ref-counted use* selectors so components only pay for the data they actually consume.

Upgrading from 0.x? See docs/v1-migration.md for the complete matrix of option, return-shape, and transport changes.

Highlights

  • v2-native streaming protocol. Session-based transport with automatic re-attach on remount — no reconnectOnMount / joinStream dance.
  • Composition-API first. Everything is a ShallowRef / ComputedRef, auto-disposed via onScopeDispose when the scope unmounts.
  • Selector-based subscriptions. Namespaced data (subagents, subgraphs, media) streams only when a component actually mounts the matching selector composable, and releases on unmount.
  • Discriminated transports. Hosted Agent Server and custom adapters are two arms of a single typed union — mixing them is a compile-time error.
  • Agent-brand type inference. useStream<typeof agent>() unwraps state, tool calls, and subagent state maps from an agent brand.
  • Multimodal media streams. Built-in assembly for audio, images, video, and files, with ready-to-use <img> / <audio> / <video> players.
  • <Suspense> friendly. hydrationPromise lets you gate async setup() on initial hydration.

Installation

npm install @langchain/vue @langchain/core

Peer dependencies: vue (^3.4.0), @langchain/core (^1.0.1).

Quick start

<script setup lang="ts">
import { useStream } from "@langchain/vue";

const stream = useStream({
  assistantId: "agent",
  apiUrl: "http://localhost:2024",
});

function onSubmit() {
  void stream.submit({ messages: [{ type: "human", content: "Hello!" }] });
}
</script>

<template>
  <div>
    <div v-for="(msg, i) in stream.messages" :key="msg.id ?? i">
      {{ typeof msg.content === "string" ? msg.content : JSON.stringify(msg.content) }}
    </div>

    <button :disabled="stream.isLoading" @click="onSubmit">
      Send
    </button>
  </div>
</template>

Reactive fields on the handle are Vue refs (ShallowRef / ComputedRef). In <script setup>, read them with .value: stream.messages.value, stream.isLoading.value. In <template>, Vue auto-unwraps refs, so prefer the shorter stream.messages / stream.isLoading form.

Documentation

In-depth guides live in docs/:

  • API reference — useStream options and return shape.
  • Selectors — ref-counted readers for namespaced / scoped data.
  • Transports — SSE, WebSocket, and custom AgentServerAdapter implementations.
  • Custom transports — implementing AgentServerAdapter against your own backend, with a worked walkthrough of examples/ui-react-transport.
  • Interrupts & headless tools — pausing a run, responding to interrupts, registering browser-side tools.
  • Forking from a message — edit / retry flows with useMessageMetadata + submit({ forkFrom }).
  • Submission queue — inspecting and cancelling enqueued submits.
  • Subagents & subgraphs — rendering per-subagent messages, tool calls, and state via scoped selectors.
  • Multimodal media — audio / image / video / file streams with built-in players.
  • Sharing a stream — provideStream, useStreamContext, and the LangChainPlugin app-level defaults.
  • Suspense-style hydration — gating async setup() on hydrationPromise.
  • Type safety — brand inference, generics, and the exported helper types.
  • Testing — mounting components with mock streams or real dev servers.
  • Migrating from 0.x — full diff of options, return shape, and transport classes.

Playground

For complete end-to-end examples with full agentic UIs, visit the LangChain UI Playground.

License

MIT