Skip to main content

LangGraph v1 migration guide

Migrate a codebase to LangGraph v1.

Migrate this codebase to LangGraph v1 (requires langgraph>=1.0.0, langchain-core>=0.3.0).

Key changes:

  1. Upgrade packages: run pip install -U langgraph langchain-core (or uv add langgraph langchain-core).
  2. create_react_agent → create_agent: replace all from langgraph.prebuilt import create_react_agent with from langchain.agents import create_agent. Update call sites: create_agent(model, tools, system_prompt=...) instead of create_react_agent(model, tools, prompt=...).
  3. Remove deprecated state types: replace AgentState, AgentStatePydantic, AgentStateWithStructuredResponse, and AgentStateWithStructuredResponsePydantic (all from langgraph.prebuilt) with langchain.agents.AgentState.
  4. Human-in-the-loop: replace HumanInterruptConfig, ActionRequest, and HumanInterrupt (from langgraph.types or langgraph.prebuilt) with langchain.agents.middleware.human_in_the_loop.InterruptOnConfig and HITLRequest.
  5. ValidationNode: remove it. create_agent validates tool input automatically.
  6. MessageGraph: replace with StateGraph using a messages key, or use create_agent directly.
  7. LangGraph v1 is otherwise backwards compatible: custom StateGraph-based graphs, checkpointers, interrupt(), Command, Send, and MemorySaver all continue to work unchanged.

Search the codebase for all imports from langgraph.prebuilt (create_react_agent, AgentState, AgentStatePydantic, AgentStateWithStructuredResponse, HumanInterruptConfig, ActionRequest, HumanInterrupt, ValidationNode, MessageGraph) and apply the necessary changes. Flag anything that cannot be migrated automatically.

This guide outlines changes in LangGraph v1 and how to migrate from previous versions. For a high-level overview of changes, see the what's new page.

To upgrade:

pip install -U langgraph langchain-core
uv add langgraph langchain-core

Summary of changes

LangGraph v1 is largely backwards compatible with previous versions. The main change is the deprecation of create_react_agent in favor of LangChain's new create_agent function.

Deprecations

The following table lists all items deprecated in LangGraph v1:

Deprecated itemAlternative
create_react_agentlangchain.agents.create_agent
AgentStatelangchain.agents.AgentState
AgentStatePydanticlangchain.agents.AgentState (no more pydantic state)
AgentStateWithStructuredResponselangchain.agents.AgentState
AgentStateWithStructuredResponsePydanticlangchain.agents.AgentState (no more pydantic state)
HumanInterruptConfiglangchain.agents.middleware.human_in_the_loop.InterruptOnConfig
ActionRequestlangchain.agents.middleware.human_in_the_loop.InterruptOnConfig
HumanInterruptlangchain.agents.middleware.human_in_the_loop.HITLRequest
ValidationNodeTools automatically validate input with create_agent
MessageGraphStateGraph with a messages key, like create_agent provides

create_react_agent → create_agent

LangGraph v1 deprecates the create_react_agent prebuilt. Use LangChain's create_agent, which runs on LangGraph and adds a flexible middleware system.

See the LangChain v1 docs for details:

from langchain.agents import create_agent

agent = create_agent(  # [!code highlight]
    model,
    tools,
    system_prompt="You are a helpful assistant.",
)
from langgraph.prebuilt import create_react_agent

agent = create_react_agent(  # [!code highlight]
    model,
    tools,
    prompt="You are a helpful assistant.",  # [!code highlight]
)

Breaking changes

Dropped Python 3.9 support

All LangChain packages now require Python 3.10 or higher. Python 3.9 reached end of life in October 2025.