Optional
checkpointOptional
checkpointer?: BaseCheckpointSaverAn optional checkpoint saver to persist the agent's state. Alias of "checkpointSaver".
Optional
includeUse 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>"
Optional
interruptAn optional list of node names to interrupt after running.
Optional
interruptAn optional list of node names to interrupt before running.
The chat model that can utilize OpenAI-style tool calling.
Optional
messageUse prompt instead.
Optional
name?: stringAn optional name for the agent.
Optional
postAn 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.
Optional
preAn 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.).
Optional
prompt?: PromptAn 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.
Optional
responseAn 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
stateUse prompt instead.
Optional
stateOptional
store?: BaseStoreA list of tools or a ToolNode.
An optional checkpoint saver to persist the agent's state.