create_agent
An API in LangChain 1.x for creating an agent. It returns a LangGraph graph in which the model determines the next action.
Core Facts
Timeline (last 90 days)
LangChain's official documentation calls create_agent a "minimal, highly configurable harness," while LangGraph's documentation describes itself as a low-level orchestration framework and runtime for long-running, stateful agents.
In LangChain 1.4.3, create_agent returns an object of type CompiledStateGraph (a LangGraph graph) rather than a chain.
The minimal graph built by create_agent has nodes ['__start__', 'model', 'tools', '__end__'], where the model node calls the large model, the tools node executes the tools requested by the model, and the loop repeats until the model no longer requests tools.
create_react_agent in langgraph.prebuilt has been marked as deprecated in the tested version, with create_agent recommended instead.
When using create_agent, checkpointing capability can be obtained directly just by passing the checkpointer parameter, without writing a graph by hand.
create_agent accepts the checkpointer, store, interrupt_before, interrupt_after, and middleware list parameters.
When using human approval, the first invoke causes the agent to pause, and a __interrupt__ key appears in the result, whose payload contains action_requests and review_configs.
The create_agent() provided by LangChain is essentially a factory function, implemented internally based on LangGraph
create_agent() requires three parameters: tools, model, and system prompt
Running the Agent is as simple as passing the user query via the agent.invoke() method, with message history maintenance and loop control handled internally by the framework
3 more timeline events
All Facts (14)
The create_react_agent in LangGraph is implemented based on the ReAct paradigm, allowing the model to reason at each step and decide whether to call a tool or output a final answer.
70%UnverifiedThe underlying implementation of create_agent is still a LangGraph graph, where each tool is a node; the difference is that the LangGraph graph is hardcoded, whereas the Agent's graph is dynamically generated by prompts.
60%UnverifiedLangChain's official documentation calls create_agent a "minimal, highly configurable harness," while LangGraph's documentation describes itself as a low-level orchestration framework and runtime for long-running, stateful agents.
50%UnverifiedThe minimal graph built by create_agent has nodes ['__start__', 'model', 'tools', '__end__'], where the model node calls the large model, the tools node executes the tools requested by the model, and the loop repeats until the model no longer requests tools.
50%Unverifiedcreate_react_agent in langgraph.prebuilt has been marked as deprecated in the tested version, with create_agent recommended instead.
50%UnverifiedWhen using create_agent, checkpointing capability can be obtained directly just by passing the checkpointer parameter, without writing a graph by hand.
50%Unverifiedcreate_agent accepts the checkpointer, store, interrupt_before, interrupt_after, and middleware list parameters.
50%UnverifiedWhen using human approval, the first invoke causes the agent to pause, and a __interrupt__ key appears in the result, whose payload contains action_requests and review_configs.
50%UnverifiedIn LangChain 1.4.3, create_agent returns an object of type CompiledStateGraph (a LangGraph graph) rather than a chain.
50%UnverifiedThe create_agent() provided by LangChain is essentially a factory function, implemented internally based on LangGraph
50%Unverifiedcreate_agent() requires three parameters: tools, model, and system prompt
50%UnverifiedRunning the Agent is as simple as passing the user query via the agent.invoke() method, with message history maintenance and loop control handled internally by the framework
50%UnverifiedLangChain 1.4.3 adds logic to create_agent to fix invalid tool calls, which can automatically correct tool call parameters with formatting errors or missing fields.
50%UnverifiedLangChain 1.0 uniformly uses create_agent as the entry point for creating agents, ending the confusion caused by more than ten creation methods in older versions.
50%