Open-Source Wikis

/

LangChain

/

Lore

langchain-ai/langchain

Lore

A timeline of how the LangChain Python codebase evolved. Dates are derived from git history and tag dates.

Eras

The single-package era (Oct 2022 – early 2023)

LangChain started on 2022-10-24 with Harrison Chase's initial commit — a single langchain/ directory containing prompts, LLMs, agents, and chains in one package. The first wave of growth came almost immediately: Harrison/add natbot (#18), Harrison/more documentation (#19), and a flood of community PRs added integrations weekly. There was no libs/ directory and no separation between core abstractions and concrete implementations.

The codebase doubled approximately every month through Q4 2022 and Q1 2023 as integrations multiplied. By early 2023 a single import of langchain pulled in dependencies for every supported provider — a problem that would later force the split into langchain-core, langchain, and partner packages.

The Great Splitting (mid-2023)

Through 2023, the project introduced the libs/ monorepo layout and started carving the codebase into focused packages:

  • libs/core/ — base abstractions only, lightweight dependencies. This is what users could safely depend on without dragging in every provider's SDK.
  • libs/community/ (later moved to a sibling repo) — community-contributed integrations, isolated from the core package.
  • libs/experimental/ — features still under design.
  • libs/text-splitters/ — chunking utilities split out so RAG users could use them standalone.
  • libs/standard-tests/ — shared test base classes that every integration could inherit.
  • libs/partners/<provider>/ — first-party provider integrations.

Commit volume peaked around 2024-03 (712 commits in a single month) — by far the busiest month in the repo's history — as integrations migrated into the new layout.

Partner extraction (2023–2024)

A continuous theme throughout 2023 and 2024 was extracting integrations from langchain-community into dedicated partner packages so they could ship on their own release cadence. The current libs/partners/ directory holds 15 first-party packages; many more partners (Google, AWS, Cohere, NVIDIA, IBM, …) live in sibling repos under the same langchain-ai/ GitHub organization.

LangGraph and the agent rebuild (2024–2025)

In 2024 LangChain introduced LangGraph — a separate library for low-level agent orchestration. The legacy Agent framework in libs/langchain/langchain_classic/agents/ (MRKL, ReAct, OpenAI-functions, structured-chat, conversational, self-ask-with-search, …) was put into maintenance mode. New agent work moved on top of LangGraph's StateGraph.

v1 and the new langchain package (2025–2026)

Through late 2025 and into 2026, the project carried out its largest architectural shift: a from-scratch redesign of the top-level langchain package. The old implementation was renamed to langchain-classic (source still in libs/langchain/langchain_classic/, ~1,322 source files), and a new minimal langchain package (libs/langchain_v1/langchain/, ~33 source files) was created.

Notable inflection points in this era:

  • The content-blocks v1 taxonomy (TextContentBlock, ImageContentBlock, ReasoningContentBlock, Citation, …) replaced the older string-or-dict message content. The taxonomy lives in libs/core/langchain_core/messages/content.py.
  • A new streaming-first chat model contract (BaseChatModelV1 in libs/core/langchain_core/language_models/chat_model_stream.py) replaced the older BaseChatModel for new partner integrations. A _compat_bridge.py shim in libs/core/langchain_core/language_models/ lets old and new models coexist.
  • Middleware (libs/langchain_v1/langchain/agents/middleware/) became the extension mechanism for agents: human-in-the-loop, summarization, PII redaction, tool-call limits, model fallbacks, todo tracking, shell tool. Each middleware is ~10–30 KB of focused logic.
  • The langchain-profiles CLI (libs/model-profiles/langchain_model_profiles/cli.py) was added to keep model capability data fresh across all partner packages from a single source (models.dev).
  • The langchain-protocol package (separate repo) was extracted as the wire protocol shared between langchain-core and downstream tooling.

The first GA tag of the new langchain==1.x line shipped in this era; current langchain==1.2.16 and langchain-core==1.3.2.

Longest-standing features

These subsystems have been in the codebase since the early days and are still actively used:

  • Prompts (libs/core/langchain_core/prompts/) — PromptTemplate and ChatPromptTemplate are essentially unchanged in shape since the first commit. Templating and partial-substitution semantics have been remarkably stable.
  • Tools (libs/core/langchain_core/tools/) — BaseTool and the @tool decorator predate the rest of the type system. They have been extended (structured tools, async, args-schema generation) but never replaced.
  • Output parsers (libs/core/langchain_core/output_parsers/) — string, list, JSON, XML, and Pydantic parsers have survived multiple framework rewrites.
  • Callbacks (libs/core/langchain_core/callbacks/) — the callback dispatcher pattern (base.py defines BaseCallbackHandler, manager.py handles propagation across nested runs) has been stable since 2023.
  • Document loaders & splitters — abstractions in langchain-core (documents/, document_loaders/) and the splitter algorithms in libs/text-splitters/ are some of the most-imported symbols in the ecosystem.

Deprecated features

The codebase carries a careful deprecation discipline. Key removals or maintenance-only zones:

  • MRKLChain, ReActChain, SelfAskWithSearchChain — top-level imports were removed; libs/langchain/langchain_classic/__init__.py warns and redirects to the explicit langchain_classic.agents.* paths.
  • The legacy chains library (libs/langchain/langchain_classic/chains/) — still present but no new chain types are being added. New code should compose Runnables via LCEL or build a langgraph graph instead.
  • The langchain.serpapi shim (libs/langchain/langchain_classic/serpapi.py) — now a 3-line redirect to langchain_classic.utilities.serpapi.
  • Memory classes (libs/langchain/langchain_classic/memory/) — superseded by LangGraph's checkpointer system.
  • load_tools / initialize_agent (libs/langchain/langchain_classic/agents/) — superseded by langchain.agents.create_agent.
  • Indexing API in langchain-classic — superseded by libs/core/langchain_core/indexing/.

Major rewrites

When What changed
Mid-2023 Monorepo layout: langchainlibs/{core,langchain,community,experimental,partners}
Late-2023 langchain-core extracted as a separate package with stable versioning
Early–mid 2024 Pydantic v2 migration
Mid-2024 Move from Poetry to uv for dependency management
2024–2025 LangGraph-based agents replace the legacy Agent framework
2025–2026 New langchain==1.x package with middleware, content-blocks v1, streaming-first chat models; old code renamed to langchain-classic

Growth trajectory

  • Oct 2022: 1 package, 1 contributor (Harrison Chase)
  • Mid-2023: ~5 packages, hundreds of contributors
  • Mid-2024: 15+ partner packages in this monorepo, more in sibling repos, 3,000+ unique authors
  • Apr 2026: 21 packages in this monorepo, 3,572 unique commit authors, 15,828 commits

The codebase has settled into a sustainable shape — recent commit volume (~150–250 per month) is roughly half of the 2024 peak, reflecting maturity of the abstractions rather than slowing development. The bulk of churn has shifted to partner packages and the new libs/langchain_v1/ directory.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Lore – LangChain wiki | Factory