Appendix B: Migrating from 0.x to 1.x
LangGraph and LangChain reached 1.0 together in October 2025. Every pre-1.0 tutorial, blog post, and Stack Overflow answer written before that date imports symbols this book never uses, and the “it doesn’t import” reports this produces are not bugs. They are a stale-environment tell, covered as a pitfall in Chapter 2 and worth a dedicated reference here.
The three moves
| Before 1.0 | 1.x | Covered in |
|---|---|---|
from langgraph.prebuilt import create_react_agent |
from langchain.agents import create_agent |
Chapter 2 |
create_react_agent(model, tools, prompt=...) |
create_agent(model=, tools=, system_prompt=...) |
Chapters 2 and 8 |
message.content, parsed by hand |
message.content_blocks, a typed view over the same content |
Chapter 7 |
create_react_agent is deprecated, not removed. At this book’s pinned version it still imports, still runs, and warns when called that it goes at 2.0. The opposite report, that create_agent was removed in 1.1.0, is the stale-environment myth Chapter 2 takes apart.
system_prompt= is narrower than the prompt= it replaces. It takes a string or a SystemMessage. The deprecated prebuilt agent’s prompt= also took a function of state or a Runnable, and old code that built its prompt from state has no keyword to move to. That prompt becomes a middleware, written with @dynamic_prompt from langchain.agents.middleware, the same decorator style Chapter 8 uses for @before_model and @wrap_tool_call.
.content is still there. .content_blocks is a standardized view computed from it, so code that read .content as a string-or-list, a per-provider guess dressed up as a convention, reads typed blocks instead. A provider block the translator does not recognize comes back as {"type": "non_standard", ...} rather than disappearing.
# The deprecated prebuilt agent: still imports and runs, warns when called
from langgraph.prebuilt import create_react_agent
agent = create_react_agent(model, tools, prompt=SYSTEM_PROMPT)
# 1.x (Chapter 2)
from langchain.agents import create_agent
agent = create_agent(model=model, tools=tools, system_prompt=SYSTEM_PROMPT)Figure 1 maps each of these moves, and the two this section covers next, from the deprecated prebuilt agent to its 1.x form.
create_agent, and what kind of move each one is. The import moved and was renamed, prompt= became the narrower system_prompt=, and .content_blocks adds a standard view while .content stays. response_format= keeps its name but is answered inside the loop instead of by one extra call after it, and the two model hooks give way to middleware, with no mechanical rename. create_react_agent was deprecated at 1.0, still runs at this book’s pin, and is due for removal at a 2.0 that has not shipped.
Same keyword, new mechanism
Two arguments survive the move by name and change what happens underneath. Treating either as “the same thing, renamed” is its own mistake.
Structured output via response_format= (Chapter 7). The deprecated prebuilt agent accepted response_format= too, and answered it by adding one more model call after the loop ended, a separate with_structured_output call over the finished conversation. create_agent produces the structured answer inside the loop, through the provider’s native structured output (ProviderStrategy) or a forced tool call (ToolStrategy), with no extra call.
Model hooks become middleware (Chapter 8). The deprecated prebuilt agent carries pre_model_hook= and post_model_hook=, one node either side of the model call. create_agent replaces them with a stack of middleware hooks: before_agent, before_model, after_model, and after_agent, plus wrap_model_call and wrap_tool_call, which wrap the call itself and have no predecessor. There is no mechanical rename for this, only a redesign onto the middleware Chapter 8 covers in full.
The deprecation timeline
The 1.x line follows semantic versioning with a stated stability promise: no breaking changes to the public API until a 2.0 release. create_react_agent is deprecated as of 1.0 and due for removal at 2.0; the warning it prints says so. The rest of langgraph.prebuilt is not deprecated: ToolNode and tools_condition import and run with no warning.
Read Chapter 26 before treating a specific 2.0 date as fact. As of this book’s writing no 2.0 release had shipped, and a confident claim to the contrary turned up during that chapter’s research and failed a basic consistency check against the pinned version. Build on the 1.x supported API now (create_agent from langchain.agents, system_prompt=, .content_blocks) so that whenever 2.0 does arrive, the migration is mechanical instead of a rewrite.
If something doesn’t import the way this book shows
Almost always, the installed environment mixes a 0.x install with 1.x-shaped code, or the reverse. Reinstall a clean virtual environment against the exact pins in “Using the Code Examples” before debugging further. Chapter 2’s version-assertion gate, scripts/check_versions.py (Appendix A), exists to catch this before it wastes an afternoon.