Skip to content
STACK IT FAST

LangChain

Curated OSSAI-agentLLM Application Framework & Agent Orchestrator1M+ MAU

Audited from github.com/langchain-ai/langchain

LangChain is a Python framework for building LLM-powered applications and agents, organized as a monorepo of independently versioned packages: a core Runnables/Pydantic library, a LangGraph-based agent package, and dozens of separately published model-provider and tool integrations.

Language
Python
License
MIT
Running for
2 years 6 months
Team
1M+ MAU

Why this architecture

The current langchain package is a thin agent-building layer on top of LangGraph, with the older chain-based API kept separately as langchain-classic, and every model provider ships as its own versioned package so integrations can release independently of the core library.

Tech stack by layer

5 technologies · audited Sep 17, 2026
Backend & APIs
  • PythonImplementation language for every package in the monorepo (core, langchain, and all partner integrations).
  • PydanticData-validation and schema layer (v2) underlying Runnables, structured output, and tool-calling schemas in langchain-core.
  • httpxAsync HTTP client dependency of langchain-core and the model-profiles CLI.
Data & Persistence
  • ChromaReference vector-store integration package (langchain-chroma) for retrieval-augmented generation examples and tests.
Infrastructure & Deploy
  • uvWorkspace and dependency manager pinning versions across all libs/* packages, kept current by a dedicated CI workflow.
  • HatchlingBuild backend used to produce the wheel/sdist for every package in the monorepo.
Tooling, Testing & Ops
  • LangGraphGraph-based agent orchestration engine that the current langchain package (libs/langchain_v1) is built directly on top of.
  • LangSmithTracing/observability SDK that langchain-core depends on directly for run tracing.
  • langchain-model-profilesStandalone CLI package that generates and updates per-model capability metadata used by provider integrations.
  • Provider integration packagesEach provider (OpenAI, Anthropic, Fireworks, Groq, HuggingFace, MistralAI, Ollama, Nomic, DeepSeek, Exa) ships as its own versioned package.

LangChain architecture diagram

Open SVG
LangChain architecture diagramYour app → langchain (agent API); langchain → LangGraph (run graph); langchain → langchain-core (interfaces); LangGraph → Provider packages (model calls); Provider packages → Model APIs (HTTP); langchain-core → Vector stores (retrieval); langchain-core → LangSmith (traces)CLIENTSSERVICESWORKERS & JOBSDATA & STORAGEEXTERNALYour appPythonlangchainagents on LangGraphlangchain-coreRunnables · PydanticLangGraphagent orchestrationProvider packagesOpenAI · Anthropic · …Vector storeslangchain-chroma …LangSmithtracingModel APIsvia httpxinterfacesmodel callsagent APIrun graphHTTPretrievaltraces
How the main components of LangChain connect, drawn from the audited repository.
Diagram as text
  • Your app (Python) → langchain (agents on LangGraph): agent API
  • langchain (agents on LangGraph) → LangGraph (agent orchestration): run graph
  • langchain (agents on LangGraph) → langchain-core (Runnables · Pydantic): interfaces
  • LangGraph (agent orchestration) → Provider packages (OpenAI · Anthropic · …): model calls
  • Provider packages (OpenAI · Anthropic · …) → Model APIs (via httpx): HTTP
  • langchain-core (Runnables · Pydantic) → Vector stores (langchain-chroma …): retrieval
  • langchain-core (Runnables · Pydantic) → LangSmith (tracing): traces

Key architectural decisions

7 decisions
  1. 01

    The "langchain" package is now a thin agent layer on LangGraph, not the classic chains API

    libs/langchain_v1/pyproject.toml publishes the name "langchain" (version 1.4.1) depending on langgraph>=1.2.11,<1.3.0, while libs/langchain/pyproject.toml publishes "langchain-classic" (version 1.0.8), the pre-rewrite chains/agents API kept as a separate package for backwards compatibility.

  2. 02

    Every model or tool provider ships as its own independently versioned package

    libs/partners/openai/pyproject.toml (langchain-openai 1.6.2) and libs/partners/anthropic/pyproject.toml (langchain-anthropic 1.7.2) each declare their own version and their own minimum langchain-core floor, so a provider integration can release without forcing a core or langchain release.

  3. 03

    Model capability metadata is generated by its own CLI package, refreshed in CI

    libs/model-profiles/pyproject.toml defines the langchain-model-profiles package with a langchain-profiles console script (project.scripts), and the repository runs a refresh_model_profiles.yml / _refresh_model_profiles.yml workflow pair to keep per-model data current across provider packages.

  4. 04

    Text splitting is factored out of langchain-core into its own package

    libs/text-splitters/pyproject.toml publishes langchain-text-splitters as a package depending only on langchain-core, separately versioned so splitter-only consumers do not need the rest of langchain.

  5. 05

    The repository maintains an agent-readable documentation set, kept in sync by CI

    The openwiki/ directory (agent-execution.md, agent-factory.md, mcp-integration.md, partner-pattern.md, and others) documents internal patterns specifically for AI coding agents working in the repo, and an openwiki-update.yml workflow plus check_agents_sync.yml keep it aligned with the code as it changes.

  6. 06

    uv pins dependency versions across roughly fifteen published packages in one workspace

    A bump_uv_pin.yml workflow updates the uv lock pin repo-wide, and check_versions.yml / check_extras_sync.yml verify that optional-dependency extras in libs/langchain/pyproject.toml and libs/langchain_v1/pyproject.toml stay in sync with the actual partner packages under libs/partners.

  7. 07

    Provider integrations are tested against recorded HTTP cassettes by default

    libs/partners/openai/pyproject.toml and libs/partners/anthropic/pyproject.toml both list vcrpy in their test dependency group, and a _test_vcr.yml workflow runs the suite against recorded cassettes so most CI runs do not call live provider APIs.

How LangChain is built

How LangChain is structured

The repository is a uv-managed workspace of independently versioned Python packages under libs/: libs/core (langchain-core, the Runnables/LCEL foundation), libs/langchain_v1 (the current langchain package, built on LangGraph), libs/langchain (kept as langchain-classic for the pre-rewrite chains/agents API), libs/text-splitters, libs/model-profiles (a small CLI for model capability metadata), libs/standard-tests (a shared test suite contract for integrations), and libs/partners/* — one directory per provider (anthropic, chroma, deepseek, exa, fireworks, groq, huggingface, mistralai, nomic, ollama, openai, and more). Each package has its own pyproject.toml, version number, and langchain-core floor. Alongside the code, openwiki/ is a set of markdown documents (agent-execution.md, agent-factory.md, mcp-integration.md, partner-pattern.md, and others) written specifically to orient AI coding agents working in the repository, distinct from the human-facing docs referenced in README.md.

Backend & APIs

libs/core/pyproject.toml (langchain-core, version 1.6.3) is the shared foundation: it depends on pydantic>=2.7.4 for schemas and structured output, httpx for async HTTP, langsmith for run tracing, jsonpatch for streaming diffs, and a new langchain-protocol package. libs/langchain_v1/pyproject.toml publishes the package literally named langchain (version 1.4.1) with a minimal dependency set — langchain-core, langgraph>=1.2.11,<1.3.0, and pydantic — confirming that the current langchain API is a thin layer over LangGraph's graph-based agent runtime rather than its own execution engine. The older imperative-chains implementation lives on as langchain-classic (libs/langchain/pyproject.toml, version 1.0.8), which still depends on SQLAlchemy and requests and exposes the same provider "extras" (anthropic, openai, google-vertexai, aws, and so on) as optional dependencies. Each provider integration — for example langchain-openai (libs/partners/openai/pyproject.toml, depending on openai>=2.45.0 and tiktoken) and langchain-anthropic (libs/partners/anthropic/pyproject.toml, depending on anthropic>=0.120.0) — wraps that provider's own SDK behind langchain-core's interfaces and is versioned separately from both langchain and langchain-classic.

Data & persistence

LangChain itself holds no persistent state; "data" in this repository means integration packages for retrieval and storage backends. libs/partners/chroma/pyproject.toml (langchain-chroma) depends on chromadb>=1.5.5 and is the vector-store integration most visible in the fetched manifests, following the same one-package-per-integration structure used for model providers. libs/text-splitters/pyproject.toml (langchain-text-splitters) is a separate package for document chunking, depending only on langchain-core so it can be used independently of the rest of the framework, and its typing dependency group pulls in spacy, nltk, transformers, and sentence-transformers for splitter implementations that need them.

Build, test & deploy

Every package builds with Hatchling ([build-system] requires = ["hatchling"] in each pyproject.toml) and is managed through a uv workspace, with tool.uv.sources entries in several packages (libs/model-profiles/pyproject.toml, libs/text-splitters/pyproject.toml) pointing at sibling packages by relative path for editable installs. CI under .github/workflows is extensive and split by concern: _lint.yml and _test.yml/_test_pydantic.yml run per-package lint and test jobs, _test_vcr.yml runs provider-integration tests against recorded HTTP cassettes (vcrpy is a test dependency of langchain-openai and langchain-anthropic) rather than live APIs, check_versions.yml and check_extras_sync.yml verify that langchain/langchain-classic's optional-dependency extras match the actual partner packages, bump_uv_pin.yml keeps the workspace's uv lock current, codspeed.yml runs performance-regression benchmarks, and openwiki-update.yml/check_agents_sync.yml keep the openwiki/ agent documentation synchronized with the code. Type checking uses mypy with the Pydantic plugin (plugins = ["pydantic.mypy"] in libs/model-profiles/pyproject.toml), and linting uses ruff with an almost-all-rules-enabled configuration (select = ["ALL"]) per package.

What to copy (and what not to)

Splitting every model provider and tool integration into its own independently versioned package — rather than one package with optional extras pulling in every SDK — is a strong pattern for any library that integrates with a fast-moving external ecosystem: a broken or delayed provider release cannot block the core library, and consumers only install the SDKs they actually use. Maintaining a separate, explicitly agent-oriented documentation set (openwiki/) alongside human docs, and enforcing it stays current via CI (check_agents_sync.yml), is a forward-looking pattern worth copying for any large codebase that expects AI coding agents as regular contributors — though it adds real maintenance surface a smaller project may not be able to justify. Testing provider integrations against recorded HTTP cassettes by default, falling back to live API tests only in a separate integration_tests.yml workflow, is a good default for any project depending on paid, rate-limited third-party APIs; it does mean cassette files must be kept honest as provider APIs change, which is its own ongoing cost.

Sources & repo audit

Audited
Sep 17, 2026
Commit
b3ec709
License
MIT

Independent analysis of repository at github.com/langchain-ai/langchain. Spotted an inaccuracy? Use the claim form to request a correction.

Show this stack on your README or website
Tech stack of LangChain
[![Tech stack of LangChain on STACK IT FAST](https://stackitfast.com/badge/langchain.svg)](https://stackitfast.com/project/langchain)

Paste it into your README. It shows your current stack and links to this page.

Use this stack

Scaffold it with your agent

Paste this prompt into Claude Code, Cursor, Windsurf or AGY to start a project with LangChain's architecture.

  1. 1Copy the promptThe full markdown spec, with every layer and decision.
  2. 2Open your AI toolClaude Code, Cursor, Windsurf or Copilot, in a new repo.
  3. 3Paste and scaffoldUse it as the first instruction; review before you ship.
use-this-stack.md · 61 lines · 8.0 KB
# MISSION: Scaffold "LangChain" Production Architecture
You are an expert Senior Staff Software Architect and Full-Stack Engineer. Your mission is to scaffold and implement a production-grade, highly reliable, and modular codebase following the proven architecture of **LangChain**.
---
## 1. PROJECT SPECIFICATIONS & BENCHMARK
- **Reference Architecture**: LangChain
- **What It Does**: LangChain is a Python framework for building LLM-powered applications and agents, organized as a monorepo of independently versioned packages: a core Runnables/Pydantic library, a LangGraph-based agent package, and dozens of separately published model-provider and tool integrations.
- **Domain & Category**: LLM Application Framework & Agent Orchestrator
- **Production Scale**: 1M+ MAU
- **Development Mode**: AI-AGENT
- **Architectural Rationale**: The current langchain package is a thin agent-building layer on top of LangGraph, with the older chain-based API kept separately as langchain-classic, and every model provider ships as its own versioned package so integrations can release independently of the core library.
- **Live Website Reference**: https://www.langchain.com
- **Source Repository**: https://github.com/langchain-ai/langchain
---
## 2. PRODUCTION TECH STACK
- **Full Stack Array**: Python, LangChain, LangGraph, Pydantic, Chroma
- **Primary Language(s)**: Python, Makefile, Shell
- **License of the reference repo**: MIT
- **Backend & APIs**: Python — Implementation language for every package in the monorepo (core, langchain, and all partner integrations).; Pydantic — Data-validation and schema layer (v2) underlying Runnables, structured output, and tool-calling schemas in langchain-core.; httpx — Async HTTP client dependency of langchain-core and the model-profiles CLI.
- **Data & persistence**: Chroma — Reference vector-store integration package (langchain-chroma) for retrieval-augmented generation examples and tests.
- **Infrastructure & deploy**: uv — Workspace and dependency manager pinning versions across all libs/* packages, kept current by a dedicated CI workflow.; Hatchling — Build backend used to produce the wheel/sdist for every package in the monorepo.
- **Tooling, testing & ops**: LangGraph — Graph-based agent orchestration engine that the current langchain package (libs/langchain_v1) is built directly on top of.; LangSmith — Tracing/observability SDK that langchain-core depends on directly for run tracing.; langchain-model-profiles — Standalone CLI package that generates and updates per-model capability metadata used by provider integrations.; Provider integration packages — Each provider (OpenAI, Anthropic, Fireworks, Groq, HuggingFace, MistralAI, Ollama, Nomic, DeepSeek, Exa) ships as its own versioned package.
---
## 3. KEY ARCHITECTURAL DECISIONS (audited from https://github.com/langchain-ai/langchain @ b3ec709)
1. **The "langchain" package is now a thin agent layer on LangGraph, not the classic chains API**: libs/langchain_v1/pyproject.toml publishes the name "langchain" (version 1.4.1) depending on langgraph>=1.2.11,<1.3.0, while libs/langchain/pyproject.toml publishes "langchain-classic" (version 1.0.8), the pre-rewrite chains/agents API kept as a separate package for backwards compatibility.
2. **Every model or tool provider ships as its own independently versioned package**: libs/partners/openai/pyproject.toml (langchain-openai 1.6.2) and libs/partners/anthropic/pyproject.toml (langchain-anthropic 1.7.2) each declare their own version and their own minimum langchain-core floor, so a provider integration can release without forcing a core or langchain release.
3. **Model capability metadata is generated by its own CLI package, refreshed in CI**: libs/model-profiles/pyproject.toml defines the langchain-model-profiles package with a langchain-profiles console script (project.scripts), and the repository runs a refresh_model_profiles.yml / _refresh_model_profiles.yml workflow pair to keep per-model data current across provider packages.
4. **Text splitting is factored out of langchain-core into its own package**: libs/text-splitters/pyproject.toml publishes langchain-text-splitters as a package depending only on langchain-core, separately versioned so splitter-only consumers do not need the rest of langchain.
5. **The repository maintains an agent-readable documentation set, kept in sync by CI**: The openwiki/ directory (agent-execution.md, agent-factory.md, mcp-integration.md, partner-pattern.md, and others) documents internal patterns specifically for AI coding agents working in the repo, and an openwiki-update.yml workflow plus check_agents_sync.yml keep it aligned with the code as it changes.
6. **uv pins dependency versions across roughly fifteen published packages in one workspace**: A bump_uv_pin.yml workflow updates the uv lock pin repo-wide, and check_versions.yml / check_extras_sync.yml verify that optional-dependency extras in libs/langchain/pyproject.toml and libs/langchain_v1/pyproject.toml stay in sync with the actual partner packages under libs/partners.
7. **Provider integrations are tested against recorded HTTP cassettes by default**: libs/partners/openai/pyproject.toml and libs/partners/anthropic/pyproject.toml both list vcrpy in their test dependency group, and a _test_vcr.yml workflow runs the suite against recorded cassettes so most CI runs do not call live provider APIs.
---
## 4. NON-NEGOTIABLE ARCHITECTURAL GUARDRAILS
1. **Monorepo & Modular Separation**:
   - Structure as a Turborepo monorepo with strict package boundaries:
     - `apps/web`: Application UI, routing, layouts, and server endpoints.
     - `packages/ui`: Shared design tokens, CSS variables, and Radix UI primitive components.
     - `packages/db`: Database schemas, client singleton, declarative migrations, and seed scripts.
     - `packages/config`: Shared TypeScript, ESLint, and build configurations.
2. **Strict Type Safety & Zero `any` Policy**:
   - Enable `strict: true`, `noImplicitAny: true`, and `strictNullChecks: true`.
   - Validate ALL external inputs, API request bodies, and query parameters with **Zod** schemas before execution.
3. **Frontend & Rendering Guidelines**:
   - Isolate interactive UI state to leaf components. Keep core pages lightweight and performant.
4. **Design System & Aesthetics**:
   - Keep every color, radius, shadow and font in a single token file (CSS variables) and consume tokens everywhere; never hardcode hex values in components.
   - Prefer crisp 1px borders and one subtle shadow scale over blurry default shadows. Pair one sans-serif for body/headings with one monospace for tags, badges, metrics, and code.
5. **Data Layer & Reliability**:
   - Write declarative schema definitions with foreign keys, composite indexes on queried filters, and automated timestamp triggers.
   - Use connection pooling and prepared statements for serverless database execution.
---
## 5. STEP-BY-STEP SCAFFOLDING ROADMAP
- **Phase 1: Workspace & Root Config**: Initialize package manager, monorepo configuration (`turbo.json`, `tsconfig.base.json`, `package.json`).
- **Phase 2: Database Schema & Client**: Set up the data layer (Chroma): client, connection pool, models, and migration scripts.
- **Phase 3: Design Tokens & UI Primitives**: Build accessible `Button`, `Input`, `Card`, `Badge`, and layout wrappers inside `packages/ui`.
- **Phase 4: Core Application Routes & Handlers**: Implement primary authentication, user session handling, and application routes.
- **Phase 5: Quality Assurance & Build Verification**: Run `tsc --noEmit`, ESLint, Prettier, and smoke test suites to ensure zero compilation or runtime errors.
---
## 6. EXECUTION INSTRUCTIONS
1. Review all specifications, architectural guardrails, and stack choices above.
2. Present the full monorepo directory tree structure.
3. Systematically generate the complete, production-ready codebase according to the 5-phase roadmap above — starting with the root workspace setup, followed by the database schema, UI design system package, and full-stack application routes until the repository is fully scaffolded and ready to run.
Scaffolded something with this prompt?
Would you pick this stack for a llm application framework & agent orchestrator project?

Frequently asked about LangChain

What is LangChain built with?

It is a Python monorepo: langchain-core provides Runnables and Pydantic-based schemas, the current langchain package is built on LangGraph for agent orchestration, and model/tool providers (OpenAI, Anthropic, and others) ship as separate packages under libs/partners.

Does LangChain need a backend?

No, LangChain is a library you import into your own Python application or agent service; it has no server component of its own. LangSmith (a separate hosted product) is an optional dependency of langchain-core used for tracing.

Is the langchain package built on LangGraph?

Yes. libs/langchain_v1/pyproject.toml, which publishes the "langchain" package (version 1.4.1), depends directly on langgraph>=1.2.11,<1.3.0; the pre-rewrite implementation is kept separately as langchain-classic in libs/langchain.

Does LangChain support vector databases?

Yes, through separate integration packages; libs/partners/chroma/pyproject.toml publishes langchain-chroma as a reference example, and the repository ships many similar provider-specific integration packages following the same pattern.

Can I self-host LangChain?

There is nothing to host: LangChain is installed as a Python dependency (uv add langchain) into whatever application or agent service you build and deploy yourself.

One email a month: new deep dives and stack trends

New source-audited architectures, head-to-head comparisons and the monthly stack report. No spam, unsubscribe anytime.

use-this-stack.md