LangChain V1.x Explained: From Getting Started to Agent in Practice

LangChain V1.x integrates Agent capabilities and introduces a middleware system, lowering the development barrier.
LangChain's jump from 0.3 to V1.x integrates LangGraph's low-level Agent capabilities into LangChain, letting developers build agents directly via create_agent, while adding a middleware system for fine-grained control. The article covers the three frameworks' division of labor, the six core components, V1.x's six key updates, and built-in middleware like summarization and human approval. It also notes syntax differences between V1.0 and V1.1.
LangChain's jump from version 0.3 to V1.x is not a simple version number iteration, but an important repositioning of the framework. The most visible change is that Agent development, which previously required LangGraph, can now be done directly within LangChain itself, while the newly added middleware system makes process control much more granular. Based on content from a Bilibili tutorial, this article outlines the core updates and development approach of LangChain V1.x.
The LangChain Family and Version Evolution
The company behind LangChain has three main frameworks: LangChain, LangGraph, and LangSmith. LangChain and LangGraph are free and open source, handling RAG applications and Agent orchestration respectively; LangSmith targets deployment, maintenance, and monitoring, and is a commercial paid product.
V1.0 broke down the boundary between the two—many of LangGraph's low-level Agent operations were integrated into LangChain, so developers can build Agents directly in LangChain. If the requirement is a highly customized Agent with complex logic, LangGraph remains the more suitable choice.

LangGraph is a low-level orchestration framework launched by the LangChain team, specifically for building stateful, multi-step Agent workflows. It models an Agent's execution as a graph, where nodes represent operation steps and edges represent the transition conditions between steps, making it especially suitable for scenarios requiring loops, branching, human intervention, and other complex control flows. In the LangChain 0.3 era, developers who wanted to implement an Agent with a tool-calling loop usually had to directly use LangGraph APIs such as StateGraph to build it. V1.x encapsulates this capability into LangChain's create_agent interface, so simple Agents no longer require direct contact with graph structures; but when business logic requires custom nodes, conditional edges, or complex state management, using LangGraph directly remains the most flexible approach.
LangChain's Six Core Components
To understand LangChain's development workflow, the framework can be broken down into six parts: model wrappers, data augmentation, memory, Agents, chains, and callback handlers. Apart from callback handlers, which are used somewhat less frequently, the other components appear in almost every regular application.
Model wrappers handle interaction with large models and are compatible with OpenAI, Anthropic, and domestic platforms; data augmentation mainly serves RAG scenarios, covering document parsing and related steps; the memory component maintains context in multi-turn conversations; Agents handle intelligent agent behavior; and chains connect components through pipe syntax, so that the output on the left flows directly into the next component. This structure forms the basic skeleton of a LangChain application.
Six Key Updates in V1.x
Compared with version 0.3, V1.x's updates focus on six directions:
- Unified Agent creation interface: All Agents are created through the
create_agentfunction, with parameters such as model, tools, system prompt, and middleware passed in uniformly. - Middleware system: This is the most important foundation of V1.x and did not exist in version 0.3.
- Standardized output: Different models return different formats; V1.x standardizes content through unified properties.
- Structured output: Developers can customize the output structure and extract only the required fields.
- Built on LangGraph underneath: The underlying runtime mechanism of Agents is supported by LangGraph.
- API streamlining and migration: Redundant legacy modules are gradually migrated to LangChain Classic and may be phased out in future versions.
V1.1 adjusted the middleware syntax based on V1.0. For example, the parameter name of the summarization middleware changed from max_token_before_summary to trigger, and fields such as messages_to_keep also changed. V1.2's updates are smaller in scope, mainly tool property adjustments and stricter parameter validation for provider strategy. Running V1.0-style code on V1.2 may produce warnings, so pay attention when upgrading.
LangChain Classic is a compatibility layer package introduced in V1.x, used to house legacy APIs migrated out of the main package, such as LLMChain, old-style Agent initialization, and some deprecated tool wrappers. The purpose is to keep the V1.x main package streamlined and consistent in interface style while giving existing projects a migration buffer period. If developers still reference old syntax after upgrading, they need to import the corresponding modules from langchain-classic rather than directly from langchain. The official positioning of Classic is as a transitional solution, meaning these APIs may be completely removed in the future, so new projects should avoid depending on components in Classic, and existing projects should formulate a gradual replacement plan.
Middleware System: Fine-Grained Process Control
Middleware is essentially a set of hook functions inserted into the main flow, similar to the idea of AOP (aspect-oriented programming). In the Agent's main flow—receiving requests, calling models, calling tools, returning results—middleware allows custom operations to be inserted before entering the Agent, before calling the model, during tool calls, during model calls, and after completion.

