Immutable solution version
create_react_agent to create_agent: the v1 migration checklist
Complete solution
LangChain v1 replaced langgraph.prebuilt.create_react_agent with langchain.agents.create_agent. The import path, the prompt argument, hooks, structured output, streaming node names, and runtime context all changed. This is the full mapping. Not the full reference manual.
TL;DR: LangChain v1 replaced langgraph.prebuilt.createreactagent with langchain.agents.createagent. The import path, the prompt argument, hooks, structured output, streaming node names, and runtime context all changed. createreactagent -> createagent The mapping - Import: langgraph.prebuilt.createreactagent -> langchain.agents.createagent - Prompt: prompt= is now systemprompt=, and it takes a plain string. Use middleware: beforemodel, aftermodel, @wrapmodelcall, @wraptoolcall.
createreactagent -> create_agent
# old (v0)
from langgraph.prebuilt import create_react_agent
agent = create_react_agent(model="...", tools=[...], prompt="...")
# new (v1)
from langchain.agents import create_agent
agent = create_agent(model="...", tools=[...], system_prompt="...")The mapping
- Import:
langgraph.prebuilt.create_react_agent->langchain.agents.create_agent - Prompt:
prompt=is nowsystem_prompt=, and it takes a plain string. If you passed a SystemMessage object, pull the string out of its content first. - Hooks:
pre_model_hook=,post_model_hook=,state_modifier=are gone. Use middleware:before_model,after_model,@wrap_model_call,@wrap_tool_call. Human approval of tool calls usesHumanInTheLoopMiddleware(interrupt_on={...})fromlangchain.agents.middleware. - Structured output: keep
response_format=, but build it withToolStrategyorProviderStrategyfromlangchain.agents.structured_output. The old prompted tuple form is removed. - Streaming: the node name changed from "agent" to "model". If you filter stream chunks by node name, update the filter.
- Runtime context: pass it as
context=on invoke/stream (withcontext_schema=on create_agent) instead of stuffing it intoconfig["configurable"]. - State: prefer
langchain.agents.AgentStateover the oldlanggraph.prebuiltagent state helpers. - Reading output: prefer
message.content_blocksfor provider-agnostic content.message.contentstill works.
Rules
- Search the codebase for
create_react_agent,pre_model_hook,post_model_hook,state_modifier, and imports fromlanggraph.prebuiltbefore calling a migration done. One leftover import breaks the whole module at import time. - Invoke the same way:
agent.invoke({"messages": [{"role": "user", "content": "..."}]}).
When to use this
- This covers exactly what the title says: createreactagent to create_agent.
- You are setting this up for the first time, or auditing an existing setup.
- You want the key gotchas in one place before you start.
When not to use this
- You are doing a different workflow with createreactagent; these steps are specific to the title above.
- You need the full reference docs; this is the short path, not the manual.
Compatibility
- Not pinned to a specific version; follows current createreactagent behavior.
Evidence
Verified against the official LangChain docs on 2026-09-26. Migration guide: https://docs.langchain.com/oss/python/migrate/langchain-v1
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_nCUO2GczwVQBjmrlWVT8EA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">create_react_agent to create_agent: the v1 migration checklist <span>— Vectle</span></a>