This page describes every package in the LangChain monorepo: what each one contains, its PyPI distribution name, its version, and how the packages depend on one another. For information about the foundational abstractions that packages are built on top of, see Core Architecture. For patterns around selecting and swapping providers, see Integration Patterns and Best Practices. For the build system and pyproject.toml structure, see Package Structure and Build System.
The repository is a monorepo under libs/. Each subdirectory is an independently versioned Python package with its own pyproject.toml. The mapping from directory path to PyPI package name is not always obvious.
Directory → PyPI name mapping:
| Directory | PyPI Package Name | Current Version |
|---|---|---|
libs/core/ | langchain-core | 1.2.16 |
libs/langchain_v1/ | langchain | 1.2.10 |
libs/langchain/ | langchain-classic | 1.0.1 |
libs/text-splitters/ | langchain-text-splitters | (independent) |
libs/standard-tests/ | langchain-tests | (independent) |
libs/partners/openai/ | langchain-openai | (independent) |
libs/partners/anthropic/ | langchain-anthropic | (independent) |
libs/partners/mistralai/ | langchain-mistralai | (independent) |
libs/partners/groq/ | langchain-groq | (independent) |
libs/partners/fireworks/ | langchain-fireworks | (independent) |
libs/partners/xai/ | langchain-xai | (independent) |
libs/partners/ollama/ | langchain-ollama | (independent) |
libs/partners/chroma/ | langchain-chroma | (independent) |
libs/partners/huggingface/ | langchain-huggingface | (independent) |
libs/partners/deepseek/ | langchain-deepseek | (independent) |
libs/partners/perplexity/ | langchain-perplexity | (independent) |
Note: The directory
libs/langchain_v1/contains the current mainlangchainpackage on PyPI. The directorylibs/langchain/is a separate legacy package calledlangchain-classic.
Sources: libs/core/pyproject.toml1-36 libs/langchain_v1/pyproject.toml1-30 libs/langchain/pyproject.toml1-34 libs/text-splitters/README.md1-5 libs/standard-tests/README.md1-5
The packages form a layered dependency hierarchy. langchain-core sits at the bottom, with no dependencies on other LangChain packages. All other packages depend on it.
Package dependency graph:
Sources: libs/core/pyproject.toml26-35 libs/langchain_v1/pyproject.toml26-30 libs/langchain/pyproject.toml25-34
langchain-core — libs/core/The foundational package. Contains all abstract base classes and the Runnable interface. No third-party LLM provider dependencies are included. The package docstring in libs/core/langchain_core/__init__.py1-9 states: "No third-party integrations are defined here."
Runtime dependencies (libs/core/pyproject.toml26-35):
| Dependency | Version Constraint | Purpose |
|---|---|---|
langsmith | >=0.3.45,<1.0.0 | Tracing and run tracking |
tenacity | !=8.4.0,>=8.1.0,<10.0.0 | Retry logic |
jsonpatch | >=1.33.0,<2.0.0 | JSON patch operations |
PyYAML | >=5.3.0,<7.0.0 | YAML parsing |
typing-extensions | >=4.7.0,<5.0.0 | Backported type hints |
packaging | >=23.2.0 | Version handling |
pydantic | >=2.7.4,<3.0.0 | Data validation |
uuid-utils | >=0.12.0,<1.0 | UUID generation |
Python compatibility: >=3.10.0,<4.0.0. The version is maintained in libs/core/langchain_core/version.py3 as VERSION = "1.2.16" and imported by libs/core/langchain_core/__init__.py15-17
Sources: libs/core/pyproject.toml1-82 libs/core/langchain_core/version.py1-3 libs/core/langchain_core/__init__.py1-20
langchain — libs/langchain_v1/The primary user-facing package installable via pip install langchain. It provides the agent system, middleware pipeline, init_chat_model, and higher-level application building blocks. It depends on langchain-core and langgraph.
Runtime dependencies (libs/langchain_v1/pyproject.toml26-30):
| Dependency | Version Constraint |
|---|---|
langchain-core | >=1.2.10,<2.0.0 |
langgraph | >=1.0.8,<1.1.0 |
pydantic | >=2.7.4,<3.0.0 |
This package does not depend on langchain-text-splitters as a required dependency; text splitting is opt-in. Partner packages are available as optional extras declared in [project.optional-dependencies] (libs/langchain_v1/pyproject.toml32-49):
langchain[openai] → langchain-openai
langchain[anthropic] → langchain-anthropic
langchain[mistralai] → langchain-mistralai
langchain[groq] → langchain-groq
langchain[fireworks] → langchain-fireworks
langchain[ollama] → langchain-ollama
langchain[huggingface] → langchain-huggingface
langchain[deepseek] → langchain-deepseek
langchain[xai] → langchain-xai
langchain[perplexity] → langchain-perplexity
langchain[community] → langchain-community
The package version __version__ = "1.2.10" is set in libs/langchain_v1/langchain/__init__.py3 and must match pyproject.toml, which is enforced by the test in libs/langchain_v1/tests/unit_tests/test_version.py10-27
Sources: libs/langchain_v1/pyproject.toml1-100 libs/langchain_v1/langchain/__init__.py1-3
langchain-classic — libs/langchain/A legacy package on PyPI (pip install langchain-classic). Contains legacy chains, langchain-community re-exports, deprecated functionality, and the indexing API. The README in libs/langchain/README.md20-23 describes it as: "Legacy chains, langchain-community re-exports, indexing API, deprecated functionality, and more."
Runtime dependencies (libs/langchain/pyproject.toml25-34):
| Dependency | Version Constraint |
|---|---|
langchain-core | >=1.2.5,<2.0.0 |
langchain-text-splitters | >=1.1.0,<2.0.0 |
langsmith | >=0.1.17,<1.0.0 |
pydantic | >=2.7.4,<3.0.0 |
SQLAlchemy | >=1.4.0,<3.0.0 |
requests | >=2.0.0,<3.0.0 |
PyYAML | >=5.3.0,<7.0.0 |
The required dependencies are locked in a dependency test at libs/langchain/tests/unit_tests/test_dependencies.py23-44 to prevent accidental new required dependencies.
Sources: libs/langchain/pyproject.toml1-55 libs/langchain/README.md1-37 libs/langchain/tests/unit_tests/test_dependencies.py23-44
langchain-text-splitters — libs/text-splitters/A standalone package for splitting text documents into chunks. Depends only on langchain-core. Split out to a separate package so applications that do not need text splitting do not incur the dependency.
Key classes (documented further in 2.6):
RecursiveCharacterTextSplitterCharacterTextSplitterHTMLHeaderTextSplitterMarkdownHeaderTextSplitterTokenTextSplitterSources: libs/text-splitters/README.md1-37 libs/core/pyproject.toml52-53
langchain-tests — libs/standard-tests/A testing utility package providing base test classes that integration developers inherit to validate their implementations against the standard LangChain interface contract.
Key test base classes:
ChatModelUnitTestsChatModelIntegrationTestsVectorStoreIntegrationTestsEmbeddingsIntegrationTestsToolUnitTests / ToolIntegrationTestsBaseStoreIntegrationTestsCacheIntegrationTestsThis package is consumed as a dev/test dependency by langchain-core, langchain, and all partner packages. It is not intended as a runtime dependency. See Standard Testing Framework for full documentation.
Sources: libs/standard-tests/README.md1-94 libs/core/pyproject.toml73-75 libs/langchain_v1/pyproject.toml73-74
libs/partners/*/Each partner package provides concrete implementations of langchain-core abstract base classes for a specific AI provider. All partner packages depend only on langchain-core (not on langchain or langchain-classic), keeping them lightweight.
Interface implementations by partner package:
Sources: libs/langchain_v1/pyproject.toml32-49 libs/langchain/pyproject.toml36-53
Each package is versioned independently using Semantic Versioning. The version is declared in pyproject.toml under [project] version and repeated in a version.py or __init__.py file within the package source. A test enforces that these two values are kept in sync.
| Package | Version Source File | Test |
|---|---|---|
langchain-core | libs/core/langchain_core/version.py3 | — |
langchain | libs/langchain_v1/langchain/__init__.py3 | libs/langchain_v1/tests/unit_tests/test_version.py |
All packages use hatchling as the build backend (libs/core/pyproject.toml1-3 libs/langchain_v1/pyproject.toml1-3 libs/langchain/pyproject.toml1-3). Dependency management uses uv with workspace-local path references for intra-monorepo dependencies, e.g.:
This means that during development, changes to langchain-core are immediately reflected in langchain without a publish step. CI uses the same lock files (uv.lock) to ensure reproducible builds.
Sources: libs/langchain_v1/pyproject.toml97-101 libs/langchain/pyproject.toml130-134 libs/core/pyproject.toml80-82
langchain and langchain-classicThese two PyPI packages coexist in the monorepo and represent different generations of the top-level LangChain library:
| Aspect | langchain (libs/langchain_v1/) | langchain-classic (libs/langchain/) |
|---|---|---|
| PyPI name | langchain | langchain-classic |
| Version | 1.2.x | 1.0.x |
| Agent system | Yes (create_agent, middleware) | No |
| LangGraph dependency | Yes (langgraph>=1.0.8) | No |
| text-splitters dep | No (optional) | Yes (required) |
| SQLAlchemy dep | No | Yes |
| Purpose | Current recommended package | Legacy chains and deprecated APIs |
Users should install langchain for new projects. langchain-classic exists for backwards compatibility with legacy code that depends on chains, the indexing API, or langchain-community re-exports.
Sources: libs/langchain_v1/pyproject.toml6-30 libs/langchain/pyproject.toml6-34 libs/langchain/README.md20-23 libs/langchain_v1/README.md20-25
Refresh this wiki
This wiki was recently refreshed. Please wait 2 days to refresh again.