CreateReactAgentParamsOptional checkpointer for persisting graph state. When provided, saves a checkpoint of the graph state at every superstep. When false or undefined, checkpointing is disabled, and the graph will not be able to save or restore state.
An optional checkpoint saver to persist the agent's state.
An optional schema for the context.
The description of the compiled graph. This is used by the supervisor agent to describe the handoff to the agent.
Use to specify how to expose the agent name to the underlying supervisor LLM.
"inline": Add the agent name directly into the content field of the AIMessage using XML-style tags.
Example: "How can I help you" -> "<name>agent_name</name><content>How can I help you?</content>"The chat model that can utilize OpenAI-style tool calling.
The name of the task, analogous to the node name in StateGraph.
An optional node to add after the agent node (i.e., the node that calls the LLM).
Useful for implementing human-in-the-loop, guardrails, validation, or other post-processing.
An optional node to add before the agent node (i.e., the node that calls the LLM).
Useful for managing long message histories (e.g., message trimming, summarization, etc.).
An optional prompt for the LLM. This takes full graph state BEFORE the LLM is called and prepares the input to LLM.
Can take a few different forms:
Note:
Prior to v0.2.46, the prompt was set using stateModifier / messagesModifier parameters.
This is now deprecated and will be removed in a future release.
An optional schema for the final agent output.
If provided, output will be formatted to match the given schema and returned in the 'structuredResponse' state key.
If not provided, structuredResponse will not be present in the output state.
Can be passed in as:
Important: responseFormat requires the model to support .withStructuredOutput().
Note: The graph will make a separate call to the LLM to generate the structured response after the agent loop is finished. This is not the only strategy to get structured responses, see more options in this guide.
Optional long-term memory store for the graph, allows for persistence & retrieval of data across threads
Determines the version of the graph to create.
Can be one of
"v1": The tool node processes a single message. All tool calls in the message are
executed in parallel within the tool node."v2": The tool node processes a single tool call. Tool calls are distributed across
multiple instances of the tool node using the Send API.