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 create_agent + SqliteSaver default configuration amplifies untrusted input on disk by 10.4x
When creating an Agent with LangChain's create_agent, the model parameter specifies the large model and the tools parameter specifies the list of tools; get_stock_price and search_news in the course examples are LangChain built-in tools and have nothing to do with MCP.
In LangChain, the system prompt is passed via system_prompt configuration to convey identity, instructions, and output examples, then create_agent is used to bind the model and prompt, and finally invoke is used to trigger the call.
create_react_agent in langgraph.prebuilt has been marked as deprecated in the tested version, with create_agent recommended instead.
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.
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.
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.
6 more timeline events
All Facts (17)
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 create_agent + SqliteSaver default configuration amplifies untrusted input on disk by 10.4x
50%UnverifiedWhen creating an Agent with LangChain's create_agent, the model parameter specifies the large model and the tools parameter specifies the list of tools; get_stock_price and search_news in the course examples are LangChain built-in tools and have nothing to do with MCP.
50%UnverifiedIn LangChain, the system prompt is passed via system_prompt configuration to convey identity, instructions, and output examples, then create_agent is used to bind the model and prompt, and finally invoke is used to trigger the call.
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%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%UnverifiedIn LangChain 1.4.3, create_agent returns an object of type CompiledStateGraph (a LangGraph graph) rather than a chain.
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%UnverifiedThe create_agent() provided by LangChain is essentially a factory function, implemented internally based on LangGraph
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%Unverifiedcreate_agent() requires three parameters: tools, model, and system prompt
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%