Migration of LangChain V0.x to LTS V1
AI
11/29/2025
Reasons for Architectural Redesign
LangChain started in late 2022 as an open‑source framework to make it easier to plug Large Language Models (LLMs) into real applications, and it grew extremely fast because developers could suddenly compose prompts, models, tools, and data sources in a single place.
Dozens of vector databases, model providers, document loaders, and tools were all supported under the same umbrella in an early version V0.x. The framework attracted a large, active community of contributors, tutorials, and example projects.
The downside of that success was that the original “all in one” architecture became unwieldy. Every new integration or feature added weight to the core package, making upgrades risky and slowing down the pace of internal improvements.
Versioning
Version 1 (V1) was released at the end of October 2025 with the goal of stabilizing the ecosystem. Before that, LangChain underwent a lengthy “V0.x” phase, including the 0.0.x through 0.3 releases that many still refer to as the “pre‑V1 LangChain.”
Packaging Philosophies
LangChain used to put almost everything in a single langchain package (chains, embeddings, loaders, vector stores, integrations) in V0.x. Over time, that became hard to maintain and slow to evolve, so in V1 they:
- moved core primitives into langchain-core
- moved integrations into langchain-community
- kept older patterns (classic chains, old imports) in a separate langchain-classic package.
V1 is the first major release with strict semantic versioning and long‑term support guarantees. Hence, V1.0 is an LTS line.
The V1 split is essentially a modularization step:
- core abstractions (prompts, messages, runnables, chains) live in a small, stable package
- community integrations can evolve independently
- legacy APIs are isolated so existing code can be maintained without blocking new design decisions
From an architectural point of view, this transition makes sense because it separates concerns and clarifies responsibilities. Application code can depend mostly on the lean core, infrastructure teams can plug in whatever vector stores or model backends they prefer via community integrations, and teams with older projects can opt into the classic layer only when needed.
Consequences and Future Outlook
It’s painful in the short term to migrate the code base. Many old examples break, as I had to experience myself. Migration takes effort, but it lays a cleaner foundation for long‑lived, production‑grade LLM applications.
As an update to my first article about Hybrid Large Language Model developed in V0.1-0.3 to query documents (https://www.linkedin.com/pulse/hybrid-large-language-model-query-regulatory-medical-dirk-fyiwe/, I have now migrated to V1, and revised my setup procedure for Ubuntu in bash as described in the next chapter.
Setting Up the LangChain Pipeline in V1
Update packages by first bringing the dependencies up to date:
sudo apt update
Install Python 3.12 and virtual environment tools (Ubuntu 24.04+):
sudo apt install python3.12 python3.12-venv python3.12-dev
Verify that Python was successfully installed:
python3.12 --version
Create a project folder:
mkdir my_rag_project
Move into the project folder:
cd my_rag_project
Create and activate virtual environment:
python3.12 -m venv langchain_env
source langchain_env/bin/activate
Create a basic folder structure:
mkdir scripts documents images embeddings_cache
Install LangChain packages (inside venv)
pip install "langchain>=1.1.0" langchain-core langchain-community langchain-openai
pip install faiss-cpu langchain-text-splitters python-dotenv
pip install pillow
Add the .env file (containing the API key etc.) by copying it from a previous project:
cp ~/<other_folder>/my_rag_project/.env .
Save the Python script langchain_rag.py containing the LangChain model into:
scripts/langchain_rag.py
Run the RAG app (from project root, venv active):
python scripts/langchain_rag.py
Script to Set Up a New Instance of RAG and Environment
Doing many manual tasks on the bash command line to set up the LangChain RAG system is error-prone, so I wrote an installation script that unifies all configuration and installation steps seen above.
Changes in the Python Code
The changes to the V1 code compared to V0.x is specifically in the header section with the imports:
from dotenv import load_dotenv
from langchain_community.document_loaders import TextLoader
from langchain_community.vectorstores import FAISS
from langchain_text_splitters import MarkdownTextSplitter
from langchain_openai import OpenAIEmbeddings, ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.output_parsers import StrOutputParser
from langchain_core.runnables import RunnableParallel, RunnablePassthrough
from langchain_core.documents import Document
from langchain_core.messages import HumanMessage
# Load environment variables
load_dotenv()
In addition, I switched from GPT-4 to GPT-4o:
self.llm = ChatOpenAI(model="gpt-4o", temperature=0)
The model GPT-4o mainly gives better speed, much lower cost, and native multi-modal support, while keeping roughly GPT‑4‑level intelligence for most everyday tasks.
Source Code
The source code and detailed explanations of the code architecture can be viewed at my GitHub repo, see https://github.com/DirkMueller8/langchain_rag
Summary
With the move to LangChain V1, the RAG system is now up to date and benefits from long‑term support, providing a more stable foundation. This makes it easier to build local applications that let users chat with a variety of documents in a chatbot‑like interface
Go back