NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm
npm, #4362 most downloaded on npm
Core LangChain.js abstractions and schemas
Latest stable
1.4.2
Last release 4 days ago
18 Nov 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
371 releases · first in 2023
Drag across the ruler to compare, or tap a release to open it.
Patch Changes #12257 f852414 Thanks @thushanth-bengre-langchain ! - Mark tool messages that humanInTheLoopMiddleware creates for reject and respond de
f852414 Thanks @thushanth-bengre-langchain! - Mark tool messages that humanInTheLoopMiddleware creates for reject and respond decisions with lc_source: "hitl_interrupt_decision" and lc_data: { decision }, and let addNotificationMetadata accept tool messagesPatch Changes #12230 84e85cc Thanks @thushanth-bengre-langchain ! - Merge streamed input_json_delta blocks into the preceding tool_use / server_tool_u
84e85cc Thanks @thushanth-bengre-langchain! - Merge streamed input_json_delta blocks into the preceding tool_use / server_tool_use block at the same indexYour coding agent can read these notes before it upgrades. Set up the MCP server →
Add @langchain/core/decisions with BaseDecisionModel, a Runnable that answers typed Noul, Choice, Score, and Box questions about text, messages, or JS
#12178 01e5f2d Thanks @thushanth-bengre-langchain! - feat(core): add decision models
@langchain/core/decisions with BaseDecisionModel, a Runnable that answers typed Noul, Choice, Score, and Box questions about text, messages, or JSON stateparseQuestions, and parseClassifierResponse for providersinvoke answers from the questions asked, including Choice labels, and reject provider responses that leave a question unanswered or answer it with the wrong type or label9920d4b Thanks @jkennedyvz! - Require Zod 4.6.6 or newer for installed dependencies to exclude versions affected by GHSA-mrhx-c7xc-m3w5. Zod v3 schemas remain supported through the bundled zod/v3 entry point.Model refusals from OpenAI, Anthropic, and Gemini now appear as a refusal content block in message.contentBlocks. JSON, tool-call, and structured outp
#12120 a4fb396 Thanks @thushanth-bengre-langchain! - feat(core): add a standard refusal content block and ModelRefusalError
Model refusals from OpenAI, Anthropic, and Gemini now appear as a refusal content block in message.contentBlocks. JSON, tool-call, and structured output parsers throw ModelRefusalError (from @langchain/core/errors) when the model refuses, instead of a generic parsing error.
### Patch Changes - #12140 `f054550` Thanks @hntrl! - Stop streamEvents v2 from hanging or leaking an unhandled rejection when aborted, and from throw
Add recursion depth guards for mustache template parsing and dict prompt template traversal to prevent stack-exhaustion DoS from deeply nested attacke
#10961 674b755 Thanks @hntrl! - fix(prompts): enforce maximum prompt template nesting depth
Add recursion depth guards for mustache template parsing and dict prompt template traversal to prevent stack-exhaustion DoS from deeply nested attacker-controlled templates.
#12108 fb61799 Thanks @casparb! - fix(core): end the tool() run when its signal is already aborted
### Patch Changes - #12104 `e006308` Thanks @hntrl! - Export omitPayload from @langchain/core/tracers/tracer_langchain, a TracePolicy processor that r
#12104 e006308 Thanks @hntrl! - Export omitPayload from @langchain/core/tracers/tracer_langchain, a TracePolicy processor that records an empty payload while keeping the run.
#12102 6d157ae Thanks @hntrl! - LangChainTracer now still sends and ends a run when its trace policy's processInputs or processOutputs throws, with that payload dropped and the error set, instead of skipping the run or leaving it pending in LangSmith.
### Patch Changes - #11567 `d92aba6` Thanks @hntrl! - Add tracePolicy to RunnableSequence. Its processInputs/processOutputs shape only what LangChainT
### Patch Changes - #12051 `71fd01a` Thanks @thushanth-bengre-langchain! - feat(core): add addNotificationMetadata, getNotificationMetadata and the No
71fd01a Thanks @thushanth-bengre-langchain! - feat(core): add addNotificationMetadata, getNotificationMetadata and the NotificationMetadata type for marking messages the agent harness adds.Merging two runnable configs that both carry the same callback handler, as happens when an agent's streamEvents() runs inside a LangGraph node with tr
#12026 178af31 Thanks @eliornl! - fix(core): deliver callbacks once to a handler registered twice by merged configs
Merging two runnable configs that both carry the same callback handler, as happens when an agent's streamEvents() runs inside a LangGraph node with tracing on, registered that handler twice, so it received every callback twice: every streamed chunk arrived twice. The configured callback manager now keeps each handler once, in order, including a handler passed as a plain object of methods that merged configs wrapped twice.
#12042 50343ba Thanks @sera-wi! - fix(core): include node metadata in Graph.toJSON() output when set, matching Python
#12048 304d190 Thanks @sera-wi! - fix(core): escape drawMermaid node metadata labels and leave out object values, so metadata with brackets or objects no longer breaks Mermaid parsing
#11672 946e3d8 Thanks @thushanth-bengre-langchain! - fix(mongodb): reject non-string sessionId in MongoDBChatMessageHistory and wrap query filters with $eq (GHSA-m6rx-h84q-8r95)
Breaking: sessionId: "" now throws instead of silently working.
Tool-call and server-tool-call args now stream as tool-call-delta events, which carry only the new slice of the args, instead of block-delta snapshots
#11986 2caf64d Thanks @richardscarrott! - feat: stream tool-call args as tool-call-delta slices
Tool-call and server-tool-call args now stream as tool-call-delta events, which carry only the new slice of the args, instead of block-delta snapshots of the args so far. A large tool call now costs about the same bytes on the wire as the same length of text.
_streamResponseChunks), the OpenAI-compatible converter (OpenAI Completions, Groq, Mistral, IBM, OpenRouter, Perplexity, DeepSeek, Fireworks, Together AI and xAI Completions), OpenAI and xAI Responses, Anthropic (client and server tool calls) and Bedrock Converse. Google and Ollama still send one complete snapshot per call.id, name and index go on content-block-start, which carries no args. An id or name that arrives later reaches consumers on content-block-finish.block-delta fields.args mid-stream, or write agent stream transformers that do, read tool-call-delta instead. await stream, .toolCalls and the assembled message are unchanged.tool-call-delta. You need @langchain/langgraph-sdk 1.12.6 or later; @langchain/react, @langchain/vue, @langchain/svelte or @langchain/angular 1.2.6 or later; and langchain-core 1.6.13 or later for Python clients.@langchain/core below 1.3.0. That also keeps you on @langchain/openai, @langchain/anthropic, @langchain/aws and @langchain/xai versions that send snapshots.### Patch Changes - #11922 `d71c542` Thanks @richardscarrott! - feat(core): add midConversationSystemMessages and midConversationTools to ModelProfile
d71c542 Thanks @richardscarrott! - feat(core): add midConversationSystemMessages and midConversationTools to ModelProfile. They say whether a chat model sends a system message after the first turn in place, and whether it can add a tool through a message rather than the request's tool list. Either way the prompt prefix before it stays unchanged.ChatModelStream appends tool-call-delta slices to a tool call's args, and still replaces them on block-delta
#11982 5af4684 Thanks @richardscarrott! - feat(core): read tool-call-delta in ChatModelStream
ChatModelStream appends tool-call-delta slices to a tool call's args, and still replaces them on block-deltaUnknown delta typeAIMessageChunk eagerly re-ran collapseToolCallChunks in its constructor on every streamed delta concat, re-parsing all accumulated tool args each time
#11956 93d62b0 Thanks @hntrl! - Require langsmith >=0.11.0 to include the restored NullableHeaders type declarations.
#11822 d3e6fe6 Thanks @dqbd! - Add explicit agent address support to LangChainTracer, inherit project and address destinations together, and delegate default destination resolution to the LangSmith SDK.
#11150 cea15cf Thanks @mdnanocom! - fix(core): defer tool call chunk collapsing in AIMessageChunk to fix O(n²) streaming aggregation
AIMessageChunk eagerly re-ran collapseToolCallChunks in its constructor on every streamed delta concat, re-parsing all accumulated tool args each time — O(n²) over a stream, which can block the event loop for seconds on long tool-call streams. Collapsing now runs lazily, once, on first read of tool_calls / invalid_tool_calls.
### Patch Changes - #11849 `b1d9c7a` Thanks @KyleCodes! - Preserve runtime context in ambient runnable config across tool calls, nested runnables, and
b1d9c7a Thanks @KyleCodes! - Preserve runtime context in ambient runnable config across tool calls, nested runnables, and streaming.### Patch Changes - #11847 `bb50952` Thanks @hntrl! - fix(core): expose branded class type for provider declarations
### Patch Changes - #11771 `bbed273` Thanks @thushanth-bengre-langchain! - Add fileMimeTypes to ModelProfile so models can advertise the MIME types th
bbed273 Thanks @thushanth-bengre-langchain! - Add fileMimeTypes to ModelProfile so models can advertise the MIME types they accept as generic file inputs. OpenAI Responses API models now report the file types input_file supports;
Chat Completions profiles are unchanged.### Patch Changes - #11714 `a83dfb1` Thanks @ccurme! - Abbreviate long tool-call IDs when formatting chat messages as strings, keeping original messag
### Patch Changes - #11675 `030a726` Thanks @hntrl! - Preserve structured tool arguments in tracer run inputs.
Affects both core streaming paths — .stream()/.streamEvents() (_streamIterator) and .invoke()/.generate() when a streaming-preferring callback is atta
#11603 fec9cd8 Thanks @thushanth-bengre-langchain! - fix(core): build streaming llmOutput.tokenUsage from the fully-accumulated chunk instead of whichever individual chunk's usage_metadata arrived last
Affects both core streaming paths — .stream()/.streamEvents() (_streamIterator) and .invoke()/.generate() when a streaming-preferring callback is attached (_generateWithCache's hasStreamingHandler branch). Previously, llmOutput.tokenUsage was overwritten by each chunk in turn, so only the last chunk carrying usage_metadata won — correct for providers that emit one cumulative total on a final chunk, but wrong for providers (e.g. @langchain/google, @langchain/anthropic) that emit usage_metadata as a per-chunk delta across multiple chunks, where the values must be summed.
Note for provider authors: this assumes each streamed chunk's usage_metadata is either a per-chunk delta or appears only on a single final chunk. A provider that instead repeats a cumulative total on every chunk will now see it summed (and inflated) in llmOutput.tokenUsage, matching the existing behavior of the correctly-working message.usage_metadata field.
Also fixes @langchain/google's invoke({streaming: true}) path (no streaming-preferring callback attached), where llmOutput was never populated at all.
#11590 ffebdc2 Thanks @thushanth-bengre-langchain! - Fix OpenAI Responses API replay under Zero Data Retention when a response contains more than one reasoning item, for both v0 and v1. In v0, the default replay path now reuses response_metadata.output directly, preserving every reasoning item's id/encrypted_content in original order. In v1, AIMessage.contentBlocks (outputVersion: "v1") is fixed the same way. additional_kwargs.reasoning is unchanged.
### Patch Changes - #10047 `ff1248f` Thanks @afirstenberg! - fix(core): BaseMessage.text use contentBlocks
ff1248f Thanks @afirstenberg! - fix(core): BaseMessage.text use contentBlocks### Patch Changes - #11402 `43e4396` Thanks @thushanth-bengre-langchain! - Fix ChatVertexAI/ChatGoogle content blocks: include tool_call blocks from m
43e4396 Thanks @thushanth-bengre-langchain! - Fix ChatVertexAI/ChatGoogle content blocks: include tool_call blocks from message.tool_calls and skip spurious empty text blocks in contentBlocks.Retry middleware retried every failure up to maxRetries, including deterministic ones like a bad API key or an unknown model. Retries also nest, so a
#11369 d6ad973 Thanks @hntrl! - fix(langchain): use unified endpoint for gateway
#11342 3b0e4c4 Thanks @thushanth-bengre-langchain! - feat(core): mark errors as retryable or not, and stop retrying the ones that aren't
Retry middleware retried every failure up to maxRetries, including deterministic ones like a bad API key or an unknown model. Retries also nest, so a single such failure could cost dozens of API calls.
@langchain/core/errors adds stampRetryable(error, retryable) and getRetryable(error). Marking an error leaves its class and shape untouched, so a provider SDK error can be classified without breaking instanceof. getRetryable returns undefined for errors nobody classified, and both are exported so tool authors can mark their own failures.
modelRetryMiddleware and toolRetryMiddleware now respect the mark by default, and retries stop as soon as one is found rather than each layer spending its own budget. Aborted calls, context overflow, and oversized payloads are marked non-retryable out of the box.
Models accept a per-call maxRetries so a surrounding retry loop can take over.
Behavior change: errors marked non-retryable now fail on the first attempt. Unclassified errors — including any from third-party integrations or custom tools — retry exactly as before. Pass retryOn: () => true to restore the old default. A custom onFailedAttempt replaces the built-in handler and opts out of marking.
### Patch Changes - #11366 `c068bbf` Thanks @hntrl! - fix(core,langchain): patch and release core, update peer dependencies
We have some internal schemas that rely on z.instanceof(). This uses a strict instanceof check which can conflict if there are multiple versions of co
#11344 f08e0c6 Thanks @hntrl! - fix: apply [Symbol.hasInstance] method to all comparable properties using .isInstance()
We have some internal schemas that rely on z.instanceof(). This uses a strict instanceof check which can conflict if there are multiple versions of core installed. This overrides the Symbol.hasInstance method to use the same logic as .isInstance() to compare objects at runtime.
### Patch Changes - #11305 `e654022` Thanks @jacoblee93! - Add LangSmith Gateway environment configuration to OpenAI, Anthropic, and Fireworks chat mo
#11305 e654022 Thanks @jacoblee93! - Add LangSmith Gateway environment configuration to OpenAI, Anthropic, and Fireworks chat models.
#11295 1a1b347 Thanks @vladislav-nechakhin! - fix(core): pass the mustache escape override per render call
### Patch Changes - #11190 `9654bde` Thanks @pawel-twardziak! - Coalesce nested LangChain tracer callbacks that share run bookkeeping. - #11153 `84ce6
#11190 9654bde Thanks @pawel-twardziak! - Coalesce nested LangChain tracer callbacks that share run bookkeeping.
#11153 84ce6d6 Thanks @parveshsaini! - fix(core): bind splitText when trimMessages receives a TextSplitter instance
Emit standard reasoning blocks with preserved signatures, omit incomplete signature-only reasoning during replay, and retain compatibility with legacy
Prevent contentBlocks.push is not a function when constructing an AIMessage with response_metadata.output_version === "v1" and string content (common
#11171 82bef01 Thanks @christian-bromann! - fix(core): coerce string v1 AIMessage content to text blocks
Prevent contentBlocks.push is not a function when constructing an
AIMessage with response_metadata.output_version === "v1" and string
content (common in serialized LangGraph stream payloads).
### Patch Changes - #12192 `9920d4b` Thanks @jkennedyvz! - Require Zod 4.6.6 or newer for installed dependencies to exclude versions affected by GHSA-
9920d4b Thanks @jkennedyvz! - Require Zod 4.6.6 or newer for installed dependencies to exclude versions affected by GHSA-mrhx-c7xc-m3w5. Zod v3 schemas remain supported through the bundled zod/v3 entry point.#10674 f017708 Thanks @christian-bromann! - fix: classify provider 429s before retrying
#11092 7918bbd Thanks @aolsenjazz! - fix(core): only treat arrays of content blocks as ToolMessage content
Fix tool outputs that are arrays of plain objects being forwarded as malformed message content. An array is now only treated as message content blocks when every element is an object with a type; otherwise it is JSON-stringified.
### Minor Changes - #10924 `2e28115` Thanks @christian-bromann! - feat(mistralai): add native streamEvents event conversion
2e28115 Thanks @christian-bromann! - feat(mistralai): add native streamEvents event conversion2e28115 Thanks @christian-bromann! - feat(core): add OpenAI-compatible stream event conversion#11047 ac0f71d Thanks @christian-bromann! - fix(core): preserve AIMessage content blocks
Keep existing v1 contentBlocks when constructing AIMessage instances so serialized messages do not lose block content during deserialization.
66effb0 Thanks @dependabot! - chore(deps): bump groq-sdk from 0.37.0 to 1.1.2Nothing published for this version
Nothing published for this version
Nothing published for this version
Remove unnecessary TStructure generic from RemoveMessage — its content is always [], so the type parameter only caused incompatibilities when passing
#10679 1f7b495 Thanks @hnustwjj! - fix(core): make RemoveMessage type-compatible across MessageStructure variants
Remove unnecessary TStructure generic from RemoveMessage — its content is always [], so the type parameter only caused incompatibilities when passing RemoveMessage into APIs expecting a different MessageStructure (e.g. @langchain/langgraph-sdk's Message<DefaultToolCall>). Also add { type: "remove"; id: string } to BaseMessageLike so the serialized format is accepted by TypeScript, matching the existing runtime behavior in coerceMessageLikeToMessage.
Nothing published for this version
Nothing published for this version
convertOpenRouterResponseToBaseMessage and convertOpenRouterDeltaToBaseMessageChunk now copy OpenRouter's reasoning (flat string) and reasoning_detail
#10832 1b24369 Thanks @info-arnav! - fix(core, openrouter): make CJS default re-exports callable
#10666 2bb55b0 Thanks @hnustwjj! - feat(openrouter): surface reasoning content as v1 standard content blocks
convertOpenRouterResponseToBaseMessage and
convertOpenRouterDeltaToBaseMessageChunk now copy OpenRouter's
reasoning (flat string) and reasoning_details (structured array) fields
onto additional_kwargs.reasoning_content / additional_kwargs.reasoning_details.
A new ChatOpenRouterTranslator is registered in @langchain/core under
the "openrouter" provider key so AIMessage.contentBlocks emits standard
{type: "reasoning"} blocks alongside text and tool calls.
Previously, reasoning text returned by reasoning-capable models routed
through OpenRouter (DeepSeek R1, Minimax M2, Claude extended thinking,
o-series, etc.) was silently dropped: only the reasoning_tokens count
was preserved via usage_metadata. Consumers using standard content blocks
(including the frontend agent UI patterns shown in the docs) could not
display the model's chain of thought.
#10918 3999fab Thanks @christian-bromann! - fix(openai): stream custom tool calls through Responses API chunks
Add v6 UUID generation support to @langchain/core/utils/uuid by vendoring the upstream uuidjs v6 implementation and its v1ToV6 helper, exporting v6 fr
#10906 f61b345 Thanks @hntrl! - feat(core): add uuid v6 utility support
Add v6 UUID generation support to @langchain/core/utils/uuid by vendoring the upstream uuidjs v6 implementation and its v1ToV6 helper, exporting v6 from the UUID utils index, and adding tests for deterministic generation, buffer/offset behavior, validation/versioning, and ordering.
#10872 a640079 Thanks @hntrl! - chore(deps): remove redundant @types/uuid declarations
Remove @types/uuid from package manifests that rely on @langchain/core/utils/uuid or do not require uuid type stubs directly, and refresh the lockfile entries accordingly.
#10792 3682268 Thanks @Genmin! - fix(core): apply v1 message casting after implicit streaming aggregation
#10901 f26fc4a Thanks @christian-bromann! - fix(testing): share fakeModel invocation state across bindTools instances
Remove direct runtime dependencies on ansi-styles, camelcase, and decamelize by inlining equivalent logic in core internals, and enable npm provenance
#10847 1659e7d Thanks @hntrl! - chore(core): reduce transitive dependency exposure and tighten release hygiene
Remove direct runtime dependencies on ansi-styles, camelcase, and decamelize
by inlining equivalent logic in core internals, and enable npm provenance in the
release workflow.
#10790 ef78bc6 Thanks @Genmin! - fix(core): keep different content block types separate when merging chunks
### Patch Changes - #10833 `6cf39fe` Thanks @colifran! - chore(core): deprecate streamLog, streamEvents v1, RunnableWithMessageHistory and improve thr
### Patch Changes - #10822 `922a040` Thanks @christian-bromann! - fix(core): translate content block delta for other models
922a040 Thanks @christian-bromann! - fix(core): translate content block delta for other modelsEnsure structured output parsers read BaseMessage text content when includeRaw: true, so responses that include reasoning/thought blocks plus JSON tex
#10814 dfec1b7 Thanks @hntrl! - fix(google): restore structured output parsing with includeRaw and reasoning blocks
Ensure structured output parsers read BaseMessage text content when includeRaw: true, so responses that include reasoning/thought blocks plus JSON text continue to parse correctly.
#10772 1ba7131 Thanks @christian-bromann! - chore(core): new stream primitives
Nothing published for this version
### Patch Changes - #10776 `20a9abe` Thanks @hntrl! - fix(deps): remediate uuid vulnerability by removing direct uuid usage
### Patch Changes - #10733 `589f29c` Thanks @jacoblee93! - fix(core): Update inheritance behavior for tracer metadata for special keys - #10711 `2e9e6
#10733 589f29c Thanks @jacoblee93! - fix(core): Update inheritance behavior for tracer metadata for special keys
#10711 2e9e696 Thanks @jacoblee93! - feat(core): Add chat model and llm invocation params to traced metadata
Add tracer-scoped inheritable metadata/tag options in callback manager while keeping backward-compatible aliases.
d3e0809 Thanks @hntrl! - refactor(core): decouple tracer-only metadata defaults from runnable metadata
ensureConfig metadata mirroring limited to model.LangChainTracer default metadata/tag handling and add regression tests for stream events metadata behavior.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
### Patch Changes - #10430 `d3d0922` Thanks @christian-bromann! - feat(langchain): support for browser tools
d3d0922 Thanks @christian-bromann! - feat(langchain): support for browser toolsNothing published for this version
One column per quarter.