Installation
LangChain's Python installation story is package-oriented: install the package that matches the layer you are building against, then add provider integrations and operational tooling as your application needs them. For most new agent and LLM application work, start with the main langchain package. The current package README presents LangChain as the easiest way to start building agents and applications powered by LLMs, with pre-built agent architecture and model integrations that help developers connect to providers such as OpenAI, Anthropic, and Google. Sources: libs/langchain_v1/README.md
The repository also includes lower-level and specialized packages that serve different audiences. langchain-core contains the base abstractions that power the ecosystem, langchain-classic preserves legacy chains and deprecated or compatibility-oriented functionality, and langchain-model-profiles is a maintainer CLI for refreshing model capability data. Installing everything up front is usually unnecessary. Choose the smallest set that matches your task so dependency boundaries stay clear and upgrades remain easier to reason about. Sources: libs/core/README.md, libs/langchain/README.md, libs/model-profiles/README.md
Purpose and Scope
This page explains which LangChain package to install first, when to add related packages from this monorepo, and how official documentation examples layer provider packages and LangSmith tooling on top. It is written for Python users working from this repository's package READMEs. If you are looking for the JavaScript or TypeScript library, the package READMEs explicitly point to LangChain.js instead; the Python commands below are for the Python monorepo and its PyPI packages. Sources: libs/langchain_v1/README.md, libs/core/README.md
The recommended starting point is the main langchain distribution. Its README shows a quick install with uv add langchain, then explains that LangChain is intended for quickly building agents and autonomous applications. That recommendation matters because the rest of the ecosystem is layered: provider integrations, tracing, evaluation, and classic compatibility packages can all participate, but the main package is the default entry point for application authors who want the current agent-facing API surface. Sources: libs/langchain_v1/README.md
Quick Install
Use the package manager your project already standardizes on. The repository READMEs show uv commands, while official examples also show pip commands when installing provider integrations or LangSmith-related packages. The important part is the package name, not the package manager. In a new Python project that uses uv, install LangChain like this:
uv add langchainIf your environment uses pip, the equivalent pattern is to install from PyPI using the same distribution name:
pip install -U langchainAfter installing the framework package, install the provider packages used by your code. Official LangSmith tracing examples install langchain_openai for OpenAI-backed snippets, and runnable evaluation examples install langsmith together with langchain[openai]. Treat those as task-specific additions: a model provider package supplies the concrete chat model implementation, while LangSmith packages and environment variables support tracing, debugging, evaluation, and monitoring. The core LangChain package can be installed first, then provider and observability packages can be added incrementally as your application becomes more concrete.
Core Primitives
The installation choices map to LangChain's main building blocks. langchain is the application package for agents and LLM-powered apps. It is the package to install when you want pre-built agent architecture, model integration entry points, and a short path from an idea to a working agent. The README also explains that LangChain agents are built on top of LangGraph to provide durable execution, streaming, human-in-the-loop behavior, persistence, and related runtime capabilities without requiring basic users to learn LangGraph first. Sources: libs/langchain_v1/README.md
langchain-core is the shared abstraction layer. Its README says it contains the base abstractions that power the LangChain ecosystem and emphasizes modularity, stability, and provider-independent interfaces. Install it directly when you are building libraries, integrations, tests, or advanced components that need the interfaces without the higher-level application package. In normal applications, langchain-core will often arrive as a dependency of other LangChain packages, but knowing its role helps explain why provider packages can interoperate with prompts, messages, runnables, tools, retrievers, and models. Sources: libs/core/README.md
langchain-classic is the compatibility package. Its README describes legacy chains, langchain-community re-exports, the indexing API, deprecated functionality, and more, while also stating that in most cases users should use the main langchain package. Install it when you are maintaining older code, using APIs that have not moved into the current package surface, or working with classic indexing and chain abstractions. Avoid selecting it as the default for a new project unless a specific guide or dependency requires it. Sources: libs/langchain/README.md
langchain-model-profiles is different from the runtime framework packages. Its README marks the package as in development and describes it as a CLI tool for fetching and updating model capability data from models.dev for LangChain integration packages. It exists primarily for maintainers who need to refresh capability metadata such as context windows, supported modalities, tool calling, and structured output support. Application developers usually consume model profiles through chat model integrations rather than installing this CLI directly. Sources: libs/model-profiles/README.md
Package Selection Reference
| Package | Install command shown by repository docs | Use it when |
|---|---|---|
langchain | uv add langchain | You are building a new Python agent or LLM-powered application. |
langchain-core | uv add langchain-core | You need provider-independent base abstractions or are authoring integrations and reusable components. |
langchain-classic | uv add langchain-classic | You need legacy chains, compatibility re-exports, classic indexing APIs, or deprecated functionality. |
langchain-model-profiles | uv add langchain-model-profiles | You maintain integration packages and need the langchain-profiles CLI for model capability data. |
This reference is intentionally narrow. It lists only packages covered by the source files for this page, not every integration in the LangChain ecosystem. Provider packages such as OpenAI or Anthropic integrations are installed separately when your application imports them. Official docs examples show that provider packages are added alongside the core framework because LangChain's abstractions are provider-independent, while concrete model access lives in integration packages. That separation is a design feature: it keeps the framework modular and lets teams swap model providers without rewriting the rest of an application.
Installation Flows
For a new application, create or enter your Python project, install langchain, and then add the model provider you plan to call. A minimal setup might begin with the main package and later add OpenAI, Anthropic, or another provider package depending on the model identifier used by your code. If you also want traces for debugging and monitoring, configure LangSmith as shown in the official tracing docs by installing the relevant integration package and setting tracing-related environment variables such as LANGSMITH_TRACING, LANGSMITH_API_KEY, and provider API keys.
For a library or integration project, begin with langchain-core when your code only needs shared interfaces. This is the right dependency boundary for components that implement or compose LangChain abstractions but should not force downstream users to install higher-level application dependencies. The Core README frames this as a modular base: providers implement the required interfaces and can then be used throughout the ecosystem. That is why direct Core usage is common in reusable packages, even when end-user applications install langchain. Sources: libs/core/README.md
For migration or maintenance work, install langchain-classic only when the code path requires it. The classic README is explicit that the main langchain package is preferred in most cases, while the classic package keeps older chains, community re-exports, the indexing API, and deprecated functionality available. This distinction helps avoid accidentally starting new applications on legacy APIs while still giving existing projects a supported path to keep running during incremental migration. Sources: libs/langchain/README.md
For integration maintainers, install langchain-model-profiles when refreshing profile data. The README shows the operational command langchain-profiles refresh --provider anthropic --data-dir ./langchain_anthropic/data, which downloads model data from models.dev, merges augmentations from profile_augmentations.toml, and generates a profiles.py file. This workflow supports chat model .profile metadata for capabilities like context window size, modalities, tool calling, and structured output. Sources: libs/model-profiles/README.md
uv add langchain-model-profiles
langchain-profiles refresh --provider anthropic --data-dir ./langchain_anthropic/dataRelevant Source Files
libs/langchain_v1/README.md— Current main LangChain package README, including theuv add langchainquick install, positioning for agents and LLM applications, LangGraph relationship, and links to docs and API reference.libs/core/README.md— LangChain Core package README, including theuv add langchain-corequick install and the explanation of provider-independent base abstractions.libs/langchain/README.md— LangChain Classic package README, including theuv add langchain-classicquick install and guidance that most users should prefer the mainlangchainpackage.libs/model-profiles/README.md— Model profiles package README, including theuv add langchain-model-profilesquick install, development warning, CLI purpose, andlangchain-profiles refreshusage example.
Next Steps
After installation, move to the quickstart and build a small model call or agent so you can validate credentials, provider packages, and runtime behavior together. If you plan to evaluate or monitor the application, add LangSmith setup early because traces are most useful when captured from the first working prototype. If you are choosing dependencies for a reusable package, read the Core reference before depending on the full application package. If you are maintaining older code, compare the classic package surface with current LangChain APIs before adding new features.