LangChain

This content was generated with the assistance of AI and should be verified against the official documentation of each tool and framework before being relied on in production.

This section’s bibliography lists the reference material consulted while preparing these pages.

This sub-section was written against langchain 1.4.3, langchain-core 1.6.5, langchain-classic 1.0.8, langgraph 1.2.12 and langsmith 0.14.1 on Python 3.12, langchain 1.5.14 and @langchain/langgraph 1.4.18 on npm, and LangChain4j 1.20.2 on Java 21, with the full list in the version baseline below, all read from PyPI, npm, Maven Central and the official documentation on 2026-09-29. Where an individual page and that baseline ever disagree after a later update, the baseline is the one to trust. Every Python snippet on the pages was executed against the real packages, using scripted fake chat models because no Ollama server was available, so the printed outputs are exactly what the code prints and not what a real model would say; the few snippets that need an account or a network service (a LangSmith workspace, a hosted model) say on their page that they were not run.

"LangChain" now names a family of libraries and services rather than one package: langchain (agents, models, tools and middleware), langchain-core (the shared interfaces), langgraph (a durable, stateful execution runtime), deepagents (a batteries-included agent harness), langsmith (tracing, evaluation and deployment), and, beside the Python libraries, an independent JavaScript port and an independent Java library with its own release cadence. This page is the map of that family, the version table, a suggested reading order for each kind of reader, and the bibliography that all the pages draw on.

The ecosystem map

