LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
React SDK
Vue SDK
Svelte SDK
Angular SDK
LangGraph SDK
  • Ui
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Utils
  • Server
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
WebChannelsPregelPrebuiltRemote
React SDK
Vue SDK
Svelte SDK
Angular SDK
LangGraph SDK
UiClientAuthReactLoggingReact UiUtilsServer
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/react

@langchain/react

API reference for the React SDK package.

Classes

Class

FetchStreamTransport

Transport used to stream the thread.

Class

SubagentManager

Manages subagent execution state.

Functions

Function

calculateDepthFromNamespace

Calculates the depth of a subagent based on its namespace.

Function

createSuspenseCache

Function

executeHeadlessTool

Function

extractParentIdFromNamespace

Extracts the parent tool call ID from a namespace.

Function

extractToolCallIdFromNamespace

Extracts the tool call ID from a namespace path.

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

invalidateSuspenseCache

Clear the internal Suspense cache used by useSuspenseStream.

Function

isHeadlessToolInterrupt

Function

isSubagentNamespace

Checks if a namespace indicates a subagent/subgraph message.

Function

parseHeadlessToolInterruptPayload

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

Function

StreamProvider

Provides a shared useStream instance to all descendants via React Context.

Function

useStream

A React hook that provides seamless integration with LangGraph streaming capabilities.

Function

useStreamContext

Accesses the shared stream instance from the nearest StreamProvider.

Function

useSuspenseStream

A Suspense-compatible variant of useStream for LangGraph Platform.

Interfaces

Interface

AgentTypeConfigLike

Minimal interface matching the structure of AgentTypeConfig from @langchain/langgraph.

Interface

BaseStream

Base stream interface shared by all stream types.

Interface

CompiledSubAgentLike

Minimal interface matching the structure of a CompiledSubAgent from deepagents.

Interface

DeepAgentTypeConfigLike

Minimal interface matching the structure of DeepAgentTypeConfig from deepagents.

Interface

FlushPendingHeadlessToolInterruptsOptions

Interface

HeadlessToolImplementation

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

Interface

HeadlessToolInterrupt

Represents a headless tool interrupt payload emitted by LangChain's

Interface

QueueEntry

A single queued submission entry representing a server-side pending run.

Interface

QueueInterface

Reactive interface exposed to framework consumers for observing

Interface

SubAgentLike

Minimal interface matching the structure of a SubAgent from deepagents.

Interface

SubagentStreamInterface

Base interface for a single subagent stream.

Interface

SubagentToolCall

Represents a tool call that initiated a subagent.

Interface

ToolEvent

Interface

UseAgentStream

Stream interface for ReactAgent instances created with createAgent.

Interface

UseAgentStreamOptions

Options for configuring an agent stream.

Interface

UseDeepAgentStream

Stream interface for DeepAgent instances created with createDeepAgent.

Interface

UseDeepAgentStreamOptions

Options for configuring a deep agent stream.

Interface

UseStream

Interface

UseStreamOptions

Interface

UseStreamThread

Interface

UseStreamTransport

Transport used to stream the thread.

Types

Type

AnyHeadlessToolImplementation

Type

BaseSubagentState

Base state type for subagents.

Type

ClassSubagentStreamInterface

Subagent stream interface with messages typed as BaseMessage[]

Type

DefaultSubagentStates

Default subagent state map used when no specific subagent types are provided.

Type

DefaultToolCall

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

Type

ExtractAgentConfig

Extract the AgentTypeConfig from an agent-like type.

Type

ExtractDeepAgentConfig

Extract the DeepAgentTypeConfig from a DeepAgent-like type.

Type

ExtractSubAgentMiddleware

Helper type to extract middleware from a SubAgent definition.

Type

GetToolCallsType

Extract the tool call type from a StateType's messages property.

Type

InferAgentToolCalls

Extract tool calls type from an agent's tools.

Type

InferBag

Infer the Bag type from an agent, defaulting to the provided Bag.

Type

InferDeepAgentSubagents

Extract the Subagents array type from a DeepAgent.

Type

InferNodeNames

Infer the node names from a compiled graph.

Type

InferStateType

Infer the state type from an agent, graph, or direct state type.

Type

InferSubagentByName

Helper type to extract a subagent by name from a DeepAgent.

Type

InferSubagentNames

Extract all subagent names as a string union from a DeepAgent.

Type

InferSubagentState

Infer the state type for a specific subagent by extracting and merging

Type

InferSubagentStates

Infer subagent state map from a DeepAgent.

Type

InferToolCalls

Infer tool call types from an agent.

Type

IsAgentLike

Check if a type is agent-like (has ~agentTypes phantom property).

Type

IsDeepAgentLike

Check if a type is a DeepAgent (has ~deepAgentTypes phantom property).

Type

MessageMetadata

Type

OnToolCallback

Type

ResolveStreamInterface

Resolves the appropriate stream interface based on the agent/graph type.

Type

ResolveStreamOptions

Resolves the appropriate options interface based on the agent/graph type.

Type

StreamProviderCustomProps

Props for the StreamProvider component when using a custom transport.

Type

StreamProviderProps

Props for the StreamProvider component.

Type

SubagentStateMap

Create a map of subagent names to their state types.

Type

SubagentStatus

The execution status of a subagent.

Type

SubagentStream

Represents a single subagent stream.

Type

SuspenseCache

Type

ToolCallFromTool

Infer a tool call type from a single tool.

Type

ToolCallsFromTools

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

Type

ToolCallState

The lifecycle state of a tool call.

Type

ToolCallWithResult

Type

UseStreamCustom

Type

UseStreamCustomOptions

Type

UseSuspenseStream

Return type for useSuspenseStream.