LangChain is a modular framework for building agents and LLM-powered applications through composability. It implements a foundational abstraction layer that enables developers to chain together interoperable components—including LLMs, tools, retrievers, and prompts—while maintaining model interoperability and rapid prototyping capabilities.
This document serves as the high-level entry point for the repository's architecture, package structure, and foundational abstractions.
For details on the modular package structure and dependency relationships, see Package Ecosystem.
Sources: libs/core/pyproject.toml7 README.md24-25
Package Dependency Structure
The repository follows a layered architecture where langchain-core provides base abstractions that all other packages depend on. The modern langchain package (v0.2.11) acts as an agent engineering platform, integrating with langgraph for orchestration, while langchain-classic (v0.1.1) maintains support for legacy patterns.
Sources: libs/core/pyproject.toml6-36 libs/langchain_v1/pyproject.toml6-30 libs/langchain/pyproject.toml6-34 CLAUDE.md30-33
| Package | Version | Purpose | Key Dependencies |
|---|---|---|---|
langchain-core | 1.5.1 | Base abstractions: Runnable, BaseMessage, BaseTool | pydantic>=2.7.4, langsmith>=0.3.45, tenacity>=8.1.0 |
langchain | 0.2.11 | Main agent platform with langgraph integration | langchain-core>=0.2.11, langgraph>=0.0.30 |
langchain-classic | 0.1.1 | Legacy support for older chains and agents | langchain-core>=0.2.11 |
langchain-text-splitters | 1.0.0 | Document chunking and text processing utilities | langchain-core>=0.2.11 |
Version Coordination: All packages require Python >=3.10.0,<4.0.0 libs/core/pyproject.toml25 The ecosystem uses uv for dependency management and ensures compatibility across providers through strict version pinning in uv.lock libs/core/uv.lock1-3
Sources: libs/core/pyproject.toml24-36 libs/langchain_v1/pyproject.toml24-30 libs/langchain/pyproject.toml23-34 libs/core/version.py3 CLAUDE.md30-33
Optional Dependencies: The langchain package defines optional dependencies for various providers (e.g., openai, anthropic, ollama, groq, deepseek), allowing developers to selectively install partner integrations libs/langchain/pyproject.toml36-54
Sources: libs/langchain/pyproject.toml36-54 CLAUDE.md17-21
The Runnable interface is the foundational abstraction enabling LangChain's composability. Every major component—from models to prompts—implements this interface, providing a consistent API for synchronous and asynchronous execution.
Key Features:
|) operator.Serializable and RunnableSerializable ensure components can be dumped and loaded consistently libs/core/pyproject.toml122langsmith for automatic tracing of every invoke call libs/core/pyproject.toml27Sources: libs/core/pyproject.toml122 README.md63-70 CLAUDE.md30-31
LangChain is designed to work as part of a broader platform:
langchain package README.md41-42langchain-core depends on langsmith to provide built-in tracing libs/core/pyproject.toml27Sources: libs/core/pyproject.toml27 README.md53-57
The repository uses modern Python tooling to manage its multi-package structure:
| Tool | Purpose |
|---|---|
uv | Fast package installer, resolver, and environment manager (replaces pip/poetry) CLAUDE.md37 |
hatchling | Build backend for package distribution libs/core/pyproject.toml3 |
ruff | Fast linter and formatter enforced via make lint CLAUDE.md39 |
mypy | Static type checking for API stability CLAUDE.md40 |
make | Task runner for common dev commands (test, lint, format) CLAUDE.md38 |
Sources: libs/core/pyproject.toml1-3 CLAUDE.md37-41 CLAUDE.md88-90
feat(core): ...) to maintain clear history .github/workflows/pr_lint.yml1-52standard-tests package ensures that different partner integrations adhere to the same interface requirements CLAUDE.md33uv.lock files are maintained per-package to ensure reproducible development and test environments libs/core/uv.lock1-3Sources: .github/workflows/pr_lint.yml1-52 CLAUDE.md33 libs/core/uv.lock1-3
Refresh this wiki
This wiki was recently refreshed. Please wait 5 days to refresh again.