3.1

Install and the package map

Install langchain 1.5.0 on Python 3.11 or later from a lockfile, because the stack is many packages with separate versions, and a minor release can change behaviour.

You copy from langchain.chains import LLMChain from an older answer, and Python raises ModuleNotFoundError. You install langchain-community to get a loader, and then read that the package is sunset. You run the same pip install on Python 3.10 and on 3.12, and you get two different versions of langchain.

When you finish this section, you can say which package holds each import and install the stack at the pin. You can also say why it needs a lockfile.

The package map

Distribution: a package as pip names it, such as langchain-core. Its import name has _ in place of -, such as langchain_core.

The stack splits across these distributions at the pin:

DistributionVersionImportWhat it holds
langchain1.5.0langchaincreate_agent, middleware, init_chat_model, langchain.mcp, and short import paths for messages and tools
langchain-core1.8.0langchain_coremessages and content blocks, BaseChatModel, tools, callbacks, documents, retrievers, embeddings, and the fake models
langgraph1.2.22langgraphStateGraph, the Pregel loop, Command, Send, interrupt, the functional API, and streaming
langgraph-prebuilt1.1.2langgraph.prebuiltToolNode, ToolRuntime, InjectedState, and the deprecated create_react_agent
langgraph-checkpoint4.3.2langgraph.checkpoint, langgraph.storethe saver interface, InMemorySaver, the serializers, and InMemoryStore
langgraph-checkpoint-sqlite3.1.3langgraph.checkpoint.sqliteSqliteSaver and SqliteStore
langgraph-checkpoint-postgres3.2.1langgraph.checkpoint.postgresPostgresSaver and PostgresStore
langsmith0.14.17langsmiththe tracing client, traceable, and evaluate
deepagents0.7.38deepagentscreate_deep_agent, its backends, and its middleware
langchain-text-splitters1.1.3langchain_text_splittersthe text splitters
langchain-classic1.0.8langchain_classicthe 0.3 namespace: chains, legacy agents, the prompt hub module, and old memory classes

Each provider has its own package, such as langchain-openai 1.8.0, langchain-anthropic 1.7.10, and langchain-ollama 1.1.0. They live in the same repository as langchain, but each is released from its own tag. At the langchain 1.5.0 tag, the OpenAI package in the tree is still 1.7.4. The versions of langchain-classic 1.0.8 and langchain-community 0.4.2 come from PyPI, not from the capture of versions.

langgraph, langgraph-prebuilt, langgraph-checkpoint, and langgraph-checkpoint-postgres came from one commit at the pin, with four different version numbers. Figure 3.1 shows what each package requires.

Fig. 3.1what each package requires at the pintree
What each package requires at the pin A dependency tree. deepagents 0.7.38 requires langchain 1.5 or later, langchain-anthropic 1.7.10 or later, langchain-google-genai 4.4.3 or later, and langsmith 0.14.17 or later. langchain 1.5.0 requires langchain-core 1.8 or later and langgraph from 1.2.12 to below 1.3, with the extras openai, anthropic, ollama, and mcp drawn dashed. langgraph 1.2.22 requires langchain-core 1.4.7 or later, langgraph-checkpoint 4.3 to below 5, langgraph-prebuilt 1.1 to below 1.2, and langgraph-sdk 0.4.6 to below 0.5. langchain-core 1.8.0 requires langsmith 0.14.9 to below 1, langchain-protocol 0.0.20 or later, and pydantic 2.7.4 to below 3. deepagents 0.7.38 optional harness langchain 1.5.0 create_agent extras openai, ollama, mcp two providers anthropic, google-genai langgraph 1.2.22 >=1.2.12,<1.3.0 langchain-core 1.8.0 >=1.8.0,<2 checkpoint 4.3.2 >=4.3.0,<5 prebuilt 1.1.2 >=1.1.0,<1.2.0 sdk 0.4.14 >=0.4.6,<0.5.0 langsmith 0.14.17 >=0.14.9,<1 langchain-protocol >=0.0.20 pydantic 2.14.3 >=2.7.4,<3 Arrows read as requires, with the declared range under each name. deepagents also requires langsmith >=0.14.17 and langchain >=1.5.0.
Installing deepagents pulls in langchain, two provider packages, and langsmith, and installing langchain pulls in langgraph, which needs langchain-core. Read each arrow as requires, with the range that the package declares. Grey boxes are outside LangChain. Dashed boxes are optional extras.

What moved

Old imports moved out of langchain at 1.0, and three repositories were archived in 2026.

  • Chains and legacy agents. LLMChain, AgentExecutor, the indexing API, and the hub module are in langchain-classic, under langchain_classic.
  • Community integrations. langchain-community 0.4.2 is the last release, and its repository is archived. Its README says that the package is sunset. It still installs, and it still depends on langchain-classic.
  • The MCP adapter. langchain-mcp-adapters is archived. The changelog says that langchain 1.4.0 added langchain.mcp in its place. At the pin, the extra langchain[mcp] installs it. Do not install both in one environment, because the old adapter requires mcp below 2.
  • The LangSmith SDK repository. langsmith-sdk is archived, and the Python client now lives in langsmith-python. The package name langsmith did not change.

