Why does modern LangChain split into `langchain-core`, `langchain-community`, and provider packages like `@langchain/openai`?
LangChain split into core + community + per-provider packages so apps only pull the vendor SDKs they actually use and provider integrations can ship on the vendor's release cadence.
Picture a hardware store that used to sell a single mega-toolbox with every tool ever made, even the ones you would never use. Lugging it around was painful and if any one tool was broken, the whole toolbox was held back. The store split the kit: a small core box with the handle and the basics, a community shelf with everyone's contributed gadgets, and separate cases for each brand's specialty tools. Now you grab just the basic kit plus the one brand case you need. When that brand ships a new tool, only their case updates. The rest of your gear stays the same.
Detailed answer & concept explanation~4 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
5 minutes: what each split package contains, the two production wins, the legacy meta package trap, and the migration path.
| Package | What it contains | Release cadence |
|---|---|---|
| langchain-core | Runnables, prompts, parsers, base interfaces | Slow, stable |
| langchain-community | Contributor-maintained integrations not yet promoted | Medium, contributor-driven |
| langchain-<provider> | One vendor's chat models, embeddings, tools | Tracks the vendor SDK |
| langchain (meta) | Re-exports from the above for legacy import paths | Lags the underlying packages |
Real products, models, and research that use this idea.
- LangChain's January 2024 split announcement that explicitly cited dependency hygiene and per-provider release cadence as the motivations.
- `@langchain/openai` in the JS ecosystem ships independently from `@langchain/core`, mirroring the Python pattern with package-scoped namespaces.
- Companies running LangChain on AWS Lambda commonly shave hundreds of MBs off the deployment artifact by switching from `langchain` to `langchain-core` + the one provider package they use.
- LlamaIndex went through a similar reorganisation around the same time, splitting into `llama-index-core` plus per-integration packages. The same architectural pressure produced the same shape twice.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you migrate a large codebase from `from langchain.chat_models import ChatOpenAI` to the split imports?
QWhat does `langchain-community` actually buy you that the per-provider packages do not?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Importing from `langchain` (the legacy meta-package) instead of `langchain-core` plus the specific provider packages, then wondering why your dependency tree pulls in vendor SDKs you do not use.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.