Skip to main content

Package Layout

LangChain's packages form a dependency tree. Understanding the direction of that tree tells you which package to import an abstraction from, and which packages are safe to depend on for the long term.

Every arrow points at langchain-core. That is the stability contract:

TierStabilityImport abstractions from it?
langchain-coreMost stable — breaking changes are rare and loudly flaggedYes. Runnable, BaseMessage, BaseChatModel all live here
langchainStable within a major versionFor chains, agents, and orchestration helpers
Partner packages (langchain-openai, langchain-anthropic, ...)Stable, maintained by the provider or LangChain teamFor provider-specific model/embedding classes
langchain-communityNo stability guarantee — anyone can contribute an integration hereOnly when no partner package exists for what you need
tip

When you're writing type hints or building an abstraction that should work across providers, import from langchain-core (e.g. from langchain_core.language_models import BaseChatModel), not from a specific partner package. That is the one piece of the tree every provider package already depends on.

See also