create_react_agent from langgraph.prebuilt still imports, and it warns that it moved to create_agent. Section 1.3 shows the agent that replaces it.

Python 3.11

Python floor: the oldest Python version that a package declares in requires-python.

The documentation disagrees with the packages about the floor. The install page shows pip install -U langchain with a comment that it needs Python 3.10 or later. The changelog entry for langchain 1.5 says that it needs Python 3.11 or later. The packages agree with the changelog: langchain 1.5.0 and langchain-core 1.8.0 declare Python 3.11 or later. langgraph 1.2.22 still declares 3.10.

The manual follows the package metadata, which ranks above both pages. On Python 3.10, pip install langchain resolves langchain 1.4.x, and nothing tells you that you got an older line. Use Python 3.11 or later. The capture kit uses 3.13.

The same change breaks a rule of the release policy page. That page says that the Python floor changes only in a major release. langchain 1.5.0 is a minor release. The register of this manual lists the disagreement as conflict D101.

A lockfile

A minor release of one package can change what your code sees. langchain-core 1.7.0 changed the tool call events of a stream. Its changelog entry says to pin below 1.7 to keep the old shape. langgraph released 1.2.20, 1.2.21, and 1.2.22 within nine days, by the release dates on PyPI.

So pin every package of the stack to one exact version. The capture kit pins 25 of them in capture/requirements.txt, and it writes what it installed:

outputthe versions the capture kit installedFull log
python 3.13

langchain==1.5.0
langchain-core==1.8.0
langgraph==1.2.22
langgraph-checkpoint==4.3.2
langgraph-prebuilt==1.1.2
langgraph-checkpoint-sqlite==3.1.3
deepagents==0.7.38
langsmith==0.14.17
fastmcp==4.2.0
mcp==2.3.0
langchain-text-splitters==1.1.3
langchain-openai==1.8.0
langchain-anthropic==1.7.10
langchain-ollama==1.1.0
…
The first fourteen lines after the Python version. The transitive pins are cut.

deepagents 0.7.38 requires langchain-anthropic and langchain-google-genai. Its deprecated default model is Claude. Install it only when you use it.

For an agent with one OpenAI model, this is the install at the pin:

bash
python3.13 -m venv .venv
.venv/bin/pip install "langchain==1.5.0" "langchain-core==1.8.0" "langgraph==1.2.22" "langchain-openai==1.8.0"
.venv/bin/pip freeze > requirements.lock

Then install from requirements.lock everywhere else, so that every machine resolves the same versions.

Install size and import time

We measured two fresh installs on the Mac, with the same lockfile as constraints, before any import wrote bytecode. openai alone installed 14 packages in 26,356 KiB. langchain with langchain-openai installed 44 packages in 54,312 KiB. Raw runs

We measured the import time on the Mac, 10 runs of each import in a new process. Figure 3.2 shows each run. With bytecode already written, import openai took 0.329 s at the median, and the imports for create_agent with ChatOpenAI took 0.831 s. With no bytecode, they took 1.064 s and 2.64 s. The Mac is a shared laptop, so read these as upper bounds. Raw runs

Fig. 3.2import time of four imports, 10 runs eachchart
Import time of four imports, 10 runs each A dot chart of import time in seconds on the Mac, 10 runs of each import in a new Python process, with bytecode on disk on the left and without bytecode on the right. Medians with bytecode: pass 0.023 s, import openai 0.329 s, langgraph StateGraph 0.477 s, create_agent with ChatOpenAI 0.831 s. Medians without bytecode: 0.063 s, 1.064 s, 1.85 s, and 2.64 s. 0 0.5 1 1.5 2 2.5 3 seconds BYTECODE ON DISK NO BYTECODE 0.023 pass 0.329 openai 0.477 langgraph 0.831 agent 0.063 pass 1.064 openai 1.85 langgraph 2.64 agent pass: an empty program. agent: create_agent with ChatOpenAI. Each dot is one run on the Mac. Each short line is the median of 10.
The imports for create_agent with ChatOpenAI take about 0.8 s warm and 2.6 s with no bytecode, about two and a half times import openai alone. Each dot is one run in a new Python process on the Mac. Each short line is the median of ten runs. The left group had bytecode on disk and the right group had none.

An import of 2.6 s matters in a serverless function or a CLI that starts on every call. Import the stack once at start-up, and keep the bytecode in the image.

LangChain (Python): langchain, langchain-core, langgraph, deepagents, langsmith 1.5.0 · c2f4036 · 2026-11-11 · Edition 2026.11