LangGraph/Prebuilt
Intermediate12 min

create_react_agent → create_agent Migration

create_react_agent is deprecated in LangGraph v1. This guide walks through migrating to create_agent — what the parameter rename means, which hooks map to which middleware, and what can break in production if you don't test the migration carefully.

Quick Reference

  • DEPRECATED: from langgraph.prebuilt import create_react_agent (LangGraph v1)
  • NEW STANDARD: from langchain.agents import create_agent
  • Parameter rename: prompt= → system_prompt= (will silently fail if missed)
  • pre_model_hook → SummarizationMiddleware or ContextEditingMiddleware
  • interrupt_before/after → HumanInTheLoopMiddleware
  • checkpointer=, store=, state_schema=, response_format= — unchanged
  • Checkpoint format may differ — run a migration test before swapping in production

Deprecation Notice

create_react_agent is deprecated in LangGraph v1

LangGraph v1 (released 2024, now at v1.1.6) deprecates create_react_agent in favor of langchain.agents.create_agent. The new API runs on the same LangGraph runtime — checkpointing, streaming, and HITL work identically — but replaces custom hook functions with a composable middleware system and renames the prompt= parameter to system_prompt=.

The migration in two lines