If you've worked with LangChain before or are following older tutorials, you'll notice that the framework's structure has changed significantly. LangChain has been split into multiple focused packages, each with a clear responsibility. This note explains the new package structure, why the change was made, and how to adapt your imports and project organization.
The New LangChain Ecosystem
LangChain is no longer a single monolithic package. Instead, its functionality is distributed across several specialized packages:
langchain
This is the core application layer for building large language model (LLM) applications. It includes:
Chains
Agents
Prompts
Output Parsers
Retrieval abstractions
High-level orchestration
Think of langchain as the place for high-level application logic.
langchain-core
This foundational package contains the shared abstractions and interfaces used throughout the ecosystem. It provides:
Base classes
Message types
Document representations
Runnables (executable components)
Prompt and tool interfaces
Callback mechanisms
Importantly, langchain-core does not include any provider-specific code or integrations.
langchain-community
This package is the home for community-maintained integrations and tools. It includes connectors and utilities for a wide range of third-party systems, such as:
FAISS (vector store)
Chroma
Ollama
Hugging Face
Various document loaders
Other third-party vector stores and tools
Gotcha:
Instead of importing integrations like FAISS fromlangchain.vectorstores, you now import fromlangchain_community.vectorstores.
# Old way
from langchain.vectorstores import FAISS
# New way
from langchain_community.vectorstores import FAISS
Provider Packages
Each major provider now has its own dedicated package, making dependencies and updates more manageable. Examples include:
langchain-openailangchain-anthropiclangchain-google-genailangchain-qdrantlangchain-pineconelangchain-mongodblangchain-postgres
For example, to use OpenAI's chat models and embeddings:
from langchain_openai import ChatOpenAI
from langchain_openai import OpenAIEmbeddings
This replaces the older approach:
from langchain.chat_models import ChatOpenAI
Why Did They Split It?
The previous monolithic langchain package had several drawbacks:
Heavy installations with many unnecessary dependencies
Frequent breaking changes affecting all users
Slow release cycles, as all updates were tied together
Provider updates blocked by the main package's release schedule
Users had to install packages they didn't need
By splitting the framework:
✅ Releases are faster and more focused
✅ Installations are smaller and lighter
✅ Providers can update independently
✅ Dependency management is cleaner
✅ The ecosystem is more maintainable long-term
Old vs New Imports
Here's a quick comparison of how imports have changed:
Old:
from langchain.chat_models import ChatOpenAI
from langchain.embeddings import OpenAIEmbeddings
from langchain.vectorstores import FAISS
New:
from langchain_openai import ChatOpenAI
from langchain_openai import OpenAIEmbeddings
from langchain_community.vectorstores import FAISS
Rule of Thumb: Ecosystem Overview
Package | Purpose |
|---|---|
| Core interfaces and abstractions |
| Chains, agents, prompts, orchestration |
| Community-maintained integrations |
| Official provider implementations (OpenAI, etc) |
Key Takeaways
Don't rely on old tutorials that import everything from
langchain.Use the new, smaller packages for provider-specific functionality.
The new structure makes your applications cleaner, lighter, and easier to maintain.
Understand which package to use for each part of your application: core abstractions, high-level logic, community tools, or provider integrations.