Built-in middleware covers a variety of practical scenarios: summarization middleware automatically summarizes history in multi-turn conversations to avoid exceeding the model's context window; human-in-the-loop middleware introduces human approval before tool calls, supporting three operations—approve, edit, and reject—suitable for sensitive operations such as deleting a database; there is also middleware for limiting model call counts, limiting tool call counts, task planning, and more.
Taking summarization middleware as an example, developers can specify a dedicated model for summarization, the token threshold that triggers summarization, the number of recent messages to retain, and the summarization prompt. These parameters are all flexibly configurable.

In addition to built-in middleware, developers can also customize their own. There are two approaches: define hook functions with decorators, or inherit from the Agent's middleware base class and write a class. The latter requires implementing multiple middleware functions in the class and is suitable for more complex logic.

AOP (Aspect-Oriented Programming) is a programming paradigm whose core idea is to separate cross-cutting concerns—such as logging, permission checks, transaction management, and caching—from the main business logic, and weave them in uniformly at specified join points in the form of "aspects." In Agent scenarios, logic such as summarizing history, human approval, and call count limits are not part of the Agent's core reasoning steps, yet they need to be executed repeatedly before or after model calls or tool calls, which corresponds exactly to concepts such as "before advice," "after advice," and "around advice" in AOP. LangChain's middleware system borrows this idea: hook functions are triggered at fixed points in the Agent lifecycle, and developers can layer in common logic without modifying the Agent's main flow code, thereby keeping the main flow clear and reusable.
Standardized Output and Structured Output
Standardized output solves the multi-model compatibility problem. Content formats returned by different vendors are not consistent; for example, the same reasoning process may be represented as thinking by some models and reasoning by others. LangChain handles this uniformly through the content_blocks property, so developers do not need to care which underlying model is used when retrieving values, avoiding value retrieval failures caused by inconsistent field names.
Structured output goes a step further, allowing developers to define the target data structure. There are three implementation approaches: format output based on tool calling, provider-native format output, and automatic strategy selection. The tutorial demonstrates defining a class containing class properties, placing it into a tool strategy schema, and the final returned result is organized according to the preset structure.
Practical Recommendations
For teams currently using version 0.3, upgrading to V1.x requires attention to two points: first, old-style syntax such as LLMChain has been migrated to LangChain Classic and should be gradually replaced; second, the middleware API differs between V1.0 and V1.1, so when referring to documentation, confirm the corresponding version. New projects can be designed directly based on create_agent and the middleware system, using built-in middleware to reduce repetitive code.
LangChain V1.x's direction is clear: lower the barrier to Agent development while retaining LangGraph as the escape hatch for complex scenarios. For developers who want to quickly build usable Agents, this combination provides a smoother path.
One-line Summary
LangChain V1.x integrates Agent capabilities and introduces a middleware system, lowering the development barrier.
Paragraph Summary
LangChain's jump from 0.3 to V1.x centers on integrating LangGraph's low-level Agent capabilities into LangChain, letting developers build agents directly through create_agent, while adding a middleware system for fine-grained process control. The article outlines the division of labor among the three frameworks in the LangChain family, breaks down the six core components—model wrappers, data augmentation, memory, Agents, chains, and callback handlers—and details V1.x's six key updates: unified Agent interface, middleware, standardized output, structured output, built on LangGraph underneath, and API streamlining and migration. The middleware section covers built-in capabilities such as summarization, human-in-the-loop approval, and call count limits, as well as custom implementations. Standardized output unifies multi-model formats through content_blocks, and structured output supports custom field extraction. The article also notes that middleware syntax differs between V1.1 and V1.0, so compatibility needs attention when upgrading.
Related articles

Next.js 16.1 in Practice: Building the Frontend of an AI Event Booking App
Based on a Bilibili English tutorial, a complete breakdown of building the frontend for a Next.js 16.1 event booking app: create-next-app configuration, default template cleanup, Tailwind verification, Montserrat font and global font weight setup, plus practical tips.

LangChain+LangGraph+MCP+Agent Enterprise Practice: LLM Selection and Deployment Guide
Based on a Bilibili course, this guide analyzes LLM selection for enterprise LangChain, LangGraph, MCP, and Agent development, comparing DeepSeek and Qwen3 capabilities including Function Calling, MoE, thinking-mode switching, and MCP updates.

Half-Price USB-C EarPods: Why Wired Earphones Are Still a Practical Choice
Apple USB-C EarPods are half-price at Best Buy during Cyber Monday for just $9.99. This article analyzes the practical value of wired earphones in the wireless era, who they suit, and buying advice.