Heuristic:Langchain ai Langchain Warning Deprecated Langchain Classic
| Knowledge Sources | |
|---|---|
| Domains | Deprecation, Migration |
| Last Updated | 2026-02-11 14:00 GMT |
Overview
The `langchain_classic` package (formerly `langchain`) is deprecated. All classes have been moved to `langchain-core`, `langchain-community`, or dedicated partner packages.
Description
The `langchain_classic` package is the renamed legacy `langchain` package. Its public surface is a compatibility shim that re-exports classes from their new locations while emitting deprecation warnings. The `BaseMemory` class is explicitly decorated with `@deprecated(since="0.3.3", removal="1.0.0")`. The `ModelLaboratory` class and `hub.py` push/pull functions remain functional but are part of the deprecated package.
Usage
Apply this warning when encountering any import from `langchain_classic`. Users should migrate to the specific packages where classes now live (e.g., `langchain-core`, `langchain-openai`, `langchain-community`).
The Insight (Rule of Thumb)
- Action: Replace all `from langchain_classic import X` with imports from the appropriate new package.
- Value: `BaseMemory` removal scheduled for v1.0.0. Other re-exports may break without notice.
- Trade-off: Migration requires updating imports across codebases, but avoids breakage on LangChain v1.0.0 release.
- Pattern: Check `langchain_classic.__init__.py` for the mapping of old imports to new locations.
Reasoning
LangChain underwent a major modularization, splitting the monolithic `langchain` package into focused packages (`langchain-core`, partner integrations, `langchain-community`). The `langchain_classic` package exists solely for backward compatibility and will be removed. The `surface_langchain_deprecation_warnings()` function in `__init__.py` actively warns users on import.