LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
LangGraph SDK
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • 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
LangGraph SDK
ClientAuthReactLoggingReact UiServer
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/langgraphprebuilt
Module●Since v0.3

prebuilt

Copy
import { ... } from "@langchain/langgraph/prebuilt";

Functions

function
createReactAgentAnnotation→ AnnotationRoot<__type>
function
toolsCondition→ "__end__" | "tools"

A conditional edge function that determines whether to route to a tools node or end the graph.

This function is designed to be used as a conditional edge in a LangGraph state graph to implement the common pattern of checking if an AI message contains tool calls that need to be executed.

deprecatedfunction
createFunctionCallingExecutor→ CompiledStateGraph<FunctionCallingExecutorState, Partial<FunctionCallingExecutorState>, "__start__" | "agent" | "action">
deprecatedfunction
createReactAgent→ CompiledStateGraph<ToAnnotationRoot<A>["State"], ToAnnotationRoot<A>["Update"], any, __type & ToAnnotationRoot<A>["spec"], __type & ToAnnotationRoot<A>["spec"]>
deprecatedfunction
withAgentName→ LanguageModelLike

Attach formatted agent names to the messages passed to and from a language model.

This is useful for making a message history with multiple agents more coherent.

Classes

class
ToolNode

A node that runs the tools requested in the last AIMessage. It can be used either in StateGraph with a "messages" key or in MessageGraph. If multiple tool calls are requested, they will be run in parallel. The output will be a list of ToolMessages, one for each tool call.

deprecatedclass
ToolExecutor

Interfaces

interface
ActionRequest

Represents a request for human action within the graph execution. Contains the action type and any associated arguments needed for the action.

interface
HumanInterrupt

Represents an interrupt triggered by the graph that requires human intervention. This is passed to the interrupt function when execution is paused for human input.

interface
HumanInterruptConfig

Configuration interface that defines what actions are allowed for a human interrupt. This controls the available interaction options when the graph is paused for human input.

interface
ToolInvocationInterface

Interface for invoking a tool

deprecatedinterface
AgentState
deprecatedinterface
ToolExecutorArgs

Type Aliases

typeAlias
AgentNameMode: "inline"
typeAlias
HumanResponse

The response provided by a human to an interrupt, which is returned when graph execution resumes.

typeAlias
ToolNodeOptions
deprecatedtypeAlias
CreateReactAgentParams
deprecatedtypeAlias
FunctionCallingExecutorState
View source on GitHub