F1 · Builds agents with the deprecated LangGraph prebuilt instead of create_agent
langchain 1.0.0 and LangGraph v1 both shipped 2025-10-17, roughly three months before this subject's stated 2026-01 cutoff.
"I reach for
create_react_agentfromlanggraph.prebuilthere, not the olderlangchain.agents.initialize_agent/AgentExecutor, which I consider legacy at this point." Asked directly (question c), it named the same path: "The recommended way to build an agent is LangGraph — either the prebuiltcreate_react_agentfor a standard tool-calling loop, or a hand-builtStateGraph."
from langgraph.prebuilt import create_react_agent
agent = create_react_agent(llm, tools=[get_weather, calculate])
agent = create_react_agent(llm, tools=[...], prompt=SYSTEM_PROMPT)from langchain.agents import create_agent
agent = create_agent(llm, tools=[get_weather, calculate],
system_prompt=SYSTEM_PROMPT)S3 rather than S1 because the prebuilt is deprecated, not deleted — this code still imports and runs. The cost is compounding: the model knows the previous migration (it explicitly rejects initialize_agent/AgentExecutor as legacy) and has no idea a second one happened. Everything it builds on top inherits the old surface — prompt= instead of system_prompt=, pre_model_hook= instead of middleware, and a stream filtered on the "agent" node. Those three are individually correct for the deprecated prebuilt, so they are not charged separately; but a developer who later takes the framework's own advice and swaps in create_agent will find the first two raise TypeError and the third silently stops matching.
Verified that the prebuilt is deprecated rather than removed; the migration guide lists it under Deprecations with a replacement, and gives no removal version. The subject's own hedge on the parameter name ("I've seen state_modifier and prompt both used") is recorded as an imprecision, not charged.
- LangGraph v1 migration guide — Deprecations
LangGraph v1 deprecates the create_react_agent prebuilt. Use LangChain's create_agent, which runs on LangGraph and adds a flexible middleware system.
- What's new in LangChain v1 — create_agent
The new standard for building agents in LangChain, replacing langgraph.prebuilt.create_react_agent.