Ecosystem & Packages
|
This content was generated with the assistance of AI and should be verified against the official documentation of each tool and framework before being relied on in production. This section’s bibliography lists the reference material consulted while preparing these pages. |
This page was written against langchain 1.4.3, langchain-core 1.6.5, langchain-classic 1.0.8,
langchain-text-splitters 1.1.2, langgraph 1.2.12, langsmith 0.14.1, langchain-ollama 1.1.0 and
deepagents 0.7.19 on Python 3.12, plus langchain 1.5.14 and @langchain/langgraph 1.4.18 on npm and
LangChain4j 1.20.2 on Maven Central, all checked on 2026-09-29. Every Python snippet was executed in a fresh
virtual environment (or the shared one for deepagents) using a fake chat model, so the printed outputs are
canned; nothing here calls Ollama or a hosted provider. The running example is DocsAssistant from
Vector Databases & RAG, which uses Ollama’s llama3.1:8b chat model and
nomic-embed-text embedding model.
"LangChain" is no longer one package. Since the 1.0 release in October 2025 it is a family of small distributions with different jobs and different release cadences, and most import errors people hit come from installing the wrong subset or from following a pre-1.0 tutorial. This page is the map: what each distribution is for, when to install it, how old import paths translate to new ones, and how to prove the installation works.
The package map
batteries-included agent harness] LC[langchain
create_agent, middleware, init_chat_model] LG[langgraph
graphs, checkpointers, interrupts] CL[langchain-classic
legacy chains, retrievers, indexing, hub] P[partner packages
langchain-ollama, -openai, -anthropic ...] TS[langchain-text-splitters] CO[langchain-core
Runnable, messages, tools, base interfaces] LS[langsmith
tracing, datasets, evaluation client] DA --> LC LC --> LG LC --> CO LG --> CO CL --> CO CL --> TS TS --> CO P --> CO CO --> LS CL --> LS DA --> LS
The arrows come from the packages' own metadata. This script prints, for a few distributions, which LangChain-family packages they require, so you can check it against any version you have installed:
from importlib.metadata import requires
import re
for dist in ("langchain", "langgraph", "deepagents", "langchain-classic", "langchain-ollama"):
deps = sorted({re.split(r"[ <>=!;\[]", r)[0] for r in requires(dist) or []
if "extra ==" not in r
and re.split(r"[ <>=!;\[]", r)[0].startswith(("langchain", "langgraph", "langsmith", "deepagents"))})
print(f"{dist:18} requires {deps}")
Executed output:
langchain requires ['langchain-core', 'langgraph']
langgraph requires ['langchain-core', 'langgraph-checkpoint', 'langgraph-prebuilt', 'langgraph-sdk']
deepagents requires ['langchain', 'langchain-anthropic', 'langchain-core', 'langchain-google-genai', 'langsmith']
langchain-classic requires ['langchain-core', 'langchain-text-splitters', 'langsmith']
langchain-ollama requires ['langchain-core']
The dependency on langsmith (the tracing client) is pulled in through langchain-core, which is why
tracing needs no extra install. See LangChain’s
overview for how LangChain, LangGraph, Deep Agents and
LangSmith are positioned relative to each other.
What each package is for and when to install it
| Distribution | What it is | Install it when |
|---|---|---|
|
The agent-centred framework: |
You are building an agent or an LLM application. This is the default entry point, and the one most pages in this sub-section import from. |
|
The base abstractions: the Runnable protocol and LCEL, message types, the |
Almost never directly: it arrives with |
|
Everything the 1.0 release moved out of the |
You maintain code written for LangChain 0.x, or you need |
Partner packages ( |
One distribution per provider or integration, each depending only on |
You talk to that provider. Install only the ones you use; |
|
Text splitters such as |
You chunk documents for RAG. It is installed transitively by |
|
The low-level orchestration runtime: |
You need explicit control over the graph. |
|
The client for LangSmith: tracing ( |
Always available through |
|
A batteries-included agent harness built on |
The task is long-running and multi-step and you want those capabilities without wiring them yourself. Use plain
|
The official page for the split is the LangChain overview,
which states the rule of thumb: start with Deep Agents for a batteries-included agent, use create_agent for a
customizable harness, drop to LangGraph for mixed deterministic and agentic workflows, and use LangSmith to trace
and evaluate any of them. The graph runtime is described in the
LangGraph overview and in
LangGraph Fundamentals.
Partner packages and extras
Providers live in their own packages so that a new model does not need a new langchain release, and so that you
do not install SDKs you never call. The official
integrations overview lists the maintained
ones; each follows the langchain-<provider> naming. The langchain distribution also declares optional extras
that install the matching partner package (for example langchain[ollama], langchain[openai],
langchain[anthropic], langchain[mcp]), which is the shortest way to add one.
uv add langchain langchain-ollama langgraph langsmith
# or, without uv:
python -m pip install -U langchain langchain-ollama
See the official installation page for the supported Python versions and the provider packages.
A partner package plugs into the provider-agnostic factories in langchain itself. This snippet resolves
DocsAssistant’s two Ollama models by string; the objects are constructed lazily, so it needs no running server:
from langchain.chat_models import init_chat_model
from langchain.embeddings import init_embeddings
chat = init_chat_model("ollama:llama3.1:8b", temperature=0)
emb = init_embeddings("ollama:nomic-embed-text")
print(type(chat).__module__, type(chat).__name__, chat.model)
print(type(emb).__module__, type(emb).__name__)
Executed output:
langchain_ollama.chat_models ChatOllama llama3.1:8b
langchain_ollama.embeddings OllamaEmbeddings
If the partner package is missing, init_chat_model raises an ImportError that names the package to install (for example pip install langchain-anthropic). The
models themselves are covered in Chat Models & Messages and running
Ollama in Ollama. See the official
installation page.
Deep Agents
deepagents is a separate distribution and a separate release train (0.7.x while langchain is 1.4.x), so pin it
independently. It builds on langchain, and create_deep_agent returns a LangGraph graph you invoke like any other
agent. The fake model below only needs to tolerate bind_tools, which the harness calls to register its built-in
planning and filesystem tools:
from deepagents import create_deep_agent
from langchain_core.language_models.fake_chat_models import GenericFakeChatModel
from langchain_core.messages import AIMessage
class FakeToolModel(GenericFakeChatModel):
"""GenericFakeChatModel that tolerates bind_tools(); it never actually calls a tool."""
def bind_tools(self, tools, **kwargs):
return self
model = FakeToolModel(messages=iter([AIMessage("Deep agent is wired up.")]))
agent = create_deep_agent(model=model, system_prompt="You are DocsAssistant.")
out = agent.invoke({"messages": [{"role": "user", "content": "hi"}]})
print(out["messages"][-1].content)
Executed output:
Deep agent is wired up.
Its capabilities and when they pay off are covered in Multi-Agent & Deep Agents; the general framework comparison is in Agent Frameworks Landscape. See the official Deep Agents overview.
The v1 migration digest
LangChain 1.0 did three things: it made create_agent the standard way to build an agent, it added provider-neutral
content_blocks on messages, and it shrank the langchain namespace to agent essentials, moving the rest to
langchain-classic. The official
LangChain v1 migration guide states the new namespace:
langchain.agents (create_agent, AgentState), langchain.messages, langchain.tools,
langchain.chat_models (init_chat_model) and langchain.embeddings (init_embeddings). It also says that legacy
chains, retrievers, the indexing API, the hub module, CacheBackedEmbeddings and langchain-community
re-exports moved to langchain-classic. The remaining rows below are not listed by name in that guide; they were
resolved by importing them against the installed packages, which is why each row has a verified status.
| Concern | Old (0.x) | Now (1.x) |
|---|---|---|
Legacy chains |
|
|
Prompt hub |
|
|
Retrievers |
|
|
Multi-vector retrieval |
|
|
Self-querying retrieval |
|
|
Record manager |
|
|
Indexing function |
|
|
Text-to-SQL chain |
|
|
Pydantic models in tools and schemas |
|
|
Text splitters |
|
|
Prebuilt agent |
|
|
Nothing here has to be taken on trust. This script tries every pair on the installed environment and prints whether each resolves:
import importlib
def resolves(module: str, name: str) -> str:
try:
getattr(importlib.import_module(module), name)
return "ok"
except (ImportError, AttributeError):
return "missing"
CHECKS = [
("langchain_classic.chains", "LLMChain"),
("langchain_classic.retrievers", "MultiQueryRetriever"),
("langchain_classic.retrievers", "MultiVectorRetriever"),
("langchain_classic.retrievers.self_query.base", "SelfQueryRetriever"),
("langchain_classic.indexes", "SQLRecordManager"),
("langchain_classic.chains", "create_sql_query_chain"),
("langchain_core.indexing", "index"),
("langchain_text_splitters", "RecursiveCharacterTextSplitter"),
("langchain.agents", "create_agent"),
("langgraph.prebuilt", "create_react_agent"),
("pydantic", "BaseModel"),
("langchain.chains", "LLMChain"),
("langchain.retrievers", "MultiQueryRetriever"),
("langchain.text_splitter", "RecursiveCharacterTextSplitter"),
("langchain_core.pydantic_v1", "BaseModel"),
]
for module, name in CHECKS:
print(f"{resolves(module, name):8} from {module} import {name}")
from langchain_classic import hub
print("ok from langchain_classic import hub ->", hub.__name__)
Executed output:
ok from langchain_classic.chains import LLMChain
ok from langchain_classic.retrievers import MultiQueryRetriever
ok from langchain_classic.retrievers import MultiVectorRetriever
ok from langchain_classic.retrievers.self_query.base import SelfQueryRetriever
ok from langchain_classic.indexes import SQLRecordManager
ok from langchain_classic.chains import create_sql_query_chain
ok from langchain_core.indexing import index
ok from langchain_text_splitters import RecursiveCharacterTextSplitter
ok from langchain.agents import create_agent
ok from langgraph.prebuilt import create_react_agent
ok from pydantic import BaseModel
missing from langchain.chains import LLMChain
missing from langchain.retrievers import MultiQueryRetriever
missing from langchain.text_splitter import RecursiveCharacterTextSplitter
missing from langchain_core.pydantic_v1 import BaseModel
ok from langchain_classic import hub -> langchain_classic.hub
The first eleven lines are the "Now" column; the last four are the removed "Old" paths. The old from langchain import
hub form fails on 1.x. Two caveats: langchain-classic exists to keep legacy code running, so treat it as a bridge
rather than a destination, and the vector-store, embedding and retriever classes that DocsAssistant actually uses
are in partner packages and langchain-core, not in langchain-classic; see
Integrating with LangChain for that surface. See the
official migration guide and the
What’s new in LangChain v1 page.
From create_react_agent to create_agent
Tutorials written before late 2025 build agents with langgraph.prebuilt.create_react_agent. It still
imports in LangGraph 1.2, but it emits a deprecation warning and is scheduled for removal in LangGraph 2.0. The
argument that carries the system prompt was renamed from prompt to system_prompt; the migration guide’s
create_agent section documents the other differences (middleware in place of hooks, state_schema, dynamic model
selection, and the tool-error and structured-output changes):
import warnings
from langchain.agents import create_agent
from langchain_core.language_models.fake_chat_models import GenericFakeChatModel
from langchain_core.messages import AIMessage
from langgraph.prebuilt import create_react_agent
question = {"messages": [{"role": "user", "content": "What is pgvector?"}]}
# Old: still importable, but deprecated
with warnings.catch_warnings(record=True) as caught:
warnings.simplefilter("always")
old = create_react_agent(
GenericFakeChatModel(messages=iter([AIMessage("A PostgreSQL extension.")])),
tools=[],
prompt="You are DocsAssistant.",
)
print("deprecation:", caught[0].message)
print(old.invoke(question)["messages"][-1].content)
# New: LangChain 1.x
new = create_agent(
model=GenericFakeChatModel(messages=iter([AIMessage("A PostgreSQL extension.")])),
tools=[],
system_prompt="You are DocsAssistant.",
)
print(new.invoke(question)["messages"][-1].content)
Executed output:
deprecation: create_react_agent has been moved to `langchain.agents`. Please update your import to `from langchain.agents import create_agent`. Deprecated in LangGraph V1.0 to be removed in V2.0.
A PostgreSQL extension.
A PostgreSQL extension.
create_agent and its middleware hooks are the subject of
Agents with create_agent and
Middleware. See the official
migration guide’s create_agent section.
Install and smoke test
A smoke test is worth running whenever you create an environment, change a version pin, or upgrade across a major release, because most breakage in this ecosystem shows up as an import error rather than a behaviour change. Create an isolated environment, install the packages from the map that you need, and run the script below. The commands used for the verification on this page were:
uv venv --python 3.12 .venv
uv pip install --python .venv/bin/python -U langchain langchain-ollama langchain-classic langsmith
.venv/bin/python smoke.py
The smoke test does four things: prints the installed versions, imports one name from every package, confirms a pre-1.0 path is gone, and runs a real (fake-model) agent and a two-node LangGraph graph end to end. Tracing is left off, so no LangSmith account is needed.
"""Install smoke test: versions, import paths, and one tiny end-to-end run with a fake model."""
from importlib.metadata import version
# Which distributions are installed, and at which version?
for dist in ("langchain", "langchain-core", "langchain-classic", "langchain-text-splitters",
"langgraph", "langsmith", "langchain-ollama"):
print(f"{dist:26} {version(dist)}")
# The v1 import paths resolve, and the removed ones really are gone.
from langchain.agents import create_agent # langchain
from langchain.chat_models import init_chat_model # langchain
from langchain.tools import tool # re-exported from core
from langchain_core.messages import AIMessage, HumanMessage # langchain-core
from langchain_text_splitters import RecursiveCharacterTextSplitter # langchain-text-splitters
from langchain_classic.chains import LLMChain # langchain-classic
from langchain_ollama import ChatOllama, OllamaEmbeddings # partner package
from langgraph.graph import StateGraph, START, END # langgraph
from langsmith import traceable # langsmith
try:
import langchain.chains # noqa: F401
except ModuleNotFoundError as e:
print("langchain.chains ->", e)
# One agent run, no network: a fake chat model answers.
from langchain_core.language_models.fake_chat_models import GenericFakeChatModel
model = GenericFakeChatModel(messages=iter([AIMessage("pgvector is a PostgreSQL extension for vector search.")]))
agent = create_agent(model=model, tools=[], system_prompt="You are DocsAssistant.")
result = agent.invoke({"messages": [HumanMessage("What is pgvector?")]})
print([type(m).__name__ for m in result["messages"]])
print(result["messages"][-1].content)
# A two-node LangGraph graph, to prove langgraph itself is wired up.
from typing import TypedDict
class State(TypedDict):
text: str
def shout(state: State) -> State:
return {"text": state["text"].upper()}
g = StateGraph(State)
g.add_node("shout", shout)
g.add_edge(START, "shout")
g.add_edge("shout", END)
print(g.compile().invoke({"text": "ok"}))
Executed output, from a fresh environment created with the commands above:
langchain 1.4.3
langchain-core 1.6.5
langchain-classic 1.0.8
langchain-text-splitters 1.1.2
langgraph 1.2.12
langsmith 0.14.1
langchain-ollama 1.1.0
langchain.chains -> No module named 'langchain.chains'
['HumanMessage', 'AIMessage']
pgvector is a PostgreSQL extension for vector search.
{'text': 'OK'}
When something fails, the message usually identifies the cause. ModuleNotFoundError: No module named
'langchain.chains' (or .retrievers, .text_splitter, .memory) means the code predates 1.0: apply the table
above. No module named 'langchain_ollama' means the partner package is missing. ImportError mentioning
greenlet when importing SQLRecordManager means the async SQLAlchemy engine needs pip install greenlet.
Pin what you verified: in application code, record the tested versions in a lock file (uv lock) and upgrade
langchain, langchain-core and langgraph together, since langchain constrains the other two to a range.
The versioning policy is described in the official
versioning page.
JavaScript and Java package names
The same ideas exist outside Python, with different names.
| Package | Role |
|---|---|
|
The agent framework ( |
|
Base abstractions (Runnables, messages, tools), the counterpart of |
|
Legacy abstractions moved out of |
|
Graph orchestration, the counterpart of |
|
Partner packages, scoped under |
|
Tracing and evaluation client, and the Deep Agents harness. |
The JavaScript ecosystem is covered on LangChain.js; see the official JavaScript installation page.
LangChain4j is an independent Java project inspired by LangChain, not a port with the same release train, so none
of the Python versions above apply to it. Its artifacts share the Maven group dev.langchain4j; the core and model
modules follow the 1.20.x line while the agentic, MCP, pgvector and Spring Boot starter modules were still
published with a -beta30 suffix on 2026-09-29.
| Artifact | Role |
|---|---|
|
Bill of materials that aligns the module versions; import it instead of pinning each one. |
|
The high-level API: AI Services, chat memory, tools, RAG building blocks. |
|
Model providers, the counterpart of the Python partner packages. |
|
The pgvector embedding store used by DocsAssistant. |
|
Agent workflows and the Model Context Protocol client. |
|
Spring Boot auto-configuration; Quarkus uses the separate Quarkiverse extensions (group
|
The Java modules are covered on LangChain4j and LangChain4j Agents & MCP. See the LangChain4j getting started page.