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

flowchart TD DA[deepagents
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
Figure 1. How the Python distributions depend on each other (a solid arrow means "requires")

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:

Reading the dependency edges from installed metadata
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

Table 1. The LangChain-family distributions
Distribution What it is Install it when

langchain

The agent-centred framework: create_agent, middleware, init_chat_model, init_embeddings, and re-exports of messages and tools. Requires langchain-core and langgraph. Python 3.10 or later.

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.

langchain-core

The base abstractions: the Runnable protocol and LCEL, message types, the @tool decorator, prompt templates, base classes for chat models, embeddings, retrievers and vector stores.

Almost never directly: it arrives with langchain or any partner package. Depend on it explicitly only when you publish your own integration or a library that must not pull in the agent framework.

langchain-classic

Everything the 1.0 release moved out of the langchain namespace: legacy chains such as LLMChain, the langchain.retrievers classes, the indexing API, the hub module and the older memory classes.

You maintain code written for LangChain 0.x, or you need MultiVectorRetriever, SelfQueryRetriever, SQLRecordManager or create_sql_query_chain, which are no longer in the slimmed langchain namespace. New code should avoid it.

Partner packages (langchain-ollama, langchain-openai, langchain-anthropic, langchain-google-genai, langchain-huggingface, langchain-mcp-adapters, …​)

One distribution per provider or integration, each depending only on langchain-core. They implement the standard chat-model, embedding-model, vector-store and tool interfaces.

You talk to that provider. Install only the ones you use; langchain-ollama for DocsAssistant, plus one hosted provider if you also call claude-sonnet-5 or gpt-6-sol.

langchain-text-splitters

Text splitters such as RecursiveCharacterTextSplitter. A separate distribution that depends on langchain-core.

You chunk documents for RAG. It is installed transitively by langchain-classic, but declare it yourself if you import it. Chunking strategy itself is covered in Document Ingestion & Chunking.

langgraph

The low-level orchestration runtime: StateGraph, checkpointers, interrupt(), streaming, and the prebuilt pieces. Requires langchain-core; it also installs langgraph-checkpoint, langgraph-prebuilt and langgraph-sdk.

You need explicit control over the graph. langchain already installs it, so create_agent agents are LangGraph graphs under the hood; install it directly when you build without langchain at all.

langsmith

The client for LangSmith: tracing (@traceable), datasets, experiments and prompt management. It does not depend on any other LangChain package.

Always available through langchain-core. Configure it (an API key and the tracing switch) when you want traces. The langsmith[pytest] extra adds the pytest plugin.

deepagents

A batteries-included agent harness built on langchain: a virtual filesystem, planning, subagents, context summarization and long-term memory. Requires Python 3.11 or later and pulls in the Anthropic and Google GenAI partner packages.

The task is long-running and multi-step and you want those capabilities without wiring them yourself. Use plain create_agent for short, focused agents.

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.

Installing LangChain with the packages DocsAssistant needs
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:

Provider-prefixed model strings resolve to the partner package’s classes
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:

Building a deep agent against a fake model
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.

Table 2. Old import to new import (verified by import against the versions above)
Concern Old (0.x) Now (1.x)

Legacy chains

from langchain.chains import LLMChain

from langchain_classic.chains import LLMChain, or rewrite as an LCEL pipeline or create_agent

Prompt hub

from langchain import hub

from langchain_classic import hub (deprecated, and a thin wrapper over the LangSmith client); prefer langsmith.Client().pull_prompt(…​)

Retrievers

from langchain.retrievers import MultiQueryRetriever

from langchain_classic.retrievers import MultiQueryRetriever

Multi-vector retrieval

from langchain.retrievers import MultiVectorRetriever

from langchain_classic.retrievers import MultiVectorRetriever

Self-querying retrieval

from langchain.retrievers.self_query.base import SelfQueryRetriever

from langchain_classic.retrievers.self_query.base import SelfQueryRetriever

Record manager

from langchain.indexes import SQLRecordManager

from langchain_classic.indexes import SQLRecordManager (needs greenlet on some platforms for its async SQLAlchemy engine)

Indexing function

from langchain.indexes import index

from langchain_core.indexing import index, or from langchain_classic.indexes import index

Text-to-SQL chain

from langchain.chains import create_sql_query_chain

from langchain_classic.chains import create_sql_query_chain

Pydantic models in tools and schemas

from langchain_core.pydantic_v1 import BaseModel

from pydantic import BaseModel (plain Pydantic v2; the pydantic_v1 shim is gone)

Text splitters

from langchain.text_splitter import RecursiveCharacterTextSplitter

from langchain_text_splitters import RecursiveCharacterTextSplitter

Prebuilt agent

from langgraph.prebuilt import create_react_agent

from langchain.agents import create_agent

Nothing here has to be taken on trust. This script tries every pair on the installed environment and prints whether each resolves:

Checking each import path against the installed packages
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):

The same DocsAssistant agent before and after the migration
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:

Creating a clean environment and installing the packages
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.

smoke.py: versions, imports and a tiny end-to-end run
"""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.

Table 3. LangChain.js on npm (versions checked 2026-09-29)
Package Role

langchain (1.5.14)

The agent framework (createAgent and middleware), the counterpart of the Python langchain distribution.

@langchain/core (1.2.13)

Base abstractions (Runnables, messages, tools), the counterpart of langchain-core.

@langchain/classic (1.0.50)

Legacy abstractions moved out of langchain in 1.0, the counterpart of langchain-classic.

@langchain/langgraph (1.4.18)

Graph orchestration, the counterpart of langgraph.

@langchain/ollama, @langchain/openai, @langchain/anthropic, @langchain/mcp-adapters

Partner packages, scoped under @langchain/.

langsmith (0.10.5), deepagents (1.14.1)

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.

Table 4. LangChain4j artifacts (dev.langchain4j, versions checked 2026-09-29)
Artifact Role

langchain4j-bom (1.20.2)

Bill of materials that aligns the module versions; import it instead of pinning each one.

langchain4j (1.20.2)

The high-level API: AI Services, chat memory, tools, RAG building blocks.

langchain4j-ollama (1.20.2), langchain4j-open-ai (1.20.2)

Model providers, the counterpart of the Python partner packages.

langchain4j-pgvector (1.20.2-beta30)

The pgvector embedding store used by DocsAssistant.

langchain4j-agentic (1.20.2-beta30), langchain4j-mcp (1.20.2-beta30)

Agent workflows and the Model Context Protocol client.

langchain4j-spring-boot-starter (1.20.2-beta30)

Spring Boot auto-configuration; Quarkus uses the separate Quarkiverse extensions (group io.quarkiverse.langchain4j).

The Java modules are covered on LangChain4j and LangChain4j Agents & MCP. See the LangChain4j getting started page.