R.1

create_agent parameters

create_agent in langchain 1.5.0 takes a model, tools, and 13 keyword parameters, and returns a compiled LangGraph graph with a recursion limit of 9999.

The tables give each parameter, its type and default at the pin, and what the code does with it. Each row names the line of libs/langchain_v1/langchain/agents/factory.py at langchain==1.5.0 in its citation. Section 4.1 explains the graph, and the last column links the section that runs each parameter.

The signature

Import it with from langchain.agents import create_agent. The function starts at line 895, after three typed overloads at lines 827, 849, and 873. The first two parameters are positional. The others are keyword only.

ParameterTypeDefaultWhat the code doesSection
modelstr or BaseChatModelrequiredA string goes through init_chat_model once, when the agent is built.3.2
toolsa sequence of BaseTool, callables, and dictsNoneA dict is a provider tool. It is bound to the model and never runs in the tools node.3.4
system_promptstr or SystemMessageNoneA string becomes a SystemMessage. It goes first in every model request and is not stored in the state.3.5
middlewarea sequence of AgentMiddleware()Two instances with one name raise AssertionError. Their tools join your tools.4.5
response_formatToolStrategy, ProviderStrategy, AutoStrategy, a type, or a dictNoneA plain schema becomes AutoStrategy, which picks a strategy on each model call.4.2
state_schemaa subclass of AgentStateNoneMiddleware schemas merge first and this schema merges last, so its fields win.4.1
context_schemaa typeNoneTypes the context argument of a run. Without it, a context dict gives a pydantic warning in our runs.5.4
checkpointera CheckpointerNonePassed to compile. Without one, a run keeps no state between calls.5.2
storea BaseStoreNonePassed to compile, and given to tools as runtime.store.5.4
interrupt_beforea list of node namesNoneStatic breakpoints before the named nodes, passed to compile.6.4
interrupt_aftera list of node namesNoneStatic breakpoints after the named nodes, passed to compile.6.4
debugboolFalsePassed to compile.4.1
namestrNoneSets the graph name, the name of each model reply, and lc_agent_name in the run metadata.6.7
cachea LangGraph BaseCacheNoneA node cache, passed to compile. It is not the model cache of set_llm_cache.4.7
transformersa sequence of stream transformer factoriesNoneAdded after ToolCallTransformer, SubagentTransformer, and the transformers of each middleware.5.1

The docstring says that response_format takes a ToolStrategy, a ProviderStrategy, or a Pydantic class. The signature also takes AutoStrategy, a dataclass, a TypedDict, and a JSON schema dict, and capture 07-structured-output.txt runs each one.

The graph it returns

The return type is CompiledStateGraph. The code compiles the graph and then applies one run config to it.

PropertyValue at the pinWhere it comes from
model nodemodelgraph.add_node("model", ...)
tool nodetools, a ToolNode, present only with client tools or a wrap_tool_call middleware
middleware nodes<name>.before_agent, <name>.before_model, <name>.after_model, <name>.after_agentcapture 09-middleware-order.txt
recursion_limit9999
run metadata{"ls_integration": "langchain_create_agent"}
default stream_modeupdatesStateGraph.compile
parallel tool callsone Send("tools", [tool_call]) for each pending call, in one step
loop exitno tool calls, or a new structured_response

The tools node uses the default error handler of ToolNode. It returns a message for bad arguments and raises every other exception. Section 3.4 shows both cases.

The state

AgentState is a TypedDict with three keys.

KeyTypeNotes
messagesa list of messages with the add_messages reducerrequired
jump_to"tools", "model", or "end"private and ephemeral. A node hook sets it to route the run
structured_responseyour schemaleft out of the input schema

InputAgentState holds only messages. OutputAgentState holds messages and structured_response.

Arguments of a run

The run methods belong to the compiled graph from langgraph 1.2.22. invoke and stream take the same keywords, and stream also takes subgraphs.

ArgumentDefaultNotesSection
inputrequiredA dict with messages, None to go on from a checkpoint, or a Command to resume.6.4
configNoneHolds recursion_limit, max_concurrency, callbacks, and configurable, with thread_id inside configurable.5.2
contextNoneStatic data for the run, read as runtime.context.5.4
stream_modevalues for invoke, the graph default for streamThe stream reference lists each mode.5.1
durabilityasyncsync, async, or exit.5.3
interrupt_before, interrupt_afterNoneBreakpoints for this run only.6.4
subgraphsFalsestream only. Each chunk then carries the namespace of its subgraph.6.7
versionv1v2 yields StreamPart dicts, and invoke returns a GraphOutput.5.1

LangChain (Python): langchain, langchain-core, langgraph, deepagents, langsmith 1.5.0 · c2f4036 · 2026-11-11 · Edition 2026.11