flowchart TD DA["deepagents
planning, filesystem, subagents"] LC["langchain
create_agent, middleware, init_chat_model"] LG["langgraph
StateGraph, checkpointers, stores, interrupt"] CO["langchain-core
messages, runnables, tools, prompts"] CL["langchain-classic
legacy chains, retrievers, indexing"] PP["partner packages
langchain-ollama, -anthropic, -openai"] MA["langchain-mcp-adapters
MultiServerMCPClient"] LS["langsmith
tracing, datasets, evaluation"] EV["openevals and agentevals
LLM-as-judge, trajectories"] AS["Agent Server
LangSmith Deployment and Studio"] JS["LangChain.js
langchain, @langchain/langgraph"] J4["LangChain4j
AiServices, agentic, MCP"] DA --> LC LC --> LG LC --> CO LG --> CO CL --> CO PP --> CO MA --> LC LC -.-> LS LG -.-> LS EV -.-> LS LG --> AS JS -. "same concepts" .- LC J4 -. "same ideas, independent code" .- LC
Figure 1. The LangChain ecosystem: libraries (solid boxes), services and the other-language libraries

A solid arrow means "builds on"; a dashed arrow is an optional integration (tracing and evaluation work with or without the libraries), and a dashed line between two boxes means the two share concepts but not code. The Ecosystem & Packages page explains each package, the v1 migration table (old import to new import) and a runnable smoke test. For the official statement of what changed in the 1.0 release, see the LangChain v1 release notes and the v1 migration guide.

Python, JavaScript and LangChain4j

The three libraries solve the same problems — talk to a model, give it tools, remember a conversation, put a person in the loop, connect MCP servers, observe and test the result — but they are separate code bases. Python is the reference implementation and the primary language of this sub-section; the other two get one or two pages each.

Python JavaScript / TypeScript Java (LangChain4j)

Packages

langchain, langchain-core, langgraph, langsmith, deepagents, partner packages such as langchain-ollama

langchain, @langchain/core, @langchain/langgraph, @langchain/ollama, deepagents

dev.langchain4j:langchain4j and one module per provider or feature, managed by a BOM

Agent entry point

create_agent plus middleware

createAgent plus middleware

AiServices.builder for AI Services, and the experimental AgenticServices for workflows and supervisors

Graph runtime

LangGraph (StateGraph, the functional API)

LangGraph.js

none; workflows come from the langchain4j-agentic module

Memory

checkpointers (short term) and stores (long term)

the same checkpointers and stores

ChatMemory, ChatMemoryProvider and ChatMemoryStore

Observability and evaluation

LangSmith, openevals, agentevals

LangSmith

model and AI Service listeners; no LangSmith integration is covered here

Where it is covered

every page except the two below

LangChain.js

LangChain4j and LangChain4j Agents & MCP

Choose by the language your application is written in, not by the framework: all three call the same model providers, all three can use MCP servers, and an agent written in one can be exposed to the others over HTTP or MCP. LangChain4j is an independent open-source project, not a port of the Python code, so class names differ, and its agentic module is experimental and versioned as a beta.

Version baseline

Every version below was read from the package registries and the official documentation on 2026-09-29. Each page repeats the subset it uses in its own lead paragraph.

Area Versions

Python

Python 3.12; langchain 1.4.3, langchain-core 1.6.5, langchain-classic 1.0.8, langgraph 1.2.12, langsmith 0.14.1, langchain-mcp-adapters 0.3.2, langchain-ollama 1.1.0, deepagents 0.7.19, openevals 0.2.0 and agentevals 0.0.9.

JavaScript

Node.js 24 with langchain 1.5.14, @langchain/core 1.2.13 and @langchain/langgraph 1.4.18; the other npm packages are listed on LangChain.js.

Java

Java 21; LangChain4j 1.20.2 for the stable modules and 1.20.2-beta30 for the agentic, MCP, pgvector and Spring Boot starter modules; the Quarkiverse quarkus-langchain4j extension 1.14.0. See LangChain4j for the module list.

Models and stores

Ollama with llama3.1:8b for chat and nomic-embed-text for embeddings, and the pgvector store of PostgreSQL & pgvector — the same as the rest of the AI section. The hosted models used elsewhere (claude-sonnet-5, claude-opus-5-5, claude-haiku-4-5, gpt-6-sol) are drop-in replacements.

Material written before the 1.0 release in October 2025, including all the books in the bibliography, describes an older package layout. The differences that matter, each flagged where it appears on the pages:

  • chains, the hub, langchain.retrievers.* and the indexing API moved to langchain-classic, and text splitters come from langchain-text-splitters;

  • create_agent with middleware replaces hand-built ReAct graphs and create_react_agent;

  • human approval is now interrupt() with Command(resume=…​), or HumanInTheLoopMiddleware on an agent, rather than hand-built graphs with static breakpoints;

  • the tracing variables are LANGSMITH_TRACING and LANGSMITH_API_KEY, not LANGCHAIN_TRACING_V2;

  • LangGraph Platform is now LangSmith Deployment, its server is the Agent Server, and LangGraph Studio is LangSmith Studio;

  • LangChain4j moved from the 0.3x line to 1.x, with the experimental agentic module and the MCP client added.

The running example: DocsAssistant

Every page extends DocsAssistant, the assistant that answers questions about this site’s documentation, introduced in Vector Databases & RAG and reused in LLM Foundations & Prompting, AI Agents and Model Context Protocol. It keeps the same corpus, the same Ollama models and the same pgvector store; only the framework code changes from page to page.

Stage What DocsAssistant does Page

Chat

Answers a question with a chat model and a prompt template.

Chat Models & Messages, Prompts & Templates

Structured metadata

Extracts typed page metadata from a document.

Structured Output

Search tool

Calls a search_docs tool over the corpus.

Tools, Retrieval & RAG Bridge

Approval step

An agent that asks a person before it opens a GitHub issue.

Agents with create_agent, Human-in-the-Loop & Time Travel

Memory per user thread

Remembers each user’s conversation, and durable facts across conversations.

Short-Term Memory & Checkpointers, Long-Term Memory Stores

Streaming

Streams tokens and progress to a web client.

Streaming

Evaluation

Scores answers and trajectories against a dataset.

Evaluation, Testing

Deployment

Serves the agent from a server.

Deployment

Reading path

Read the pages in the order of the navigation on a first pass; the shorter paths below are for readers who already know part of the material.

New to LangChain 1.x

Coming from LangChain 0.x or from the older books

  1. The migration table on Ecosystem & Packages.

  2. LCEL & Runnables for what remains of chains.

  3. Middleware and Human-in-the-Loop & Time Travel for the replacements of the hand-built agent graphs.

Building stateful workflows and multi-agent systems

Taking an agent to production

Java developers

TypeScript developers

  1. LangChain.js, using the Python pages for the concepts it shares.

What’s covered

The pages are grouped the same way as the navigation.

Core LangChain

  • Ecosystem & Packages — what each package is for, the v1 migration digest and an install smoke test.

  • Chat Models & Messages — init_chat_model, provider packages, messages and content blocks, invoke, batch and stream, rate limiting, fallbacks and token usage.

  • Prompts & Templates — ChatPromptTemplate, message placeholders, few-shot templates and the LangSmith prompt hub.

  • LCEL & Runnables — the Runnable protocol, pipe composition, parallel runnables and when to switch to LangGraph.

  • Structured Output — with_structured_output, the agent response_format, output parsers and validation with retries.

  • Tools — the @tool decorator, schemas, bind_tools, runtime injection, errors and artifacts.

Agents

  • Agents with create_agent — the agent loop, dynamic model selection and replacing create_react_agent.

  • Middleware — the hook lifecycle, built-in middleware and custom middleware.

LangGraph

Integrations

  • MCP Adapters — MultiServerMCPClient and exposing an agent as an MCP server.

  • Retrieval & RAG Bridge — how the retrieval pieces fit together, with deep links into the vector-store pages.

  • Multimodality & Voice — images, PDFs and audio, and the speech-to-text, agent, text-to-speech pattern.

  • Guardrails & Security — PII handling, injection defences and tool permissions.

  • Local Models — Ollama, OpenAI-compatible servers and the tool-calling caveats of small models.

LangSmith

  • Observability with LangSmith — tracing, metadata, cost tracking, masking and OpenTelemetry.

  • Evaluation — datasets, openevals, agentevals, online evaluators and regression experiments.

  • Testing — unit tests with fake models, graph tests and integration tests.

  • Deployment — langgraph.json, the Agent Server, Studio and self-hosting.

Other languages

  • LangChain.js — the npm package map, createAgent, LangGraph.js and streaming to React.

  • LangChain4j — the BOM, ChatModel, AI Services, tools, memory, structured outputs, streaming and guardrails.

  • LangChain4j Agents & MCP — the experimental agentic module and the MCP client.

Cheat sheet

The vector-store side of LangChain is not repeated here. The canonical page is Integrating with LangChain, whose sections on embeddings, splitters, vector stores, retrievers, RAG chains and agentic RAG cover it, and its LangChain4j section does the same for Java. Framework-neutral background lives in the sibling sub-sections: AI Agents for agent theory, tool design, memory and evaluation, Building MCP Clients for the protocol side of the adapters, Running LLMs Locally for Ollama and other runners, and Agentic RAG and Agent Memory & Semantic Cache for the retrieval and memory patterns these libraries implement, and RAG Systems in Production for running DocsAssistant as a production RAG service. Hugging Face, Spring AI, Voice Agents, LLMOps & Evaluation and AI Security & Responsible AI are separate sub-sections of this AI section.

Bibliography

The following sources were consulted while preparing this sub-section’s pages. Every class, decorator, function, method, configuration key and environment variable was checked against the installed packages, the official documentation or the library sources listed here on 2026-09-29 — never copied from a book. Every URL cited on any page of this sub-section is listed here once.

Requester-provided books, consulted for concepts only and never the source of an example. All six predate the LangChain 1.0 release or describe an older LangChain4j line, so where they differ from a package’s own documentation, that documentation is authoritative:

oreilly.com and packtpub.com answer automated fetches with an HTTP 403 response, but every publisher page above is a live, reachable page when opened in a browser.

Official documentation, in the groups below. The pages of docs.langchain.com are cited in their Python form; the LangChain.js pages use the same paths under /oss/javascript/.

LangChain (Python):

LangGraph (Python):

Deep Agents:

Provider and integration pages:

LangSmith:

API reference:

LangChain.js:

LangChain4j:

Evaluation packages, adapters and demos (repositories):

Specifications and standards:

Model, provider and tooling documentation:

Observability alternatives:

Papers and engineering articles:

These books are consulted references, not the primary source of any example on this sub-section’s pages. On any discrepancy between a book and a package’s or framework’s own official documentation, that documentation is authoritative.