CreateReactAgentParamsAn optional checkpoint saver to persist the agent's state. Alias of "checkpointSaver".
An optional checkpoint saver to persist the agent's state.
An optional schema for the context.
An optional description for the agent. This can be used to describe the agent to the underlying supervisor LLM.
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>"An optional name for the agent.
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.
Additional state schema for the agent.
A list of tools or a ToolNode.
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.The chat model that can utilize OpenAI-style tool calling.