Packages

langchain

1.6.7 · 18 Nov 2026MIT4.2M / weekRepositoryHomepagenpmAtom feed

Your version

404 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.

  1. 1.6.7

    18 Nov 2026
    • 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 messages

    • langchain: Make ConfigurableModel non-configurable when configurableFields is omitted

      initChatModel with a model and no configurableFields (and direct new ConfigurableModel(...) without it) no longer lets configurable.model / configurable.modelProvider swap the model at invoke time, matching the docs. Pass configurableFields: ["model", "modelProvider"] to keep runtime model swapping.

  2. 1.6.6

    13 Nov 2026
    • Prevent a failed tool call or subagent from crashing the process when its output promise is never consumed

    • Apply a Command returned from wrapModelCall once when outer middleware passes it through

  3. 1.6.5

    11 Nov 2026
    • Breaking

      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.

    • langchain: Add model router and auto mode middleware

  4. 1.6.4

    10 Nov 2026
    • langchain: Add modelRefusalMiddleware

      modelRefusalMiddleware() throws ModelRefusalError when the model refuses, instead of ending the run as if it succeeded. Middleware now passes ModelRefusalError through unwrapped instead of as a MiddlewareError.

  5. 1.6.3

    7 Nov 2026
    • modelRetryMiddleware now retries errors that are subclasses of a class listed in retryOn. Previously the array form matched only the exact constructor, so retryOn: [APIError] never retried a RateLimitError. This matches toolRetryMiddleware.

    • langchain: Preserve model errors propagated through middleware

  6. 1.6.2

    5 Nov 2026
    • Add tracePolicy to createMiddleware, applied to the middleware's lifecycle hook runs. It only changes what LangChainTracer sends to LangSmith (use omitPayload from @langchain/core/tracers/tracer_langchain). Requires @langchain/langgraph >= 1.6.1.

  7. 1.6.1

    3 Nov 2026
    • langchain: humanInTheLoopMiddleware — execute approved, edited and auto-approved tool calls when other calls in the same interrupt are rejected, instead of dropping them without a ToolMessage (caused "400 No tool output found for function call" on subsequent model requests)

  8. 1.6.0

    28 Oct 2026
    • Add a beta OpenAIDecisions runnable with typed predicate, choice and score questions, plus model-routing and tool-risk agent middleware.

  9. 1.5.20

    27 Oct 2026
    • langchain: re-throw a drained tool from the agent's ToolNode

      A tool that throws GraphDrained, for example one whose inner graph run is drained with RunControl.requestDrain(), now stops the agent run with that error, as an interrupt already did, instead of coming back as an error ToolMessage that lets the agent go on as if the tool had failed.

  10. 1.5.19

    22 Oct 2026
    • Avoid copying full agent state into every parallel tool task. Restore tool and middleware state from graph channels for compact tasks while continuing to support full-state tasks saved in older checkpoints.

    • Align the default todo-list system prompt and tool description with Python, including guidance to deliver the substantive final answer after the last write_todos result.

  11. 1.5.18

    16 Oct 2026
    • agents: Add opt-in interruptMode: "per_call" to humanInTheLoopMiddleware. Each gated tool call raises its own interrupt (type: "tool_approval", with a typed responseSchema built from the tool's allowed decisions), answered by interrupt ID. respond is supported. Edits are pinned to the called tool and checked against the input side of its Zod v4 schema, so its transforms run once, when the tool does. An invalid answer throws without being saved. Also adds Interrupt.response_schema. In both modes, interruptOn: { tool: true } now allows every decision, respond included, as in Python; batched mode is otherwise unchanged.

  12. 1.5.17

    15 Oct 2026
  13. 1.5.16

    8 Oct 2026
    • langchain: createAgent with middleware now passes a Command built by a different copy of @langchain/langgraph to the graph as-is, instead of merging it into the input state as a plain object.

  14. 1.5.15

    1 Oct 2026
    • Preserve LangGraph interrupts in toolRetryMiddleware instead of retrying them or converting them into tool errors. Interrupted tool calls can pause and resume through their checkpointer without being treated as failures.

  15. 1.5.14

    27 Sep 2026
    • createAgent no longer ends the run when a returnDirect tool fails. A tool error, including arguments that fail the tool's schema, now goes back to the model so it can correct the call and retry; the run still ends on the first successful returnDirect result. Error ToolMessages produced by the tool node now carry status: "error", and a ToolMessage returned from a custom handleToolErrors function defaults to that status when it sets none.

  16. 1.5.12

    22 Sep 2026
    • Preserve ReactAgent callbacks when its compiled graph is extracted, without duplicate calls through the agent.

  17. 1.5.11

    9 Sep 2026
    • agents: Ignore thought/reasoning text blocks when parsing structured output in ProviderStrategy

  18. 1.5.10

    20 Aug 2026

    Maintenance only: docs, tests, build or refactoring. Nothing changes in how you use it.

  19. 1.5.9

    14 Aug 2026
    • langchain: Use unified endpoint for gateway

    • 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.

  20. 1.5.8

    13 Aug 2026
    • core,langchain: Patch and release core, update peer dependencies

  21. 1.5.7

    13 Aug 2026
    • langchain: Add langsmith gateway to initChatModel- #11362

  22. 1.5.6

    12 Aug 2026
    • langchain: Exclude middleware-internal model calls from the message projection

      Bookkeeping model calls made by summarizationMiddleware and toolEmulatorMiddleware no longer appear in run.messages or stream({ streamMode: "messages" }), and the summary summarizationMiddleware writes back to state is no longer projected as a new message. These calls remain observable via streamEvents({ version: "v2" }), identified by lc_source.

    • 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.

  23. 1.5.5

    5 Aug 2026
    • langchain: Resolve LocalFileStore keys with path.relative

  24. 1.5.4

    24 Jul 2026
    • langchain: Add middleware for handling tool execution errors

  25. 1.5.3

    8 Jul 2026
    • langchain: Malformed tool input schemas are unrecoverable

  26. 1.5.2

    23 Jun 2026
    • langchain, openai: Decouple strict tools from strict structured output response

  27. 1.5.1

    22 Jun 2026
    • langchain: Keep tool call streams pending across any tool interrupt

      A raw interrupt() raised from inside a tool surfaced as a tool-error and
      rejected the call's un-awaited output promise, producing an unhandled
      rejection that crashed HITL runs. The tool-call stream transformer now treats
      any serialized graph interrupt as control flow (the call stays pending and
      resumes), not just humanInTheLoopMiddleware interrupts.

  28. 1.5.0

    18 Jun 2026
    • langchain: Surface tool-dispatched subagents on run.subagents

      Add a native subagent stream transformer to createAgent so v3 runs expose
      named nested agents (createAgent({ name }) invoked from tools) as typed
      SubagentRunStream handles with name, cause, scoped messages /
      toolCalls, and output. Refactors agent stream transformers into
      agents/transformers/ and exports only the public stream types from the
      package entry.

  29. 1.4.6

    17 Jun 2026
    • langchain: Add when predicate to human-in-the-loop middleware

      Add an optional when callback on InterruptOnConfig so callers can
      dynamically skip interrupts for specific tool calls. The predicate receives
      a ToolCallRequest (batch afterModel context) and returns whether to
      interrupt or auto-approve, matching Python HumanInTheLoopMiddleware.

    • aws: Bedrock prompt caching middleware

      Adds bedrockPromptCachingMiddleware. The interface largely matches what was previous implemented with anthropicPromptCachingMiddleware, making a best-effort attempt at utilizing prompt caching features for supported models.

  30. 1.4.4 – 1.4.52 releases without a noteShow each
  31. 1.4.2

    21 May 2026
    • langchain: Unwrap tool message outputs in agent streams

    • langchain: Set name on todoListMiddleware ToolMessages

  32. 1.4.1

    18 May 2026
    • langchain/createAgent: Throw on terminal providerStrategy parse failure instead of silently resolving with structuredResponse: undefined

      When createAgent was configured with responseFormat resolving to a providerStrategy (either passed explicitly or auto-promoted from a bare Zod / JSON schema for models whose profile reports structuredOutput: true), and the model produced a terminal response (no tool_calls) whose text could not be JSON-parsed or did not satisfy the schema, the agent silently exited with no structuredResponse, surfacing later as TypeError: Cannot read properties of undefined. The agent now throws a StructuredOutputParsingError in that case while still allowing the agent loop to continue when tool calls are present. Closes #10878.

    • langchain: Prevent llmToolSelectorMiddleware from leaking into message stream

  33. 1.3.5 – 1.4.02 releases without a noteShow each
  34. 1.3.4

    22 Apr 2026
    • langchain: Adds ls_agent_type to create agent runs as tracing metadata

  35. 1.3.3

    15 Apr 2026
    • Prevent local file corruption when using LocalFileStore

  36. 1.3.2

    13 Apr 2026
    • agents: Derive middleware hook state from invocation state

      Prevents middleware state from leaking across threads by deriving middleware hook input state from the current invocation state instead of cross-node cached state.

  37. 1.3.1

    7 Apr 2026
  38. 1.3.0

    3 Apr 2026
    • langchain: Support for browser tools

    • Add @langchain/perplexity standalone provider package

    • fireworks: Extract standalone provider package

  39. 1.2.39

    31 Mar 2026
    • langchain: Allow dynamic tools in wrapModelCall with wrapToolCall

    • langchain: Add support for dynamic structured output

    • langchain: Bump langgraph dep

  40. 1.2.38

    30 Mar 2026
    • langchain: Export createAgent and prebuilt middleware from browser entry point

    • langchain: Revert zod import in utils.ts to fix v3/v4 interop

  41. 1.2.37

    24 Mar 2026
    • langchain: Add "aws" alias to MODEL_PROVIDER_CONFIG so hub/node auto-detects ChatBedrockConverse from Python-serialized prompts

    • Align Zod Importation For 'libs/langchain/src/agents/nodes/utils.ts'

  42. 1.2.36

    22 Mar 2026
    • Support structured output (providerStrategy) for Google Gemini models in createAgent

    • Add LangSmith integration metadata to createAgent and initChatModel

  43. 1.2.35

    18 Mar 2026
    • Renamed getSubgraphAsync -> getSubgraphsAsync

  44. 1.2.34

    17 Mar 2026
    • langchain: Respect version:"v1" in afterModel router's pending tool call path

    • agents: Propagate store and configurable to ToolNode middleware runtime

    • langchain/agents: Dispatch tool calls via Send in afterModel router for version:"v2"

      Breaking change for version: "v2" + afterModel middleware users.

      Previously, when afterModel middleware was present, createAgent always routed all tool calls from an AIMessage to a single ToolNode invocation — regardless of the version option. This meant version: "v2" silently behaved like version: "v1" (parallel via Promise.all in one node) whenever afterModel middleware was used.

      #createAfterModelRouter now correctly respects #toolBehaviorVersion:

      Migration: If you use version: "v2" (the default) together with afterModel middleware and rely on the previous single-node parallel execution, switch to version: "v1" to preserve that behaviour. See the version JSDoc on CreateAgentParams for guidance on which option to choose.

  45. 1.2.33

    17 Mar 2026
    • langchain/agents: Fix ReactAgent routing with returnDirect + beforeModel middleware

      This fixes a routing error when an agent has both tools with returnDirect: true and middleware with beforeModel hooks (e.g., summarizationMiddleware). Before this fix, non-returnDirect tools would fail with "Branch condition returned unknown or null destination".

  46. 1.2.32

    12 Mar 2026
    • langchain: Add browser export

  47. 1.2.31

    11 Mar 2026
    • langchain: Export todo schema

    • Implement type inference for tool streams

    • langchain: Serializable schemas aren't exposed on create agent response format

  48. 1.2.30

    5 Mar 2026
    • Move fakeModel from utils/testing to testing namespace
      move to updated namespace

    • Add custom Vitest matchers for LangChain message and tool call assertions

      Adds a new @langchain/core/testing/matchers export containing custom Vitest matchers (toBeHumanMessage, toBeAIMessage, toBeSystemMessage, toBeToolMessage, toHaveToolCalls, toHaveToolCallCount, toContainToolCall, toHaveToolMessages, toHaveBeenInterrupted, toHaveStructuredResponse) that external users can register via expect.extend(langchainMatchers) in their Vitest setup files. Re-exported from langchain for convenience.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.