跪拜 Guibai
← All articles
LangChain · AI编程

LangChain 1.0 Killed the Chain: What Every Tutorial Still Gets Wrong

By K7 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Any developer with existing LangChain code will hit deprecation warnings and a split API surface after 1.0, and following outdated tutorials now teaches a pattern the official framework has abandoned. The practical decision between freezing, migrating, or rewriting has real maintenance and debugging costs that the community is only starting to map out.

Summary

LangChain 1.0, released alongside LangGraph in July 2026, splits the framework: the main langchain package now contains only the core building blocks for agents, while Chains, Retrievers, and Indexing get exiled to langchain-classic. The recommended way to build is now create_agent, which wraps a basic agent loop that calls the model, lets the model pick tools, executes them, and stops when the model is done. The old pipeline style of prompt | model | output_parser disappears because the loop is now internal to the agent.

For existing projects, the upgrade forces a three-way choice: freeze the version, migrate gradually by keeping old code on langchain-classic while adopting 1.0 for new features, or rewrite everything with create_agent. The article argues freezing is short-term debt, gradual migration is the most realistic for large systems, and rewriting is best left to small projects or prototypes. It also warns that the loss of Chain comes with trade-offs: lower visibility into the exact steps, harder debugging because you have to understand middleware and state, and a steeper learning curve for beginners who now start with the agent loop instead of explicit pipelines.

The author's parting advice: don't learn from old Chain tutorials; start new projects directly with create_agent. But keep the Chain mindset as a way to reason about flows, even though the framework abstraction is gone.

Takeaways
— LangChain 1.0 moved Chains, Retrievers, and Indexing into the langchain-classic package; the main langchain package now only includes agent-building primitives.
— create_agent has replaced langgraph.prebuilt.create_react_agent as the single official entry point for building agents.
— The basic agent loop is built in: model call, tool selection, tool execution, and termination when no more tools are called.
— Old code that imports LLMChain from langchain is importing a legacy artifact; the code runs but is officially deprecated.
— Three upgrade paths exist for existing projects: freeze the version, migrate gradually with langchain-classic for old code and 1.0 for new features, or rewrite using create_agent.
— Gradual migration is the most realistic for medium-to-large production systems; rewriting is only recommended for small projects or prototypes.
— Losing Chain reduces explicit control over the execution flow and shifts debugging effort toward understanding middleware, state, and checkpoints inside the agent loop.
— Beginners face a steeper learning curve because 1.0 tutorials start with agent loops rather than the more intuitive pipe-based pipeline style.
Conclusions

The framework's shift from explicit pipelines to an internal loop makes debugging more opaque; the author argues this is a net loss for control, even if it simplifies the happy path.

The real advice is not to rewrite old code but to avoid learning from old tutorials; the biggest trap is that tutorials age silently without a visible error.

The three-path framework (freeze, migrate, rewrite) is a realistic decision matrix, but the author's verdict that migration is "most realistic" depends on the assumption that the project is still actively maintained, which isn't true for all legacy systems.

The claim that "Chain as a thinking tool survives" is a pragmatic compromise: you still need to mentally decompose a process into steps, even if the framework no longer forces you to code each step explicitly.

Concepts & terms
Basic agent loop
The core execution pattern in LangChain 1.0's create_agent: the model repeatedly decides to call a tool, the tool runs, its result is fed back to the model, and the loop ends when the model no longer requests a tool. This loop is now internal to the framework, replacing the explicit Chain abstraction.
langchain-classic
A separate package in LangChain 1.0 that hosts the legacy components (Chains, Retrievers, Indexing) that were removed from the main langchain package. It exists so existing code can keep running without a full rewrite, but new development is directed away from it.
create_agent
The official entry point in LangChain 1.0 for building agents. It takes a model, a list of tools, and a system prompt, and returns an agent object that can be invoked with messages. It replaces the previous prebuilt create_react_agent and the Chain-based manual composition.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