From d783557983a1fa1f5758e6b06f33be3ce4637e27 Mon Sep 17 00:00:00 2001 From: Sydney Runkle Date: Thu, 20 Nov 2025 16:14:06 -0500 Subject: [PATCH 01/21] relnotes draft --- src/docs.json | 6 +- .../javascript/releases/langchain-v1-1.mdx | 68 +++++++++++++++++++ src/oss/python/releases/langchain-v1-1.mdx | 62 +++++++++++++++++ 3 files changed, 134 insertions(+), 2 deletions(-) create mode 100644 src/oss/javascript/releases/langchain-v1-1.mdx create mode 100644 src/oss/python/releases/langchain-v1-1.mdx diff --git a/src/docs.json b/src/docs.json index edf08f57ab..edd1080727 100644 --- a/src/docs.json +++ b/src/docs.json @@ -412,7 +412,8 @@ { "group": "Releases", "pages": [ - "oss/python/releases/langchain-v1" + "oss/python/releases/langchain-v1", + "oss/python/releases/langchain-v1-1" ] }, { @@ -782,7 +783,8 @@ { "group": "Releases", "pages": [ - "oss/javascript/releases/langchain-v1" + "oss/javascript/releases/langchain-v1", + "oss/javascript/releases/langchain-v1-1" ] }, { diff --git a/src/oss/javascript/releases/langchain-v1-1.mdx b/src/oss/javascript/releases/langchain-v1-1.mdx new file mode 100644 index 0000000000..59e4c3c666 --- /dev/null +++ b/src/oss/javascript/releases/langchain-v1-1.mdx @@ -0,0 +1,68 @@ +--- +title: What's new in v1.1 +sidebarTitle: v1.1 Release notes +--- + +**LangChain v1.1 focuses on improving agent reliability and flexibility.** This release introduces model profiles, new middleware capabilities, and enhanced type safety for custom middleware implementations. + +To upgrade, + + +```bash npm +npm install @langchain/core @langchain/langgraph +``` +```bash pnpm +pnpm add @langchain/core @langchain/langgraph +``` +```bash yarn +yarn add @langchain/core @langchain/langgraph +``` +```bash bun +bun add @langchain/core @langchain/langgraph +``` + + +## Model profiles + +Model profiles allow you to configure how agents interact with specific models by defining capabilities, context handling, and structured output behavior. + +### Summarization middleware + +### Structured output for agents + +## Model retry middleware + +## Misc + +### New middleware docs + +### Type safety improvements for custom middlewares + +## Reporting issues + +Please report any issues discovered with v1.1 on [GitHub](https://github.com/langchain-ai/langchainjs/issues) using the [`'v1.1'` label](https://github.com/langchain-ai/langchainjs/issues?q=state%3Aopen%20label%3Av1.1). + +## Additional resources + + + + Learn about building agents with LangChain + + + Deep dive into middleware concepts + + + Working with tools in agents + + + How to migrate to LangChain v1 + + + Report issues or contribute + + + +## See also + +- [Versioning](/oss/javascript/versioning) - Understanding version numbers +- [Release policy](/oss/javascript/release-policy) - Detailed release policies diff --git a/src/oss/python/releases/langchain-v1-1.mdx b/src/oss/python/releases/langchain-v1-1.mdx new file mode 100644 index 0000000000..7c3f1c3ee8 --- /dev/null +++ b/src/oss/python/releases/langchain-v1-1.mdx @@ -0,0 +1,62 @@ +--- +title: What's new in v1.1 +sidebarTitle: v1.1 Release notes +--- + +**LangChain v1.1 focuses on improving agent reliability and flexibility.** This release introduces model profiles, new middleware capabilities, and enhanced type safety for custom middleware implementations. + +To upgrade, + + +```bash pip +pip install -U langchain +``` +```bash uv +uv add langchain +``` + + +## Model profiles + +Model profiles allow you to configure how agents interact with specific models by defining capabilities, context handling, and structured output behavior. + +### Summarization middleware + +### Structured output for agents + +## Model retry middleware + +## Misc + +### New middleware docs + +### Type safety improvements for custom middlewares + +## Reporting issues + +Please report any issues discovered with v1.1 on [GitHub](https://github.com/langchain-ai/langchain/issues) using the [`'v1.1'` label](https://github.com/langchain-ai/langchain/issues?q=state%3Aopen%20label%3Av1.1). + +## Additional resources + + + + Learn about building agents with LangChain + + + Deep dive into middleware concepts + + + Working with tools in agents + + + How to migrate to LangChain v1 + + + Report issues or contribute + + + +## See also + +- [Versioning](/oss/python/versioning) - Understanding version numbers +- [Release policy](/oss/python/release-policy) - Detailed release policies From f909b9a732a633fcae85979ce99bb0549e6931d4 Mon Sep 17 00:00:00 2001 From: Christian Bromann Date: Fri, 21 Nov 2025 13:00:05 -0800 Subject: [PATCH 02/21] v1.1 JS release notes (#1557) cc @hntrl --- pipeline/preprocessors/link_map.py | 3 + .../javascript/releases/langchain-v1-1.mdx | 82 +++++++++++++++++-- src/oss/langchain/middleware/custom.mdx | 73 +++++++++++++++++ 3 files changed, 151 insertions(+), 7 deletions(-) diff --git a/pipeline/preprocessors/link_map.py b/pipeline/preprocessors/link_map.py index a669356765..3663856c4d 100644 --- a/pipeline/preprocessors/link_map.py +++ b/pipeline/preprocessors/link_map.py @@ -302,6 +302,9 @@ class LinkMap(TypedDict): # @langchain/core references "AIMessage": "classes/_langchain_core.messages.AIMessage.html", "AIMessageChunk": "classes/_langchain_core.messages.AIMessageChunk.html", + "SystemMessage": "classes/_langchain_core.messages.SystemMessage.html", + "SystemMessage.concat": "classes/_langchain_core.messages.SystemMessage.html#concat", + "ModelRequest": "classes/_langchain_core.messages.ModelRequest.html", "BaseChatModel.invoke": "classes/_langchain_core.language_models_chat_models.BaseChatModel.html#invoke", "BaseChatModel.stream": "classes/_langchain_core.language_models_chat_models.BaseChatModel.html#stream", "BaseChatModel.streamEvents": "classes/_langchain_core.language_models_chat_models.BaseChatModel.html#streamEvents", diff --git a/src/oss/javascript/releases/langchain-v1-1.mdx b/src/oss/javascript/releases/langchain-v1-1.mdx index 59e4c3c666..604be6f421 100644 --- a/src/oss/javascript/releases/langchain-v1-1.mdx +++ b/src/oss/javascript/releases/langchain-v1-1.mdx @@ -3,7 +3,7 @@ title: What's new in v1.1 sidebarTitle: v1.1 Release notes --- -**LangChain v1.1 focuses on improving agent reliability and flexibility.** This release introduces model profiles, new middleware capabilities, and enhanced type safety for custom middleware implementations. +**LangChain v1.1 focuses on improving agent reliability and flexibility.** This release introduces model profiles for better model capability awareness, new middleware capabilities for retrying model calls and content moderation, improved system message handling, and enhanced compatibility with Zod v4. To upgrade, @@ -24,19 +24,87 @@ bun add @langchain/core @langchain/langgraph ## Model profiles -Model profiles allow you to configure how agents interact with specific models by defining capabilities, context handling, and structured output behavior. +Model profiles provide a standardized way to understand model capabilities and constraints. Every chat model now exposes a `.profile` getter that returns information about context window size, structured output support, and other model-specific characteristics. -### Summarization middleware +```typescript +import { initChatModel } from "langchain"; -### Structured output for agents +const model = await initChatModel("gpt-4o"); +const profile = model.profile; + +console.log(profile.maxTokens); // Maximum context window size +console.log(profile.supportsStructuredOutput); // Native structured output support +``` + +Profiles are automatically generated from [models.dev](https://models.dev) and enable middleware like summarization to use accurate token limits, while `createAgent` can automatically detect native structured output support. + +## System message improvements + +You can now pass a `SystemMessage` instance directly to the `systemPrompt` parameter when creating agents, and use the new `concat` method to extend system messages. This enables advanced features like cache control (e.g., Anthropic's ephemeral cache) and structured content blocks. + +```typescript +import { createAgent, SystemMessage } from "langchain"; + +// SystemMessage instance with cache control +const agent = createAgent({ + model: "anthropic:claude-3-5-sonnet", + tools: [myTool], + systemPrompt: new SystemMessage({ + content: [ + { + type: "text", + text: "You are a helpful assistant.", + }, + { + type: "text", + text: "Today's date is 2024-06-01.", + cache_control: { type: "ephemeral", ttl: "5m" }, + }, + ], + }), +}); +``` + +When using middleware with `wrapModelCall`, you can modify system prompts using either `systemPrompt` (string) or `systemMessage` (SystemMessage object). See the [custom middleware documentation](/oss/langchain/middleware/custom#working-with-system-messages) for detailed examples and best practices. ## Model retry middleware -## Misc +A new `modelRetryMiddleware` automatically retries failed model calls with configurable exponential backoff, improving agent reliability by handling transient model failures gracefully. + +```typescript +import { createAgent, modelRetryMiddleware } from "langchain"; + +const agent = createAgent({ + model: "gpt-4o", + tools: [searchTool, databaseTool], + middleware: [ + modelRetryMiddleware({ + maxRetries: 3, + backoffFactor: 2.0, + initialDelayMs: 1000, + }), + ], +}); +``` + +See the [built-in middleware documentation](/oss/langchain/middleware/built-in) for configuration options and detailed examples. + +## OpenAI content moderation middleware + +A new middleware integrates OpenAI's moderation endpoint to detect and handle unsafe content in agent interactions. This middleware is useful for applications requiring content safety and compliance. + +The middleware can check content at multiple stages: +- **Input checking**: User messages before model calls +- **Output checking**: AI messages after model calls +- **Tool results**: Tool outputs before model calls + +You can configure how violations are handled with options like ending execution, raising errors, or replacing flagged content. See the [middleware documentation](/oss/langchain/middleware/built-in#content-moderation) for detailed usage examples. + +## Compatibility improvements -### New middleware docs +### Zod v4 support -### Type safety improvements for custom middlewares +LangChain.js now supports Zod v4, ensuring seamless integration with the latest version of the schema validation library. This update maintains backward compatibility while enabling you to use the latest Zod features for structured output and tool schemas. ## Reporting issues diff --git a/src/oss/langchain/middleware/custom.mdx b/src/oss/langchain/middleware/custom.mdx index 318cc5d784..1c907ea253 100644 --- a/src/oss/langchain/middleware/custom.mdx +++ b/src/oss/langchain/middleware/custom.mdx @@ -908,6 +908,79 @@ const agent = createAgent({ ::: +### Working with system messages + +You can modify system prompts in middleware using either `systemPrompt` (`string`) or `systemMessage` (@[`SystemMessage`]). The @[`ModelRequest`] provides both for maximum flexibility. + +**Key behavior:** +- Middleware receives both `systemPrompt` (string) and `systemMessage` (@[`SystemMessage`]) in the request +- You can modify either `systemPrompt` or `systemMessage`, but **cannot set both in the same middleware call** - this prevents conflicts +- Using `systemPrompt` creates a new simple system message (may overwrite cache control metadata) +- Using `systemMessage` (JavaScript) or manually combining content blocks (Python) preserves existing cache control and structured content blocks +- Multiple middleware can chain modifications sequentially across different middleware calls + +:::python + +```python +@wrap_model_call +def add_context_preserve_cache( + request: ModelRequest, + handler: Callable[[ModelRequest], ModelResponse], +) -> ModelResponse: + new_system_message = SystemMessage(content="Additional context.") + return handler(request.override(system_message=new_system_message)) +``` +::: + +:::js +**Example: Chaining middleware** - Different middleware can use different approaches: + +```typescript +import { createMiddleware, SystemMessage, createAgent } from "langchain"; + +// Middleware 1: Uses systemPrompt (string) +const myMiddleware = createMiddleware({ + name: "MyMiddleware", + wrapModelCall: async (request, handler) => { + return handler({ + ...request, + systemPrompt: request.systemMessage.concat(`\nAdditional context.`), + }); + }, +}); + +// Middleware 2: Uses systemMessage (preserves structure) +const myOtherMiddleware = createMiddleware({ + name: "MyOtherMiddleware", + wrapModelCall: async (request, handler) => { + return handler({ + ...request, + systemMessage: request.systemMessage.concat( + new SystemMessage({ + content: [ + { + type: "text", + text: " More additional context. This will be cached.", + cache_control: { type: "ephemeral", ttl: "5m" }, + }, + ], + }) + ), + }); + }, +}); + +const agent = createAgent({ + model: "anthropic:claude-3-5-sonnet", + systemPrompt: "You are a helpful assistant.", + middleware: [myMiddleware, myOtherMiddleware], +}); +``` + +Use @[`SystemMessage.concat`] to preserve cache control metadata or structured content blocks created by other middleware. + +::: + ## Additional resources - [Middleware API reference](https://reference.langchain.com/python/langchain/middleware/) From 6d8570ddabcea54a4ff34ed472d47396aaaccd30 Mon Sep 17 00:00:00 2001 From: Chester Curme Date: Fri, 21 Nov 2025 16:52:49 -0500 Subject: [PATCH 03/21] updates --- src/oss/python/releases/langchain-v1-1.mdx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/oss/python/releases/langchain-v1-1.mdx b/src/oss/python/releases/langchain-v1-1.mdx index 7c3f1c3ee8..04063e87aa 100644 --- a/src/oss/python/releases/langchain-v1-1.mdx +++ b/src/oss/python/releases/langchain-v1-1.mdx @@ -18,12 +18,22 @@ uv add langchain ## Model profiles -Model profiles allow you to configure how agents interact with specific models by defining capabilities, context handling, and structured output behavior. +Chat models now expose supported features and capabilities through a `.profile` attribute. These data are derived from the [models.dev](https://github.com/sst/models.dev) project, an open source initiative that provides model capability data, and are augmented with additional fields for purposes of use with LangChain. + +See details in the [models](/oss/langchain/models#model-profiles) guide. ### Summarization middleware +The Summarization middleware interface has been updated to support more flexible specification of trigger points for summarization, as well as what context is summarized. These values can vary with model-specific context windows using the model's [profile](/oss/langchain/models#model-profiles). + +See details in the [built-in middleware](/oss/langchain/middleware/built-in#summarization) guide. + ### Structured output for agents +Support for [ProviderStrategy](/oss/langchain/structured-output#provider-strategy) can now be inferred from a model's [profile](/oss/langchain/models#model-profiles). + +See details in the [structured output](/oss/langchain/structured-output) guide. + ## Model retry middleware ## Misc From 1098a58008cf3a0089b1b45172a9d72f75d8c21f Mon Sep 17 00:00:00 2001 From: Mason Daugherty Date: Sat, 22 Nov 2025 04:17:48 -0600 Subject: [PATCH 04/21] nits: v1.1 release notes (#1577) --- src/docs.json | 10 ++++------ src/oss/javascript/releases/langchain-v1-1.mdx | 2 +- src/oss/javascript/releases/langchain-v1.mdx | 4 ++-- src/oss/python/releases/langchain-v1-1.mdx | 2 +- src/oss/python/releases/langchain-v1.mdx | 4 ++-- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/docs.json b/src/docs.json index a86dbe2415..86208ac737 100644 --- a/src/docs.json +++ b/src/docs.json @@ -146,10 +146,9 @@ "pages": [ "oss/python/langchain/overview", { - "group": "LangChain v1.0", + "group": "LangChain v1.1", "pages": [ - "oss/python/releases/langchain-v1", - "oss/python/migrate/langchain-v1" + "oss/python/releases/langchain-v1-1" ] }, { @@ -488,10 +487,9 @@ "pages": [ "oss/javascript/langchain/overview", { - "group": "LangChain v1.0", + "group": "LangChain v1.1", "pages": [ - "oss/javascript/releases/langchain-v1", - "oss/javascript/migrate/langchain-v1" + "oss/javascript/releases/langchain-v1-1" ] }, { diff --git a/src/oss/javascript/releases/langchain-v1-1.mdx b/src/oss/javascript/releases/langchain-v1-1.mdx index 604be6f421..b93a658eb2 100644 --- a/src/oss/javascript/releases/langchain-v1-1.mdx +++ b/src/oss/javascript/releases/langchain-v1-1.mdx @@ -1,6 +1,6 @@ --- title: What's new in v1.1 -sidebarTitle: v1.1 Release notes +sidebarTitle: Release notes --- **LangChain v1.1 focuses on improving agent reliability and flexibility.** This release introduces model profiles for better model capability awareness, new middleware capabilities for retrying model calls and content moderation, improved system message handling, and enhanced compatibility with Zod v4. diff --git a/src/oss/javascript/releases/langchain-v1.mdx b/src/oss/javascript/releases/langchain-v1.mdx index fc756d9341..8ff8ca728c 100644 --- a/src/oss/javascript/releases/langchain-v1.mdx +++ b/src/oss/javascript/releases/langchain-v1.mdx @@ -1,6 +1,6 @@ --- title: What's new in v1 -sidebarTitle: Release notes +sidebarTitle: v1 --- **LangChain v1 is a focused, production-ready foundation for building agents.** We've streamlined the framework around three core improvements: @@ -310,7 +310,7 @@ Please report any issues discovered with 1.0 on [GitHub](https://github.com/lang Read the announcement - + Deep dive into middleware diff --git a/src/oss/python/releases/langchain-v1-1.mdx b/src/oss/python/releases/langchain-v1-1.mdx index 04063e87aa..350a09a817 100644 --- a/src/oss/python/releases/langchain-v1-1.mdx +++ b/src/oss/python/releases/langchain-v1-1.mdx @@ -1,6 +1,6 @@ --- title: What's new in v1.1 -sidebarTitle: v1.1 Release notes +sidebarTitle: Release notes --- **LangChain v1.1 focuses on improving agent reliability and flexibility.** This release introduces model profiles, new middleware capabilities, and enhanced type safety for custom middleware implementations. diff --git a/src/oss/python/releases/langchain-v1.mdx b/src/oss/python/releases/langchain-v1.mdx index c6b387bc83..99ccc6e2d5 100644 --- a/src/oss/python/releases/langchain-v1.mdx +++ b/src/oss/python/releases/langchain-v1.mdx @@ -1,6 +1,6 @@ --- title: What's new in v1 -sidebarTitle: Release notes +sidebarTitle: v1 --- **LangChain v1 is a focused, production-ready foundation for building agents.** We've streamlined the framework around three core improvements: @@ -381,7 +381,7 @@ Please report any issues discovered with 1.0 on [GitHub](https://github.com/lang Read the announcement - + Deep dive into middleware From f9446474b23a29d821fc4dcc920bbae907e5a84d Mon Sep 17 00:00:00 2001 From: Sydney Runkle Date: Sat, 22 Nov 2025 06:10:50 -0500 Subject: [PATCH 05/21] new-org --- src/docs.json | 20 +-- src/oss/javascript/releases/changelog.mdx | 24 ++++ .../javascript/releases/langchain-v1-1.mdx | 136 ------------------ src/oss/javascript/releases/langchain-v1.mdx | 2 +- src/oss/langchain/middleware/custom.mdx | 10 ++ src/oss/python/releases/changelog.mdx | 24 ++++ src/oss/python/releases/langchain-v1-1.mdx | 72 ---------- src/oss/python/releases/langchain-v1.mdx | 2 +- 8 files changed, 72 insertions(+), 218 deletions(-) create mode 100644 src/oss/javascript/releases/changelog.mdx delete mode 100644 src/oss/javascript/releases/langchain-v1-1.mdx create mode 100644 src/oss/python/releases/changelog.mdx delete mode 100644 src/oss/python/releases/langchain-v1-1.mdx diff --git a/src/docs.json b/src/docs.json index 86208ac737..bf88a0dbbb 100644 --- a/src/docs.json +++ b/src/docs.json @@ -146,9 +146,11 @@ "pages": [ "oss/python/langchain/overview", { - "group": "LangChain v1.1", + "group": "Releases", "pages": [ - "oss/python/releases/langchain-v1-1" + "oss/python/releases/langchain-v1", + "oss/python/releases/changelog", + "oss/python/migrate/langchain-v1" ] }, { @@ -416,8 +418,8 @@ { "group": "Releases", "pages": [ - "oss/python/releases/langchain-v1", - "oss/python/releases/langchain-v1-1" + "oss/python/releases/changelog", + "oss/python/releases/langchain-v1" ] }, { @@ -487,9 +489,11 @@ "pages": [ "oss/javascript/langchain/overview", { - "group": "LangChain v1.1", + "group": "Releases", "pages": [ - "oss/javascript/releases/langchain-v1-1" + "oss/javascript/releases/langchain-v1", + "oss/javascript/releases/changelog", + "oss/javascript/migrate/langchain-v1" ] }, { @@ -791,8 +795,8 @@ { "group": "Releases", "pages": [ - "oss/javascript/releases/langchain-v1", - "oss/javascript/releases/langchain-v1-1" + "oss/javascript/releases/changelog", + "oss/javascript/releases/langchain-v1" ] }, { diff --git a/src/oss/javascript/releases/changelog.mdx b/src/oss/javascript/releases/changelog.mdx new file mode 100644 index 0000000000..1082c60136 --- /dev/null +++ b/src/oss/javascript/releases/changelog.mdx @@ -0,0 +1,24 @@ +--- +title: Changelog +sidebarTitle: Changelog +--- + +A chronological log of updates and improvements to LangChain JavaScript. + +## v1.1 (11/25/2025) + +**LangChain v1.1 focuses on improving agent reliability and flexibility.** This release introduces model profiles for better model capability awareness, new middleware capabilities for retrying model calls and content moderation, improved system message handling, and enhanced compatibility with Zod v4. + +* [Model profiles](/oss/langchain/models#model-profiles): Chat models now expose supported features and capabilities through a `.profile` getter. These data are derived from [models.dev](https://github.com/sst/models.dev), an open source project providing model capability data. +* [System message improvements](/oss/langchain/middleware/custom#working-with-system-messages): Support for passing `SystemMessage` instances directly to `systemPrompt` parameter and new `concat` method for extending system messages. Enables advanced features like cache control and structured content blocks. +* [Model retry middleware](/oss/langchain/middleware/built-in#model-retry): New middleware for automatically retrying failed model calls with configurable exponential backoff, improving agent reliability. +* [Content moderation middleware](/oss/langchain/middleware/built-in#content-moderation): OpenAI content moderation middleware for detecting and handling unsafe content in agent interactions. Supports checking user input, AI output, and tool results. +* [Compatibility improvements](/oss/javascript/releases/langchain-v1#compatibility-improvements): LangChain.js now supports Zod v4 with backward compatibility, enabling use of the latest Zod features for structured output and tool schemas. + +### Resources + +- [Migration guide](/oss/migrate/langchain-v1) - How to migrate to LangChain v1 +- [Release policy](/oss/javascript/release-policy) - Detailed release policies +- [Versioning](/oss/javascript/versioning) - Understanding version numbers +- [Report issues on GitHub](https://github.com/langchain-ai/langchainjs/issues) + diff --git a/src/oss/javascript/releases/langchain-v1-1.mdx b/src/oss/javascript/releases/langchain-v1-1.mdx deleted file mode 100644 index b93a658eb2..0000000000 --- a/src/oss/javascript/releases/langchain-v1-1.mdx +++ /dev/null @@ -1,136 +0,0 @@ ---- -title: What's new in v1.1 -sidebarTitle: Release notes ---- - -**LangChain v1.1 focuses on improving agent reliability and flexibility.** This release introduces model profiles for better model capability awareness, new middleware capabilities for retrying model calls and content moderation, improved system message handling, and enhanced compatibility with Zod v4. - -To upgrade, - - -```bash npm -npm install @langchain/core @langchain/langgraph -``` -```bash pnpm -pnpm add @langchain/core @langchain/langgraph -``` -```bash yarn -yarn add @langchain/core @langchain/langgraph -``` -```bash bun -bun add @langchain/core @langchain/langgraph -``` - - -## Model profiles - -Model profiles provide a standardized way to understand model capabilities and constraints. Every chat model now exposes a `.profile` getter that returns information about context window size, structured output support, and other model-specific characteristics. - -```typescript -import { initChatModel } from "langchain"; - -const model = await initChatModel("gpt-4o"); -const profile = model.profile; - -console.log(profile.maxTokens); // Maximum context window size -console.log(profile.supportsStructuredOutput); // Native structured output support -``` - -Profiles are automatically generated from [models.dev](https://models.dev) and enable middleware like summarization to use accurate token limits, while `createAgent` can automatically detect native structured output support. - -## System message improvements - -You can now pass a `SystemMessage` instance directly to the `systemPrompt` parameter when creating agents, and use the new `concat` method to extend system messages. This enables advanced features like cache control (e.g., Anthropic's ephemeral cache) and structured content blocks. - -```typescript -import { createAgent, SystemMessage } from "langchain"; - -// SystemMessage instance with cache control -const agent = createAgent({ - model: "anthropic:claude-3-5-sonnet", - tools: [myTool], - systemPrompt: new SystemMessage({ - content: [ - { - type: "text", - text: "You are a helpful assistant.", - }, - { - type: "text", - text: "Today's date is 2024-06-01.", - cache_control: { type: "ephemeral", ttl: "5m" }, - }, - ], - }), -}); -``` - -When using middleware with `wrapModelCall`, you can modify system prompts using either `systemPrompt` (string) or `systemMessage` (SystemMessage object). See the [custom middleware documentation](/oss/langchain/middleware/custom#working-with-system-messages) for detailed examples and best practices. - -## Model retry middleware - -A new `modelRetryMiddleware` automatically retries failed model calls with configurable exponential backoff, improving agent reliability by handling transient model failures gracefully. - -```typescript -import { createAgent, modelRetryMiddleware } from "langchain"; - -const agent = createAgent({ - model: "gpt-4o", - tools: [searchTool, databaseTool], - middleware: [ - modelRetryMiddleware({ - maxRetries: 3, - backoffFactor: 2.0, - initialDelayMs: 1000, - }), - ], -}); -``` - -See the [built-in middleware documentation](/oss/langchain/middleware/built-in) for configuration options and detailed examples. - -## OpenAI content moderation middleware - -A new middleware integrates OpenAI's moderation endpoint to detect and handle unsafe content in agent interactions. This middleware is useful for applications requiring content safety and compliance. - -The middleware can check content at multiple stages: -- **Input checking**: User messages before model calls -- **Output checking**: AI messages after model calls -- **Tool results**: Tool outputs before model calls - -You can configure how violations are handled with options like ending execution, raising errors, or replacing flagged content. See the [middleware documentation](/oss/langchain/middleware/built-in#content-moderation) for detailed usage examples. - -## Compatibility improvements - -### Zod v4 support - -LangChain.js now supports Zod v4, ensuring seamless integration with the latest version of the schema validation library. This update maintains backward compatibility while enabling you to use the latest Zod features for structured output and tool schemas. - -## Reporting issues - -Please report any issues discovered with v1.1 on [GitHub](https://github.com/langchain-ai/langchainjs/issues) using the [`'v1.1'` label](https://github.com/langchain-ai/langchainjs/issues?q=state%3Aopen%20label%3Av1.1). - -## Additional resources - - - - Learn about building agents with LangChain - - - Deep dive into middleware concepts - - - Working with tools in agents - - - How to migrate to LangChain v1 - - - Report issues or contribute - - - -## See also - -- [Versioning](/oss/javascript/versioning) - Understanding version numbers -- [Release policy](/oss/javascript/release-policy) - Detailed release policies diff --git a/src/oss/javascript/releases/langchain-v1.mdx b/src/oss/javascript/releases/langchain-v1.mdx index 8ff8ca728c..7adb26d2f5 100644 --- a/src/oss/javascript/releases/langchain-v1.mdx +++ b/src/oss/javascript/releases/langchain-v1.mdx @@ -1,6 +1,6 @@ --- title: What's new in v1 -sidebarTitle: v1 +sidebarTitle: V1 Release Notes --- **LangChain v1 is a focused, production-ready foundation for building agents.** We've streamlined the framework around three core improvements: diff --git a/src/oss/langchain/middleware/custom.mdx b/src/oss/langchain/middleware/custom.mdx index 67fd85628d..fd2eeab2dd 100644 --- a/src/oss/langchain/middleware/custom.mdx +++ b/src/oss/langchain/middleware/custom.mdx @@ -921,6 +921,14 @@ const agent = createAgent({ ### Working with system messages +:::python + +You can modify system prompts in middleware using either `system_prompt` (`string`) or `system_message` (@[`SystemMessage`]). The @[`ModelRequest`] provides both for maximum flexibility. + +::: + +:::js + You can modify system prompts in middleware using either `systemPrompt` (`string`) or `systemMessage` (@[`SystemMessage`]). The @[`ModelRequest`] provides both for maximum flexibility. **Key behavior:** @@ -930,6 +938,8 @@ You can modify system prompts in middleware using either `systemPrompt` (`string - Using `systemMessage` (JavaScript) or manually combining content blocks (Python) preserves existing cache control and structured content blocks - Multiple middleware can chain modifications sequentially across different middleware calls +::: + :::python ```python diff --git a/src/oss/python/releases/changelog.mdx b/src/oss/python/releases/changelog.mdx new file mode 100644 index 0000000000..a9b4223695 --- /dev/null +++ b/src/oss/python/releases/changelog.mdx @@ -0,0 +1,24 @@ +--- +title: Changelog +sidebarTitle: Changelog +--- + +A chronological log of updates and improvements to LangChain Python. + +## v1.1 (11/25/2025) + +**LangChain v1.1 focuses on improving agent reliability and flexibility.** This release introduces model profiles for better model capability awareness, new middleware capabilities for retrying model calls and content moderation, and support for more flexible system prompts. + +* [Model profiles](/oss/langchain/models#model-profiles): Chat models now expose supported features and capabilities through a `.profile` attribute. These data are derived from [models.dev](https://github.com/sst/models.dev), an open source project providing model capability data. +* [Summarization middleware](/oss/langchain/middleware/built-in#summarization): Updated to support flexible trigger points using model profiles for context-aware summarization. +* [Structured output](/oss/langchain/structured-output): `ProviderStrategy` support (native structured output) can now be inferred from model profiles. +* [custom `SystemMessage`s for `create_agent`](/oss/langchain/middleware/custom#working-with-system-messages): Support for passing `SystemMessage` instances directly to `system_prompt` parameter, enabling advanced features like cache control and structured content blocks. +* [Model retry middleware](/oss/langchain/middleware/built-in#model-retry): New middleware for automatically retrying failed model calls with configurable exponential backoff. +* [Content moderation middleware](/oss/langchain/middleware/built-in#content-moderation): OpenAI content moderation middleware for detecting and handling unsafe content in agent interactions. Supports checking user input, AI output, and tool results. + +## Resources + +- [V1 Migration guide](/oss/migrate/langchain-v1) - How to migrate to LangChain v1 +- [Release policy](/oss/python/release-policy) - Detailed release policies +- [Versioning](/oss/python/versioning) - Understanding version numbers +- [Report issues on GitHub](https://github.com/langchain-ai/langchain/issues) diff --git a/src/oss/python/releases/langchain-v1-1.mdx b/src/oss/python/releases/langchain-v1-1.mdx deleted file mode 100644 index 350a09a817..0000000000 --- a/src/oss/python/releases/langchain-v1-1.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -title: What's new in v1.1 -sidebarTitle: Release notes ---- - -**LangChain v1.1 focuses on improving agent reliability and flexibility.** This release introduces model profiles, new middleware capabilities, and enhanced type safety for custom middleware implementations. - -To upgrade, - - -```bash pip -pip install -U langchain -``` -```bash uv -uv add langchain -``` - - -## Model profiles - -Chat models now expose supported features and capabilities through a `.profile` attribute. These data are derived from the [models.dev](https://github.com/sst/models.dev) project, an open source initiative that provides model capability data, and are augmented with additional fields for purposes of use with LangChain. - -See details in the [models](/oss/langchain/models#model-profiles) guide. - -### Summarization middleware - -The Summarization middleware interface has been updated to support more flexible specification of trigger points for summarization, as well as what context is summarized. These values can vary with model-specific context windows using the model's [profile](/oss/langchain/models#model-profiles). - -See details in the [built-in middleware](/oss/langchain/middleware/built-in#summarization) guide. - -### Structured output for agents - -Support for [ProviderStrategy](/oss/langchain/structured-output#provider-strategy) can now be inferred from a model's [profile](/oss/langchain/models#model-profiles). - -See details in the [structured output](/oss/langchain/structured-output) guide. - -## Model retry middleware - -## Misc - -### New middleware docs - -### Type safety improvements for custom middlewares - -## Reporting issues - -Please report any issues discovered with v1.1 on [GitHub](https://github.com/langchain-ai/langchain/issues) using the [`'v1.1'` label](https://github.com/langchain-ai/langchain/issues?q=state%3Aopen%20label%3Av1.1). - -## Additional resources - - - - Learn about building agents with LangChain - - - Deep dive into middleware concepts - - - Working with tools in agents - - - How to migrate to LangChain v1 - - - Report issues or contribute - - - -## See also - -- [Versioning](/oss/python/versioning) - Understanding version numbers -- [Release policy](/oss/python/release-policy) - Detailed release policies diff --git a/src/oss/python/releases/langchain-v1.mdx b/src/oss/python/releases/langchain-v1.mdx index 99ccc6e2d5..904b792976 100644 --- a/src/oss/python/releases/langchain-v1.mdx +++ b/src/oss/python/releases/langchain-v1.mdx @@ -1,6 +1,6 @@ --- title: What's new in v1 -sidebarTitle: v1 +sidebarTitle: V1 Release Notes --- **LangChain v1 is a focused, production-ready foundation for building agents.** We've streamlined the framework around three core improvements: From 66f80255b7d6e7ba6605d13df55df6af9cc85bef Mon Sep 17 00:00:00 2001 From: Sydney Runkle Date: Sat, 22 Nov 2025 06:26:22 -0500 Subject: [PATCH 06/21] system message stuff --- src/oss/javascript/releases/changelog.mdx | 11 +- src/oss/langchain/middleware/custom.mdx | 151 ++++++++++++++++++++-- src/oss/python/releases/changelog.mdx | 7 +- 3 files changed, 146 insertions(+), 23 deletions(-) diff --git a/src/oss/javascript/releases/changelog.mdx b/src/oss/javascript/releases/changelog.mdx index 1082c60136..597347f7c8 100644 --- a/src/oss/javascript/releases/changelog.mdx +++ b/src/oss/javascript/releases/changelog.mdx @@ -7,17 +7,18 @@ A chronological log of updates and improvements to LangChain JavaScript. ## v1.1 (11/25/2025) -**LangChain v1.1 focuses on improving agent reliability and flexibility.** This release introduces model profiles for better model capability awareness, new middleware capabilities for retrying model calls and content moderation, improved system message handling, and enhanced compatibility with Zod v4. - * [Model profiles](/oss/langchain/models#model-profiles): Chat models now expose supported features and capabilities through a `.profile` getter. These data are derived from [models.dev](https://github.com/sst/models.dev), an open source project providing model capability data. -* [System message improvements](/oss/langchain/middleware/custom#working-with-system-messages): Support for passing `SystemMessage` instances directly to `systemPrompt` parameter and new `concat` method for extending system messages. Enables advanced features like cache control and structured content blocks. +* [Summarization middleware](/oss/langchain/middleware/built-in#summarization): Updated to support flexible trigger points using model profiles for context-aware summarization. +* [Structured output](/oss/langchain/structured-output): `ProviderStrategy` support (native structured output) can now be inferred from model profiles. +* [custom `SystemMessage`s](/oss/langchain/middleware/custom#working-with-system-messages): Support for passing `SystemMessage` instances directly to `systemPrompt` parameter and a new `concat` method for extending system messages. Enables advanced features like cache control and structured content blocks. * [Model retry middleware](/oss/langchain/middleware/built-in#model-retry): New middleware for automatically retrying failed model calls with configurable exponential backoff, improving agent reliability. -* [Content moderation middleware](/oss/langchain/middleware/built-in#content-moderation): OpenAI content moderation middleware for detecting and handling unsafe content in agent interactions. Supports checking user input, AI output, and tool results. -* [Compatibility improvements](/oss/javascript/releases/langchain-v1#compatibility-improvements): LangChain.js now supports Zod v4 with backward compatibility, enabling use of the latest Zod features for structured output and tool schemas. +* [Content moderation middleware](/oss/langchain/middleware/built-in#content-moderation): OpenAI content moderation middleware for detecting and handling unsafe content in agent interactions. Supports checking user input, model output, and tool results. +* Compatibility improvements: LangChain.js now supports Zod v4 with backward compatibility, enabling use of the latest Zod features for structured output and tool schemas. ### Resources - [Migration guide](/oss/migrate/langchain-v1) - How to migrate to LangChain v1 +- [V1 Release notes](/oss/javascript/releases/langchain-v1) - Detailed release notes - [Release policy](/oss/javascript/release-policy) - Detailed release policies - [Versioning](/oss/javascript/versioning) - Understanding version numbers - [Report issues on GitHub](https://github.com/langchain-ai/langchainjs/issues) diff --git a/src/oss/langchain/middleware/custom.mdx b/src/oss/langchain/middleware/custom.mdx index fd2eeab2dd..bb48cdc3dd 100644 --- a/src/oss/langchain/middleware/custom.mdx +++ b/src/oss/langchain/middleware/custom.mdx @@ -923,34 +923,157 @@ const agent = createAgent({ :::python -You can modify system prompts in middleware using either `system_prompt` (`string`) or `system_message` (@[`SystemMessage`]). The @[`ModelRequest`] provides both for maximum flexibility. +Modify system messages in middleware using the `system_message` field on `ModelRequest`. The `system_message` field contains a @[`SystemMessage`] object (even if the agent was created with a string `system_prompt`). -::: +**Example: Adding context to system message** -:::js + + -You can modify system prompts in middleware using either `systemPrompt` (`string`) or `systemMessage` (@[`SystemMessage`]). The @[`ModelRequest`] provides both for maximum flexibility. +```python +from langchain.agents.middleware import wrap_model_call, ModelRequest, ModelResponse +from langchain.messages import SystemMessage +from typing import Callable -**Key behavior:** -- Middleware receives both `systemPrompt` (string) and `systemMessage` (@[`SystemMessage`]) in the request -- You can modify either `systemPrompt` or `systemMessage`, but **cannot set both in the same middleware call** - this prevents conflicts -- Using `systemPrompt` creates a new simple system message (may overwrite cache control metadata) -- Using `systemMessage` (JavaScript) or manually combining content blocks (Python) preserves existing cache control and structured content blocks -- Multiple middleware can chain modifications sequentially across different middleware calls -::: +@wrap_model_call +def add_context( + request: ModelRequest, + handler: Callable[[ModelRequest], ModelResponse], +) -> ModelResponse: + # When content is a simple string + if isinstance(request.system_message.content, str): + new_system_message = SystemMessage( + content=f"{request.system_message.content}\n\nAdditional context." + ) + return handler(request.override(system_message=new_system_message)) + + # When content is a list of blocks, append a new text block + new_content = list(request.system_message.content) + [ + {"type": "text", "text": "Additional context."} + ] + new_system_message = SystemMessage(content=new_content) + return handler(request.override(system_message=new_system_message)) +``` -:::python + + + ```python +from langchain.agents.middleware import AgentMiddleware, ModelRequest, ModelResponse +from langchain.messages import SystemMessage +from typing import Callable + + +class ContextMiddleware(AgentMiddleware): + def wrap_model_call( + self, + request: ModelRequest, + handler: Callable[[ModelRequest], ModelResponse], + ) -> ModelResponse: + # When content is a simple string + if isinstance(request.system_message.content, str): + new_system_message = SystemMessage( + content=f"{request.system_message.content}\n\nAdditional context." + ) + return handler(request.override(system_message=new_system_message)) + + # When content is a list of blocks, append a new text block + new_content = list(request.system_message.content) + [ + {"type": "text", "text": "Additional context."} + ] + new_system_message = SystemMessage(content=new_content) + return handler(request.override(system_message=new_system_message)) +``` + + + + +**Example: Working with cache control (Anthropic)** + +When working with Anthropic models, you can use structured content blocks with cache control directives to cache large system prompts: + + + + +```python +from langchain.agents.middleware import wrap_model_call, ModelRequest, ModelResponse +from langchain.messages import SystemMessage +from typing import Callable + + @wrap_model_call -def add_context_preserve_cache( +def add_cached_context( request: ModelRequest, handler: Callable[[ModelRequest], ModelResponse], ) -> ModelResponse: - new_system_message = SystemMessage(content="Additional context.") + # Build new content with cache control + # When content is a string, convert to list of blocks first + if isinstance(request.system_message.content, str): + base_content = [{"type": "text", "text": request.system_message.content}] + else: + base_content = list(request.system_message.content) + + # Add new content block with cache control + new_content = base_content + [ + { + "type": "text", + "text": "Here is a large document to analyze:\n\n...", + # content up until this point is cached + "cache_control": {"type": "ephemeral"} + } + ] + + new_system_message = SystemMessage(content=new_content) return handler(request.override(system_message=new_system_message)) ``` + + + + + +```python +from langchain.agents.middleware import AgentMiddleware, ModelRequest, ModelResponse +from langchain.messages import SystemMessage +from typing import Callable + + +class CachedContextMiddleware(AgentMiddleware): + def wrap_model_call( + self, + request: ModelRequest, + handler: Callable[[ModelRequest], ModelResponse], + ) -> ModelResponse: + # Build new content with cache control + # When content is a string, convert to list of blocks first + if isinstance(request.system_message.content, str): + base_content = [{"type": "text", "text": request.system_message.content}] + else: + base_content = list(request.system_message.content) + + # Add new content block with cache control + new_content = base_content + [ + { + "type": "text", + "text": "Here is a large document to analyze:\n\n...", + "cache_control": {"type": "ephemeral"} # This content will be cached + } + ] + + new_system_message = SystemMessage(content=new_content) + return handler(request.override(system_message=new_system_message)) +``` + + + + +**Notes:** +- `ModelRequest.system_message` is always a @[`SystemMessage`] object, even if the agent was created with `system_prompt="string"` +- `SystemMessage.content` can be either a `str` or a list of content blocks (e.g., `[{"type": "text", "text": "...", "cache_control": {...}}]`) +- When modifying system messages with structured content blocks, convert to a list first and append new blocks to preserve existing structure +- You can pass @[`SystemMessage`] objects directly to `create_agent`'s `system_prompt` parameter for advanced use cases like cache control + ::: :::js diff --git a/src/oss/python/releases/changelog.mdx b/src/oss/python/releases/changelog.mdx index a9b4223695..23bafbad97 100644 --- a/src/oss/python/releases/changelog.mdx +++ b/src/oss/python/releases/changelog.mdx @@ -7,18 +7,17 @@ A chronological log of updates and improvements to LangChain Python. ## v1.1 (11/25/2025) -**LangChain v1.1 focuses on improving agent reliability and flexibility.** This release introduces model profiles for better model capability awareness, new middleware capabilities for retrying model calls and content moderation, and support for more flexible system prompts. - * [Model profiles](/oss/langchain/models#model-profiles): Chat models now expose supported features and capabilities through a `.profile` attribute. These data are derived from [models.dev](https://github.com/sst/models.dev), an open source project providing model capability data. * [Summarization middleware](/oss/langchain/middleware/built-in#summarization): Updated to support flexible trigger points using model profiles for context-aware summarization. * [Structured output](/oss/langchain/structured-output): `ProviderStrategy` support (native structured output) can now be inferred from model profiles. -* [custom `SystemMessage`s for `create_agent`](/oss/langchain/middleware/custom#working-with-system-messages): Support for passing `SystemMessage` instances directly to `system_prompt` parameter, enabling advanced features like cache control and structured content blocks. +* [custom `SystemMessage`s](/oss/langchain/middleware/custom#working-with-system-messages): Support for passing `SystemMessage` instances directly to `system_prompt` parameter, enabling advanced features like cache control and structured content blocks. * [Model retry middleware](/oss/langchain/middleware/built-in#model-retry): New middleware for automatically retrying failed model calls with configurable exponential backoff. -* [Content moderation middleware](/oss/langchain/middleware/built-in#content-moderation): OpenAI content moderation middleware for detecting and handling unsafe content in agent interactions. Supports checking user input, AI output, and tool results. +* [Content moderation middleware](/oss/langchain/middleware/built-in#content-moderation): OpenAI content moderation middleware for detecting and handling unsafe content in agent interactions. Supports checking user input, model output, and tool results. ## Resources - [V1 Migration guide](/oss/migrate/langchain-v1) - How to migrate to LangChain v1 +- [V1 Release notes](/oss/python/releases/langchain-v1) - Detailed release notes - [Release policy](/oss/python/release-policy) - Detailed release policies - [Versioning](/oss/python/versioning) - Understanding version numbers - [Report issues on GitHub](https://github.com/langchain-ai/langchain/issues) From 3b50c0160c17acc25f1aa2ada46eb5200182b910 Mon Sep 17 00:00:00 2001 From: Sydney Runkle Date: Sat, 22 Nov 2025 06:42:24 -0500 Subject: [PATCH 07/21] boom --- pipeline/preprocessors/link_map.py | 52 +++++++++++++++++++++++ src/oss/javascript/releases/changelog.mdx | 2 +- src/oss/python/releases/changelog.mdx | 2 +- 3 files changed, 54 insertions(+), 2 deletions(-) diff --git a/pipeline/preprocessors/link_map.py b/pipeline/preprocessors/link_map.py index 07540ae2dd..3cddb56ed9 100644 --- a/pipeline/preprocessors/link_map.py +++ b/pipeline/preprocessors/link_map.py @@ -29,6 +29,7 @@ class LinkMap(TypedDict): "langchain.chat_models": "langchain/models", "langchain.embeddings": "langchain/embeddings", "langchain_core": "langchain_core/", + "langchain-core": "langchain_core/", # Agents "create_agent": "langchain/agents/#langchain.agents.create_agent", "create_agent(tools)": "langchain/agents/#langchain.agents.create_agent(tools)", @@ -61,6 +62,15 @@ class LinkMap(TypedDict): "ClearToolUsesEdit": "langchain/middleware/#langchain.agents.middleware.ClearToolUsesEdit", "ContextEdit": "langchain/middleware/#langchain.agents.middleware.ContextEdit", "InterruptOnConfig": "langchain/middleware/#langchain.agents.middleware.InterruptOnConfig", + "ShellToolMiddleware": "langchain/middleware/#langchain.agents.middleware.ShellToolMiddleware", + "FilesystemFileSearchMiddleware": "langchain/middleware/#langchain.agents.middleware.FilesystemFileSearchMiddleware", + "ClaudeBashToolMiddleware": "langchain/middleware/#langchain.agents.middleware.ClaudeBashToolMiddleware", + "StateClaudeTextEditorMiddleware": "langchain/middleware/#langchain.agents.middleware.StateClaudeTextEditorMiddleware", + "FilesystemClaudeTextEditorMiddleware": "langchain/middleware/#langchain.agents.middleware.FilesystemClaudeTextEditorMiddleware", + "StateClaudeMemoryMiddleware": "langchain/middleware/#langchain.agents.middleware.StateClaudeMemoryMiddleware", + "FilesystemClaudeMemoryMiddleware": "langchain/middleware/#langchain.agents.middleware.FilesystemClaudeMemoryMiddleware", + "StateFileSearchMiddleware": "langchain/middleware/#langchain.agents.middleware.StateFileSearchMiddleware", + "OpenAIModerationMiddleware": "langchain/middleware/#langchain.agents.middleware.OpenAIModerationMiddleware", # Messages "AIMessage": "langchain/messages/#langchain.messages.AIMessage", "AIMessageChunk": "langchain/messages/#langchain.messages.AIMessageChunk", @@ -75,6 +85,7 @@ class LinkMap(TypedDict): "BaseMessage": "langchain_core/language_models/#langchain_core.messages.BaseMessage", "BaseMessage(content)": "langchain_core/language_models/#langchain_core.messages.BaseMessage.content", "BaseMessage(content_blocks)": "langchain_core/language_models/#langchain_core.messages.BaseMessage.content_blocks", + "content_blocks": "langchain_core/language_models/#langchain_core.messages.BaseMessage.content_blocks", "ContentBlock": "langchain/messages/#langchain.messages.ContentBlock", "TextContentBlock": "langchain/messages/#langchain.messages.TextContentBlock", "ReasoningContentBlock": "langchain/messages/#langchain.messages.ReasoningContentBlock", @@ -143,6 +154,7 @@ class LinkMap(TypedDict): # Tools "@tool": "langchain/tools/#langchain.tools.tool", "BaseTool": "langchain/tools/#langchain.tools.BaseTool", + "ToolRuntime": "langchain/tools/#langchain.tools.ToolRuntime", # Embeddings "init_embeddings": "langchain_core/embeddings/#langchain_core.embeddings.embeddings.Embeddings", "Embeddings": "langchain_core/embeddings/#langchain_core.embeddings.embeddings.Embeddings", @@ -150,11 +162,19 @@ class LinkMap(TypedDict): "Document": "langchain_core/documents/#langchain_core.documents.base.Document", # Document loaders "BaseLoader": "langchain_core/document_loaders/#langchain_core.document_loaders.BaseLoader", + # Text splitters + "CharacterTextSplitter": "langchain/text_splitters/#langchain.text_splitter.CharacterTextSplitter", + "RecursiveCharacterTextSplitter": "langchain/text_splitters/#langchain.text_splitter.RecursiveCharacterTextSplitter", + "TokenTextSplitter": "langchain/text_splitters/#langchain.text_splitter.TokenTextSplitter", # Runnables + "Runnable": "langchain_core/runnables/#langchain_core.runnables.Runnable", "RunnableConfig": "langchain_core/runnables/#langchain_core.runnables.RunnableConfig", "RunnableConfig(max_concurrency)": "langchain_core/runnables/#langchain_core.runnables.RunnableConfig.max_concurrency", # VectorStores "VectorStore": "langchain_core/vectorstores/?h=#langchain_core.vectorstores.base.VectorStore", + "VectorStore.max_marginal_relevance_search": "langchain_core/vectorstores/?h=#langchain_core.vectorstores.base.VectorStore.max_marginal_relevance_search", + # Retrievers + "Retrievers": "langchain_core/retrievers/#langchain_core.retrievers.BaseRetriever", # Key-value stores "BaseStore": "langgraph/store/#langgraph.store.base.BaseStore", "BaseStore.put": "langgraph/store/#langgraph.store.base.BaseStore.put", @@ -209,6 +229,7 @@ class LinkMap(TypedDict): "Pregel.astream": "langgraph/pregel/#langgraph.pregel.Pregel.astream", "Pregel.stream": "langgraph/pregel/#langgraph.pregel.Pregel.stream", "Runtime": "langgraph/runtime/#langgraph.runtime.Runtime", + "langgraph.runtime.Runtime": "langgraph/runtime/#langgraph.runtime.Runtime", "Send": "langgraph/types/#langgraph.types.Send", "Topic": "langgraph/channels/#langgraph.channels.Topic", # LangSmith Deployment SDK @@ -295,6 +316,7 @@ class LinkMap(TypedDict): "RunCreate": "langsmith/deployment/sdk/#langgraph_sdk.schema.RunCreate", "RunCreateMetadata": "langsmith/deployment/sdk/#langgraph_sdk.schema.RunCreateMetadata", # Functional API + "task": "langgraph/func/#langgraph.func.task", "@task": "langgraph/func/#langgraph.func.task", "@entrypoint": "langgraph/func/#langgraph.func.entrypoint", "entrypoint.final": "langgraph/func/#langgraph.func.entrypoint.final", @@ -307,23 +329,44 @@ class LinkMap(TypedDict): # @langchain/core references "AIMessage": "classes/_langchain_core.messages.AIMessage.html", "AIMessageChunk": "classes/_langchain_core.messages.AIMessageChunk.html", + "BaseMessage": "classes/_langchain_core.messages.BaseMessage.html", + "BaseMessage(content)": "classes/_langchain_core.messages.BaseMessage.html#content", + "HumanMessage": "classes/_langchain_core.messages.HumanMessage.html", + "ToolMessage": "classes/_langchain_core.messages.ToolMessage.html", "SystemMessage": "classes/_langchain_core.messages.SystemMessage.html", "SystemMessage.concat": "classes/_langchain_core.messages.SystemMessage.html#concat", "ModelRequest": "classes/_langchain_core.messages.ModelRequest.html", + "ToolCallChunk": "types/_langchain_core.messages.ToolCallChunk.html", + "ContentBlock": "types/_langchain_core.messages.ContentBlock.html", + "langchain.messages": "modules/_langchain_core.messages.html", + "BaseChatModel": "classes/_langchain_core.language_models_chat_models.BaseChatModel.html", "BaseChatModel.invoke": "classes/_langchain_core.language_models_chat_models.BaseChatModel.html#invoke", "BaseChatModel.stream": "classes/_langchain_core.language_models_chat_models.BaseChatModel.html#stream", "BaseChatModel.streamEvents": "classes/_langchain_core.language_models_chat_models.BaseChatModel.html#streamEvents", "BaseChatModel.batch": "classes/_langchain_core.language_models_chat_models.BaseChatModel.html#batch", "BaseChatModel.bindTools": "classes/_langchain_core.language_models_chat_models.BaseChatModel.html#bindTools", + "BaseChatModel.with_structured_output": "classes/_langchain_core.language_models_chat_models.BaseChatModel.html#withStructuredOutput", "Document": "classes/_langchain_core.documents.Document.html", "Embeddings": "classes/_langchain_core.embeddings.Embeddings.html", "initChatModel": "functions/langchain.chat_models_universal.initChatModel.html", + "Runnable": "classes/_langchain_core.runnables.Runnable.html", "RunnableConfig": "interfaces/_langchain_core.runnables.RunnableConfig.html", "tool": "functions/_langchain_core.tools.tool.html", + "BaseTool": "classes/_langchain_core.tools.StructuredTool.html", "UsageMetadata": "types/_langchain_core.messages.UsageMetadata.html", "BaseLoader": "classes/_langchain_core.document_loaders_base.BaseDocumentLoader.html", "getContextVariable": "functions/_langchain_core.context.getContextVariable.html", "astream_events": "classes/_langchain_core.runnables.Runnable.html#streamEvents", + "on_llm_new_token": "classes/_langchain_core.callbacks_base.BaseCallbackHandler.html#handleLLMNewToken", + # LangChain integrations + "ChatOpenAI": "classes/_langchain_openai.ChatOpenAI.html", + "AzureChatOpenAI": "classes/_langchain_openai.AzureChatOpenAI.html", + "VectorStore": "classes/_langchain_core.vectorstores.VectorStore.html", + "VectorStore.max_marginal_relevance_search": "classes/_langchain_core.vectorstores.VectorStore.html#maxMarginalRelevanceSearch", + "Retrievers": "classes/_langchain_core.retrievers.BaseRetriever.html", + # Text splitters + "RecursiveCharacterTextSplitter": "classes/_langchain_textsplitters.RecursiveCharacterTextSplitter.html", + "TokenTextSplitter": "classes/_langchain_textsplitters.TokenTextSplitter.html", # LangGraph SDK references "Auth": "classes/_langchain_langgraph-sdk.auth.Auth.html", "client.runs.stream": "classes/_langchain_langgraph-sdk.client.RunsClient.html#stream", @@ -334,17 +377,24 @@ class LinkMap(TypedDict): "BaseCheckpointSaver": "classes/_langchain_langgraph-checkpoint.BaseCheckpointSaver.html", "BaseStore": "classes/_langchain_langgraph-checkpoint.BaseStore.html", "BaseStore.put": "classes/_langchain_langgraph-checkpoint.BaseStore.html#put", + "InMemorySaver": "classes/_langchain_langgraph-checkpoint.MemorySaver.html", "MemorySaver": "classes/_langchain_langgraph-checkpoint.MemorySaver.html", + "AsyncPostgresSaver": "classes/_langchain_langgraph-checkpoint-postgres.AsyncPostgresSaver.html", "PostgresSaver": "classes/_langchain_langgraph-checkpoint-postgres.index.PostgresSaver.html", "protocol": "interfaces/_langchain_langgraph-checkpoint.SerializerProtocol.html", "SerializerProtocol": "interfaces/_langchain_langgraph-checkpoint.SerializerProtocol.html", "SqliteSaver": "classes/_langchain_langgraph-checkpoint-sqlite.SqliteSaver.html", # LangGraph core references "StateGraph": "classes/_langchain_langgraph.index.StateGraph.html", + "StateGraph.compile": "classes/_langchain_langgraph.index.StateGraph.html#compile", "add_conditional_edges": "classes/_langchain_langgraph.index.StateGraph.html#addConditionalEdges", + "addConditionalEdges": "classes/_langchain_langgraph.index.StateGraph.html#addConditionalEdges", "add_edge": "classes/_langchain_langgraph.index.StateGraph.html#addEdge", + "addEdge": "classes/_langchain_langgraph.index.StateGraph.html#addEdge", "add_node": "classes/_langchain_langgraph.index.StateGraph.html#addNode", "add_messages": "functions/_langchain_langgraph.index.messagesStateReducer.html", + "LastValue": "classes/_langchain_langgraph.channels.LastValue.html", + "Topic": "classes/_langchain_langgraph.channels.Topic.html", "BinaryOperatorAggregate": "classes/_langchain_langgraph.index.BinaryOperatorAggregate.html", "Command": "classes/_langchain_langgraph.index.Command.html", "CompiledStateGraph": "classes/_langchain_langgraph.index.CompiledStateGraph.html", @@ -353,6 +403,7 @@ class LinkMap(TypedDict): "entrypoint": "functions/_langchain_langgraph.index.entrypoint.html", "entrypoint.final": "functions/_langchain_langgraph.index.entrypoint.html#final", "get_state_history": "classes/_langchain_langgraph.pregel.Pregel.html#getStateHistory", + "getStateHistory": "classes/_langchain_langgraph.pregel.Pregel.html#getStateHistory", "HumanInterrupt": "interfaces/_langchain_langgraph.prebuilt.HumanInterrupt.html", "interrupt": "functions/_langchain_langgraph.index.interrupt.html", "CompiledStateGraph.invoke": "classes/_langchain_langgraph.index.CompiledStateGraph.html#invoke", @@ -365,6 +416,7 @@ class LinkMap(TypedDict): "CompiledStateGraph.stream": "classes/_langchain_langgraph.index.CompiledStateGraph.html#stream", "task": "functions/_langchain_langgraph.index.task.html", "update_state": "classes/_langchain_langgraph.pregel.Pregel.html#updateState", + "updateState": "classes/_langchain_langgraph.pregel.Pregel.html#updateState", "Runtime": "interfaces/_langchain_langgraph.index.Runtime.html", "ToolNode": "classes/_langchain_langgraph.prebuilt.ToolNode.html", # LangSmith Deployment SDK - JS diff --git a/src/oss/javascript/releases/changelog.mdx b/src/oss/javascript/releases/changelog.mdx index 597347f7c8..13a62cba8d 100644 --- a/src/oss/javascript/releases/changelog.mdx +++ b/src/oss/javascript/releases/changelog.mdx @@ -10,7 +10,7 @@ A chronological log of updates and improvements to LangChain JavaScript. * [Model profiles](/oss/langchain/models#model-profiles): Chat models now expose supported features and capabilities through a `.profile` getter. These data are derived from [models.dev](https://github.com/sst/models.dev), an open source project providing model capability data. * [Summarization middleware](/oss/langchain/middleware/built-in#summarization): Updated to support flexible trigger points using model profiles for context-aware summarization. * [Structured output](/oss/langchain/structured-output): `ProviderStrategy` support (native structured output) can now be inferred from model profiles. -* [custom `SystemMessage`s](/oss/langchain/middleware/custom#working-with-system-messages): Support for passing `SystemMessage` instances directly to `systemPrompt` parameter and a new `concat` method for extending system messages. Enables advanced features like cache control and structured content blocks. +* [`SystemMessage` for `createAgent`](/oss/langchain/middleware/custom#working-with-system-messages): Support for passing `SystemMessage` instances directly to `createAgent`'s `systemPrompt` parameter and a new `concat` method for extending system messages. Enables advanced features like cache control and structured content blocks. * [Model retry middleware](/oss/langchain/middleware/built-in#model-retry): New middleware for automatically retrying failed model calls with configurable exponential backoff, improving agent reliability. * [Content moderation middleware](/oss/langchain/middleware/built-in#content-moderation): OpenAI content moderation middleware for detecting and handling unsafe content in agent interactions. Supports checking user input, model output, and tool results. * Compatibility improvements: LangChain.js now supports Zod v4 with backward compatibility, enabling use of the latest Zod features for structured output and tool schemas. diff --git a/src/oss/python/releases/changelog.mdx b/src/oss/python/releases/changelog.mdx index 23bafbad97..c3e2632f61 100644 --- a/src/oss/python/releases/changelog.mdx +++ b/src/oss/python/releases/changelog.mdx @@ -10,7 +10,7 @@ A chronological log of updates and improvements to LangChain Python. * [Model profiles](/oss/langchain/models#model-profiles): Chat models now expose supported features and capabilities through a `.profile` attribute. These data are derived from [models.dev](https://github.com/sst/models.dev), an open source project providing model capability data. * [Summarization middleware](/oss/langchain/middleware/built-in#summarization): Updated to support flexible trigger points using model profiles for context-aware summarization. * [Structured output](/oss/langchain/structured-output): `ProviderStrategy` support (native structured output) can now be inferred from model profiles. -* [custom `SystemMessage`s](/oss/langchain/middleware/custom#working-with-system-messages): Support for passing `SystemMessage` instances directly to `system_prompt` parameter, enabling advanced features like cache control and structured content blocks. +* [`SystemMessage` for `create_agent`](/oss/langchain/middleware/custom#working-with-system-messages): Support for passing `SystemMessage` instances directly to `create_agent`'s `system_prompt` parameter, enabling advanced features like cache control and structured content blocks. * [Model retry middleware](/oss/langchain/middleware/built-in#model-retry): New middleware for automatically retrying failed model calls with configurable exponential backoff. * [Content moderation middleware](/oss/langchain/middleware/built-in#content-moderation): OpenAI content moderation middleware for detecting and handling unsafe content in agent interactions. Supports checking user input, model output, and tool results. From ccc9ab63e2a650cf111be0deecf8b2280d46e6fa Mon Sep 17 00:00:00 2001 From: Sydney Runkle Date: Sat, 22 Nov 2025 06:46:54 -0500 Subject: [PATCH 08/21] content blocks, oh my --- src/oss/langchain/middleware/custom.mdx | 48 ++++++------------------- 1 file changed, 10 insertions(+), 38 deletions(-) diff --git a/src/oss/langchain/middleware/custom.mdx b/src/oss/langchain/middleware/custom.mdx index bb48cdc3dd..e571485ccd 100644 --- a/src/oss/langchain/middleware/custom.mdx +++ b/src/oss/langchain/middleware/custom.mdx @@ -941,15 +941,8 @@ def add_context( request: ModelRequest, handler: Callable[[ModelRequest], ModelResponse], ) -> ModelResponse: - # When content is a simple string - if isinstance(request.system_message.content, str): - new_system_message = SystemMessage( - content=f"{request.system_message.content}\n\nAdditional context." - ) - return handler(request.override(system_message=new_system_message)) - - # When content is a list of blocks, append a new text block - new_content = list(request.system_message.content) + [ + # Always work with content blocks + new_content = list(request.system_message.content_blocks) + [ {"type": "text", "text": "Additional context."} ] new_system_message = SystemMessage(content=new_content) @@ -972,15 +965,8 @@ class ContextMiddleware(AgentMiddleware): request: ModelRequest, handler: Callable[[ModelRequest], ModelResponse], ) -> ModelResponse: - # When content is a simple string - if isinstance(request.system_message.content, str): - new_system_message = SystemMessage( - content=f"{request.system_message.content}\n\nAdditional context." - ) - return handler(request.override(system_message=new_system_message)) - - # When content is a list of blocks, append a new text block - new_content = list(request.system_message.content) + [ + # Always work with content blocks + new_content = list(request.system_message.content_blocks) + [ {"type": "text", "text": "Additional context."} ] new_system_message = SystemMessage(content=new_content) @@ -1008,15 +994,8 @@ def add_cached_context( request: ModelRequest, handler: Callable[[ModelRequest], ModelResponse], ) -> ModelResponse: - # Build new content with cache control - # When content is a string, convert to list of blocks first - if isinstance(request.system_message.content, str): - base_content = [{"type": "text", "text": request.system_message.content}] - else: - base_content = list(request.system_message.content) - - # Add new content block with cache control - new_content = base_content + [ + # Always work with content blocks + new_content = list(request.system_message.content_blocks) + [ { "type": "text", "text": "Here is a large document to analyze:\n\n...", @@ -1045,15 +1024,8 @@ class CachedContextMiddleware(AgentMiddleware): request: ModelRequest, handler: Callable[[ModelRequest], ModelResponse], ) -> ModelResponse: - # Build new content with cache control - # When content is a string, convert to list of blocks first - if isinstance(request.system_message.content, str): - base_content = [{"type": "text", "text": request.system_message.content}] - else: - base_content = list(request.system_message.content) - - # Add new content block with cache control - new_content = base_content + [ + # Always work with content blocks + new_content = list(request.system_message.content_blocks) + [ { "type": "text", "text": "Here is a large document to analyze:\n\n...", @@ -1070,8 +1042,8 @@ class CachedContextMiddleware(AgentMiddleware): **Notes:** - `ModelRequest.system_message` is always a @[`SystemMessage`] object, even if the agent was created with `system_prompt="string"` -- `SystemMessage.content` can be either a `str` or a list of content blocks (e.g., `[{"type": "text", "text": "...", "cache_control": {...}}]`) -- When modifying system messages with structured content blocks, convert to a list first and append new blocks to preserve existing structure +- Use `SystemMessage.content_blocks` to access content as a list of blocks, regardless of whether the original content was a string or list +- When modifying system messages, use `content_blocks` and append new blocks to preserve existing structure - You can pass @[`SystemMessage`] objects directly to `create_agent`'s `system_prompt` parameter for advanced use cases like cache control ::: From b87c1761fba702a6416bde3e739408c33b0302b2 Mon Sep 17 00:00:00 2001 From: Sydney Runkle Date: Sat, 22 Nov 2025 07:17:00 -0500 Subject: [PATCH 09/21] removing dupes --- pipeline/preprocessors/link_map.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pipeline/preprocessors/link_map.py b/pipeline/preprocessors/link_map.py index a4aff85b1c..d70c9bb480 100644 --- a/pipeline/preprocessors/link_map.py +++ b/pipeline/preprocessors/link_map.py @@ -229,7 +229,6 @@ class LinkMap(TypedDict): "Pregel.astream": "langgraph/pregel/#langgraph.pregel.Pregel.astream", "Pregel.stream": "langgraph/pregel/#langgraph.pregel.Pregel.stream", "Runtime": "langgraph/runtime/#langgraph.runtime.Runtime", - "langgraph.runtime.Runtime": "langgraph/runtime/#langgraph.runtime.Runtime", "Send": "langgraph/types/#langgraph.types.Send", "Topic": "langgraph/channels/#langgraph.channels.Topic", # LangSmith Deployment SDK @@ -353,12 +352,10 @@ class LinkMap(TypedDict): "initChatModel": "functions/langchain.chat_models_universal.initChatModel.html", "Runnable": "classes/_langchain_core.runnables.Runnable.html", "RunnableConfig": "interfaces/_langchain_core.runnables.RunnableConfig.html", - "Runnable": "classes/_langchain_core.runnables.Runnable.html", "Retrievers": "interfaces/_langchain_core.retrievers.BaseRetriever.html", "VectorStore": "classes/_langchain_core.vectorstores.VectorStore.html", "VectorStore.maxMarginalRelevanceSearch": "classes/_langchain_core.vectorstores.VectorStore.html#maxMarginalRelevanceSearch", "tool": "functions/_langchain_core.tools.tool.html", - "BaseTool": "classes/_langchain_core.tools.StructuredTool.html", "UsageMetadata": "types/_langchain_core.messages.UsageMetadata.html", "BaseLoader": "classes/_langchain_core.document_loaders_base.BaseDocumentLoader.html", "getContextVariable": "functions/_langchain_core.context.getContextVariable.html", @@ -409,12 +406,8 @@ class LinkMap(TypedDict): "getStateHistory": "classes/_langchain_langgraph.pregel.Pregel.html#getStateHistory", "HumanInterrupt": "interfaces/_langchain_langgraph.prebuilt.HumanInterrupt.html", "interrupt": "functions/_langchain_langgraph.index.interrupt.html", - "InMemorySaver": "classes/_langchain_langgraph-checkpoint.MemorySaver.html", - "AsyncPostgresSaver": "classes/_langchain_langgraph-checkpoint-postgres.index.PostgresSaver.html", "CompiledStateGraph.invoke": "classes/_langchain_langgraph.index.CompiledStateGraph.html#invoke", "langgraph.json": "cloud/reference/cli/#configuration-file", - "LastValue": "classes/_langchain_langgraph.channels.LastValue.html", - "Topic": "classes/_langchain_langgraph.channels.Topic.html", "messagesStateReducer": "functions/_langchain_langgraph.index.messagesStateReducer.html", "Pregel": "classes/_langchain_langgraph.pregel.Pregel.html", "Pregel.stream": "classes/_langchain_langgraph.pregel.Pregel.html#stream", From 4796217dfce62a1563a4553486bfc1c93cfd2447 Mon Sep 17 00:00:00 2001 From: Sydney Runkle Date: Sat, 22 Nov 2025 07:27:54 -0500 Subject: [PATCH 10/21] concat --- pipeline/preprocessors/link_map.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pipeline/preprocessors/link_map.py b/pipeline/preprocessors/link_map.py index d70c9bb480..d62da1fcd8 100644 --- a/pipeline/preprocessors/link_map.py +++ b/pipeline/preprocessors/link_map.py @@ -333,6 +333,7 @@ class LinkMap(TypedDict): "BaseMessage": "classes/_langchain_core.messages.BaseMessage.html", "HumanMessage": "classes/_langchain_core.messages.HumanMessage.html", "SystemMessage": "classes/_langchain_core.messages.SystemMessage.html", + "SystemMessage.concat": "classes/_langchain_core.messages.SystemMessage.html#concat", "ToolMessage": "classes/_langchain_core.messages.ToolMessage.html", "ToolCallChunk": "classes/_langchain_core.messages.ToolCallChunk.html", "BaseChatModel": "classes/_langchain_core.language_models_chat_models.BaseChatModel.html", From 8482c5f1f768015f339978f2f3b5416644b51259 Mon Sep 17 00:00:00 2001 From: Sydney Runkle Date: Sat, 22 Nov 2025 16:31:30 -0500 Subject: [PATCH 11/21] broken links, folks --- src/langsmith/rate-limiting.mdx | 2 +- src/oss/javascript/releases/changelog.mdx | 4 ++-- src/oss/langchain/models.mdx | 11 +++++++++-- src/oss/python/releases/changelog.mdx | 4 ++-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/langsmith/rate-limiting.mdx b/src/langsmith/rate-limiting.mdx index 35691704fa..0e2e9d7fff 100644 --- a/src/langsmith/rate-limiting.mdx +++ b/src/langsmith/rate-limiting.mdx @@ -30,7 +30,7 @@ def evaluator(inputs: dict, outputs: dict, reference_outputs: dict) -> dict: ... ``` -See the [`langchain`](oss/langchain/models#rate-limiting) documentation for more on how to configure rate limiters. +See the [`langchain`](/oss/langchain/models#rate-limiting) documentation for more on how to configure rate limiters. ## Retrying with exponential backoff diff --git a/src/oss/javascript/releases/changelog.mdx b/src/oss/javascript/releases/changelog.mdx index 13a62cba8d..75bcd72608 100644 --- a/src/oss/javascript/releases/changelog.mdx +++ b/src/oss/javascript/releases/changelog.mdx @@ -19,7 +19,7 @@ A chronological log of updates and improvements to LangChain JavaScript. - [Migration guide](/oss/migrate/langchain-v1) - How to migrate to LangChain v1 - [V1 Release notes](/oss/javascript/releases/langchain-v1) - Detailed release notes -- [Release policy](/oss/javascript/release-policy) - Detailed release policies -- [Versioning](/oss/javascript/versioning) - Understanding version numbers +- [Release policy](/oss/release-policy) - Detailed release policies +- [Versioning](/oss/versioning) - Understanding version numbers - [Report issues on GitHub](https://github.com/langchain-ai/langchainjs/issues) diff --git a/src/oss/langchain/models.mdx b/src/oss/langchain/models.mdx index d51f18f8a5..e9d69ad9e7 100644 --- a/src/oss/langchain/models.mdx +++ b/src/oss/langchain/models.mdx @@ -46,7 +46,7 @@ response = model.invoke("Why do parrots talk?") See @[`init_chat_model`][init_chat_model] for more detail, including information on how to pass model [parameters](#parameters). ::: :::js -The easiest way to get started with a standalone model in LangChain is to use `initChatModel` to initialize one from a [provider](/oss/integrations/providers/overview) of your choice (examples below): +The easiest way to get started with a standalone model in LangChain is to use `initChatModel` to initialize one from a [chat model provider](/oss/integrations/chat) of your choice (examples below): ```typescript @@ -68,9 +68,16 @@ See @[`initChatModel`][initChatModel] for more detail, including information on Send multiple requests to a model in a batch for more efficient processing. +:::python + + In addition to chat models, LangChain provides support for other adjacent technologies, such as embedding models and vector stores. See the [integrations page](/oss/python/integrations/providers/overview) for details. + +::: +:::js - In addition to chat models, LangChain provides support for other adjacent technologies, such as embedding models and vector stores. See the [integrations page](/oss/integrations/providers/overview) for details. + In addition to chat models, LangChain provides support for other adjacent technologies, such as embedding models and vector stores. See the [integrations page](/oss/javascript/integrations/providers/overview) for details. +::: ## Parameters diff --git a/src/oss/python/releases/changelog.mdx b/src/oss/python/releases/changelog.mdx index c3e2632f61..201d175c71 100644 --- a/src/oss/python/releases/changelog.mdx +++ b/src/oss/python/releases/changelog.mdx @@ -18,6 +18,6 @@ A chronological log of updates and improvements to LangChain Python. - [V1 Migration guide](/oss/migrate/langchain-v1) - How to migrate to LangChain v1 - [V1 Release notes](/oss/python/releases/langchain-v1) - Detailed release notes -- [Release policy](/oss/python/release-policy) - Detailed release policies -- [Versioning](/oss/python/versioning) - Understanding version numbers +- [Release policy](/oss/release-policy) - Detailed release policies +- [Versioning](/oss/versioning) - Understanding version numbers - [Report issues on GitHub](https://github.com/langchain-ai/langchain/issues) From e26df2d24568076c0605d555cccbc16c2a19e35e Mon Sep 17 00:00:00 2001 From: Sydney Runkle Date: Sat, 22 Nov 2025 16:38:22 -0500 Subject: [PATCH 12/21] use sys message --- src/oss/langchain/middleware/custom.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/oss/langchain/middleware/custom.mdx b/src/oss/langchain/middleware/custom.mdx index e571485ccd..0591c90883 100644 --- a/src/oss/langchain/middleware/custom.mdx +++ b/src/oss/langchain/middleware/custom.mdx @@ -1054,18 +1054,18 @@ class CachedContextMiddleware(AgentMiddleware): ```typescript import { createMiddleware, SystemMessage, createAgent } from "langchain"; -// Middleware 1: Uses systemPrompt (string) +// Middleware 1: Uses systemMessage with simple concatenation const myMiddleware = createMiddleware({ name: "MyMiddleware", wrapModelCall: async (request, handler) => { return handler({ ...request, - systemPrompt: request.systemMessage.concat(`\nAdditional context.`), + systemMessage: request.systemMessage.concat(`\nAdditional context.`), }); }, }); -// Middleware 2: Uses systemMessage (preserves structure) +// Middleware 2: Uses systemMessage with structured content (preserves structure) const myOtherMiddleware = createMiddleware({ name: "MyOtherMiddleware", wrapModelCall: async (request, handler) => { From 0857827d9502f693a0c14f2c57fa1359bc6f699e Mon Sep 17 00:00:00 2001 From: Sydney Runkle Date: Sat, 22 Nov 2025 16:49:35 -0500 Subject: [PATCH 13/21] more fixes --- pipeline/preprocessors/link_map.py | 7 ++++--- src/oss/langchain/observability.mdx | 9 +++++++++ src/oss/langchain/rag.mdx | 9 +++++++++ src/oss/langgraph/errors/INVALID_CHAT_HISTORY.mdx | 4 ++-- src/oss/langgraph/test.mdx | 7 +++++++ 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/pipeline/preprocessors/link_map.py b/pipeline/preprocessors/link_map.py index d62da1fcd8..50ddfc98be 100644 --- a/pipeline/preprocessors/link_map.py +++ b/pipeline/preprocessors/link_map.py @@ -398,9 +398,9 @@ class LinkMap(TypedDict): "BinaryOperatorAggregate": "classes/_langchain_langgraph.index.BinaryOperatorAggregate.html", "Command": "classes/_langchain_langgraph.index.Command.html", "CompiledStateGraph": "classes/_langchain_langgraph.index.CompiledStateGraph.html", - "create_agent": "functions/langchain.index.createAgent.html", - "create_react_agent": "functions/_langchain_langgraph.prebuilt.createReactAgent.html", - "create_supervisor": "functions/_langchain_langgraph-supervisor.createSupervisor.html", + "createAgent": "functions/langchain.index.createAgent.html", + "createReactAgent": "functions/_langchain_langgraph.prebuilt.createReactAgent.html", + "createSupervisor": "functions/_langchain_langgraph-supervisor.createSupervisor.html", "entrypoint": "functions/_langchain_langgraph.index.entrypoint.html", "entrypoint.final": "functions/_langchain_langgraph.index.entrypoint.html#final", "get_state_history": "classes/_langchain_langgraph.pregel.Pregel.html#getStateHistory", @@ -436,6 +436,7 @@ class LinkMap(TypedDict): "ContextEdit": "interfaces/langchain.index.ContextEdit.html", "toolRetryMiddleware": "functions/langchain.index.toolRetryMiddleware.html", "modelRetryMiddleware": "functions/langchain.index.modelRetryMiddleware.html", + "systemPrompt": "types/langchain.index.CreateAgentParams.html#systemprompt" }, }, ] diff --git a/src/oss/langchain/observability.mdx b/src/oss/langchain/observability.mdx index 61d4778bf5..ba7cf26fd7 100644 --- a/src/oss/langchain/observability.mdx +++ b/src/oss/langchain/observability.mdx @@ -5,8 +5,17 @@ sidebarTitle: Observability import observability from '/snippets/oss/observability.mdx'; +:::python + As you build and run agents with LangChain, you need visibility into how they behave: which [tools](/oss/langchain/tools) they call, what prompts they generate, and how they make decisions. LangChain agents built with @[`create_agent`] automatically support tracing through [LangSmith](/langsmith/home), a platform for capturing, debugging, evaluating, and monitoring LLM application behavior. +::: +:::js + +As you build and run agents with LangChain, you need visibility into how they behave: which [tools](/oss/langchain/tools) they call, what prompts they generate, and how they make decisions. LangChain agents built with @[`createAgent`] automatically support tracing through [LangSmith](/langsmith/home), a platform for capturing, debugging, evaluating, and monitoring LLM application behavior. + +::: + [_Traces_](/langsmith/observability-concepts#traces) record every step of your agent's execution, from the initial user input to the final response, including all tool calls, model interactions, and decision points. This execution data helps you debug issues, evaluate performance across different inputs, and monitor usage patterns in production. This guide shows you how to enable tracing for your LangChain agents and use LangSmith to analyze their execution. diff --git a/src/oss/langchain/rag.mdx b/src/oss/langchain/rag.mdx index f9813cf55b..fd10c9d1df 100644 --- a/src/oss/langchain/rag.mdx +++ b/src/oss/langchain/rag.mdx @@ -897,8 +897,17 @@ const agent = createAgent({ ## Next steps +:::python + Now that we've implemented a simple RAG application via @[`create_agent`], we can easily incorporate new features and go deeper: +::: +:::js + +Now that we've implemented a simple RAG application via @[`createAgent`], we can easily incorporate new features and go deeper: + +::: + - [Stream](/oss/langchain/streaming) tokens and other information for responsive user experiences - Add [conversational memory](/oss/langchain/short-term-memory) to support multi-turn interactions - Add [long-term memory](/oss/langchain/long-term-memory) to support memory across conversational threads diff --git a/src/oss/langgraph/errors/INVALID_CHAT_HISTORY.mdx b/src/oss/langgraph/errors/INVALID_CHAT_HISTORY.mdx index b23e2e7009..023b73aaf4 100644 --- a/src/oss/langgraph/errors/INVALID_CHAT_HISTORY.mdx +++ b/src/oss/langgraph/errors/INVALID_CHAT_HISTORY.mdx @@ -3,11 +3,11 @@ title: INVALID_CHAT_HISTORY --- :::python -This error is raised in the prebuilt @[create_agent][create_agent] when the `call_model` graph node receives a malformed list of messages. Specifically, it is malformed when there are `AIMessages` with `tool_calls` (LLM requesting to call a tool) that do not have a corresponding @[`ToolMessage`] (result of a tool invocation to return to the LLM). +This error is raised in the prebuilt @[`create_agent`] when the `call_model` graph node receives a malformed list of messages. Specifically, it is malformed when there are `AIMessages` with `tool_calls` (LLM requesting to call a tool) that do not have a corresponding @[`ToolMessage`] (result of a tool invocation to return to the LLM). ::: :::js -This error is raised in the prebuilt @[createAgent][create_agent] when the `callModel` graph node receives a malformed list of messages. Specifically, it is malformed when there are `AIMessage`s with `tool_calls` (LLM requesting to call a tool) that do not have a corresponding @[`ToolMessage`] (result of a tool invocation to return to the LLM). +This error is raised in the prebuilt @[`createAgent`] when the `callModel` graph node receives a malformed list of messages. Specifically, it is malformed when there are `AIMessage`s with `tool_calls` (LLM requesting to call a tool) that do not have a corresponding @[`ToolMessage`] (result of a tool invocation to return to the LLM). ::: There could be a few reasons you're seeing this error: diff --git a/src/oss/langgraph/test.mdx b/src/oss/langgraph/test.mdx index cfe3b62e68..70f29f188b 100644 --- a/src/oss/langgraph/test.mdx +++ b/src/oss/langgraph/test.mdx @@ -6,7 +6,14 @@ title: Test After you've prototyped your LangGraph agent, a natural next step is to add tests. This guide covers some useful patterns you can use when writing unit tests. +:::python Note that this guide is LangGraph-specific and covers scenarios around graphs with custom structures - if you are just getting started, check out [this section](/oss/langchain/test/) that uses LangChain's built-in @[`create_agent`] instead. +::: + +:::js +Note that this guide is LangGraph-specific and covers scenarios around graphs with custom structures - if you are just getting started, check out [this section](/oss/langchain/test/) that uses LangChain's built-in @[`createAgent`] instead. +::: + ## Prerequisites From a4538bd64efbe11c6310d4eca9c89d41ef939a03 Mon Sep 17 00:00:00 2001 From: Sydney Runkle Date: Sat, 22 Nov 2025 16:50:09 -0500 Subject: [PATCH 14/21] christian addition --- src/oss/javascript/releases/changelog.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oss/javascript/releases/changelog.mdx b/src/oss/javascript/releases/changelog.mdx index 75bcd72608..097a63005e 100644 --- a/src/oss/javascript/releases/changelog.mdx +++ b/src/oss/javascript/releases/changelog.mdx @@ -13,7 +13,7 @@ A chronological log of updates and improvements to LangChain JavaScript. * [`SystemMessage` for `createAgent`](/oss/langchain/middleware/custom#working-with-system-messages): Support for passing `SystemMessage` instances directly to `createAgent`'s `systemPrompt` parameter and a new `concat` method for extending system messages. Enables advanced features like cache control and structured content blocks. * [Model retry middleware](/oss/langchain/middleware/built-in#model-retry): New middleware for automatically retrying failed model calls with configurable exponential backoff, improving agent reliability. * [Content moderation middleware](/oss/langchain/middleware/built-in#content-moderation): OpenAI content moderation middleware for detecting and handling unsafe content in agent interactions. Supports checking user input, model output, and tool results. -* Compatibility improvements: LangChain.js now supports Zod v4 with backward compatibility, enabling use of the latest Zod features for structured output and tool schemas. +* * __Compatibility improvements:__ Fixed error handling for Zod v4 validation errors in structured output and tool schemas, ensuring detailed error messages are properly displayed. ### Resources From 07e3d44545b330f361f1bd5cab16694f6fad4edd Mon Sep 17 00:00:00 2001 From: Sydney Runkle Date: Sat, 22 Nov 2025 16:53:31 -0500 Subject: [PATCH 15/21] prompt --- pipeline/preprocessors/link_map.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipeline/preprocessors/link_map.py b/pipeline/preprocessors/link_map.py index 50ddfc98be..be5caba030 100644 --- a/pipeline/preprocessors/link_map.py +++ b/pipeline/preprocessors/link_map.py @@ -436,7 +436,7 @@ class LinkMap(TypedDict): "ContextEdit": "interfaces/langchain.index.ContextEdit.html", "toolRetryMiddleware": "functions/langchain.index.toolRetryMiddleware.html", "modelRetryMiddleware": "functions/langchain.index.modelRetryMiddleware.html", - "systemPrompt": "types/langchain.index.CreateAgentParams.html#systemprompt" + "systemPrompt": "types/langchain.index.CreateAgentParams.html#systemprompt", }, }, ] From 13e85f9a750a29224dab7f8691ac27b370c70b57 Mon Sep 17 00:00:00 2001 From: Sydney Runkle Date: Sat, 22 Nov 2025 17:06:06 -0500 Subject: [PATCH 16/21] links --- src/oss/javascript/releases/changelog.mdx | 2 +- src/oss/python/releases/changelog.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/oss/javascript/releases/changelog.mdx b/src/oss/javascript/releases/changelog.mdx index 097a63005e..8086272f9d 100644 --- a/src/oss/javascript/releases/changelog.mdx +++ b/src/oss/javascript/releases/changelog.mdx @@ -17,7 +17,7 @@ A chronological log of updates and improvements to LangChain JavaScript. ### Resources -- [Migration guide](/oss/migrate/langchain-v1) - How to migrate to LangChain v1 +- [V1 Migration guide](/oss/javascript/migrate/langchain-v1) - How to migrate to LangChain v1 - [V1 Release notes](/oss/javascript/releases/langchain-v1) - Detailed release notes - [Release policy](/oss/release-policy) - Detailed release policies - [Versioning](/oss/versioning) - Understanding version numbers diff --git a/src/oss/python/releases/changelog.mdx b/src/oss/python/releases/changelog.mdx index 201d175c71..e11394f587 100644 --- a/src/oss/python/releases/changelog.mdx +++ b/src/oss/python/releases/changelog.mdx @@ -16,7 +16,7 @@ A chronological log of updates and improvements to LangChain Python. ## Resources -- [V1 Migration guide](/oss/migrate/langchain-v1) - How to migrate to LangChain v1 +- [V1 Migration guide](/oss/python/migrate/langchain-v1) - How to migrate to LangChain v1 - [V1 Release notes](/oss/python/releases/langchain-v1) - Detailed release notes - [Release policy](/oss/release-policy) - Detailed release policies - [Versioning](/oss/versioning) - Understanding version numbers From 539c5c1a78a5b3aa10c0aed61fe2099b09b0bdbe Mon Sep 17 00:00:00 2001 From: Sydney Runkle Date: Sat, 22 Nov 2025 17:10:27 -0500 Subject: [PATCH 17/21] please fix --- src/oss/python/releases/changelog.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/oss/python/releases/changelog.mdx b/src/oss/python/releases/changelog.mdx index e11394f587..aea1b9ca42 100644 --- a/src/oss/python/releases/changelog.mdx +++ b/src/oss/python/releases/changelog.mdx @@ -16,8 +16,8 @@ A chronological log of updates and improvements to LangChain Python. ## Resources -- [V1 Migration guide](/oss/python/migrate/langchain-v1) - How to migrate to LangChain v1 -- [V1 Release notes](/oss/python/releases/langchain-v1) - Detailed release notes +- [V1 Migration guide](/oss/migrate/langchain-v1) - How to migrate to LangChain v1 +- [V1 Release notes](/oss/releases/langchain-v1) - Detailed release notes - [Release policy](/oss/release-policy) - Detailed release policies - [Versioning](/oss/versioning) - Understanding version numbers - [Report issues on GitHub](https://github.com/langchain-ai/langchain/issues) From 89dd2f446db0c96198361b6713486b4b88815231 Mon Sep 17 00:00:00 2001 From: Sydney Runkle Date: Sat, 22 Nov 2025 17:13:19 -0500 Subject: [PATCH 18/21] all that I can do --- src/oss/javascript/releases/changelog.mdx | 4 ++-- src/oss/langchain/models.mdx | 17 +++++------------ 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/oss/javascript/releases/changelog.mdx b/src/oss/javascript/releases/changelog.mdx index 8086272f9d..fcc8cb00e4 100644 --- a/src/oss/javascript/releases/changelog.mdx +++ b/src/oss/javascript/releases/changelog.mdx @@ -17,8 +17,8 @@ A chronological log of updates and improvements to LangChain JavaScript. ### Resources -- [V1 Migration guide](/oss/javascript/migrate/langchain-v1) - How to migrate to LangChain v1 -- [V1 Release notes](/oss/javascript/releases/langchain-v1) - Detailed release notes +- [V1 Migration guide](/oss/migrate/langchain-v1) - How to migrate to LangChain v1 +- [V1 Release notes](/oss/releases/langchain-v1) - Detailed release notes - [Release policy](/oss/release-policy) - Detailed release policies - [Versioning](/oss/versioning) - Understanding version numbers - [Report issues on GitHub](https://github.com/langchain-ai/langchainjs/issues) diff --git a/src/oss/langchain/models.mdx b/src/oss/langchain/models.mdx index e9d69ad9e7..d8d5e85393 100644 --- a/src/oss/langchain/models.mdx +++ b/src/oss/langchain/models.mdx @@ -68,16 +68,9 @@ See @[`initChatModel`][initChatModel] for more detail, including information on Send multiple requests to a model in a batch for more efficient processing. -:::python - - In addition to chat models, LangChain provides support for other adjacent technologies, such as embedding models and vector stores. See the [integrations page](/oss/python/integrations/providers/overview) for details. - -::: -:::js - In addition to chat models, LangChain provides support for other adjacent technologies, such as embedding models and vector stores. See the [integrations page](/oss/javascript/integrations/providers/overview) for details. + In addition to chat models, LangChain provides support for other adjacent technologies, such as embedding models and vector stores. See the [integrations page](/oss/integrations/providers/overview) for details. -::: ## Parameters @@ -1256,11 +1249,11 @@ to avoid mutating shared state. **Option 2 (fix data upstream)** -The primary source for the data is the [models.dev](https://models.dev/) project. These data are merged with additional fields and overrides in LangChain [integration packages](/oss/python/integrations/providers/overview) and are shipped with those packages. +The primary source for the data is the [models.dev](https://models.dev/) project. These data are merged with additional fields and overrides in LangChain [integration packages](/oss/integrations/providers/overview) and are shipped with those packages. Model profile data can be updated through the following process: 1. (If needed) update the source data at [models.dev](https://models.dev/) through a pull request to its [repository on Github](https://github.com/sst/models.dev). -2. (If needed) update additional fields and overrides in `langchain_/data/profile_augmentations.toml` through a pull request to the LangChain [integration package](/oss/python/integrations/providers/overview)`. +2. (If needed) update additional fields and overrides in `langchain_/data/profile_augmentations.toml` through a pull request to the LangChain [integration package](/oss/integrations/providers/overview)`. 3. Use the [langchain-model-profiles](https://pypi.org/project/langchain-model-profiles/) CLI tool to pull the latest data from [models.dev](https://models.dev/), merge in the augmentations and update the profile data: ```bash @@ -1320,11 +1313,11 @@ const model = initChatModel("...", { profile: customProfile }); **Option 2 (fix data upstream)** -The primary source for the data is the [models.dev](https://models.dev/) project. These data are merged with additional fields and overrides in LangChain [integration packages](/oss/javascript/integrations/providers/overview) and are shipped with those packages. +The primary source for the data is the [models.dev](https://models.dev/) project. These data are merged with additional fields and overrides in LangChain [integration packages](/oss/integrations/providers/overview) and are shipped with those packages. Model profile data can be updated through the following process: 1. (If needed) update the source data at [models.dev](https://models.dev/) through a pull request to its [repository on Github](https://github.com/sst/models.dev). -2. (If needed) update additional fields and overrides in `langchain-/profiles.toml` through a pull request to the LangChain [integration package](/oss/javascript/integrations/providers/overview). +2. (If needed) update additional fields and overrides in `langchain-/profiles.toml` through a pull request to the LangChain [integration package](/oss/integrations/providers/overview). ::: From c33f5f9a9a708019283280014d917fd92111108c Mon Sep 17 00:00:00 2001 From: Christian Bromann Date: Sat, 22 Nov 2025 14:20:51 -0800 Subject: [PATCH 19/21] chore: extend changelog docs on changing dynamic system prompt middleware (#1587) More clarity on changing behavior of dynamic system prompt middleware --- src/oss/javascript/releases/changelog.mdx | 3 ++- src/oss/langchain/middleware/custom.mdx | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/oss/javascript/releases/changelog.mdx b/src/oss/javascript/releases/changelog.mdx index fcc8cb00e4..3a1a061423 100644 --- a/src/oss/javascript/releases/changelog.mdx +++ b/src/oss/javascript/releases/changelog.mdx @@ -11,9 +11,10 @@ A chronological log of updates and improvements to LangChain JavaScript. * [Summarization middleware](/oss/langchain/middleware/built-in#summarization): Updated to support flexible trigger points using model profiles for context-aware summarization. * [Structured output](/oss/langchain/structured-output): `ProviderStrategy` support (native structured output) can now be inferred from model profiles. * [`SystemMessage` for `createAgent`](/oss/langchain/middleware/custom#working-with-system-messages): Support for passing `SystemMessage` instances directly to `createAgent`'s `systemPrompt` parameter and a new `concat` method for extending system messages. Enables advanced features like cache control and structured content blocks. +* [Dynamic system prompt middleware](/oss/langchain/agents#dynamic-system-prompt): Return values from `dynamicSystemPromptMiddleware` are now purely additive. When returning a @[`SystemMessage`] or `string`, they are merged with existing system messages rather than replacing them, making it easier to compose multiple middleware that modify the prompt. * [Model retry middleware](/oss/langchain/middleware/built-in#model-retry): New middleware for automatically retrying failed model calls with configurable exponential backoff, improving agent reliability. * [Content moderation middleware](/oss/langchain/middleware/built-in#content-moderation): OpenAI content moderation middleware for detecting and handling unsafe content in agent interactions. Supports checking user input, model output, and tool results. -* * __Compatibility improvements:__ Fixed error handling for Zod v4 validation errors in structured output and tool schemas, ensuring detailed error messages are properly displayed. +* __Compatibility improvements:__ Fixed error handling for Zod v4 validation errors in structured output and tool schemas, ensuring detailed error messages are properly displayed. ### Resources diff --git a/src/oss/langchain/middleware/custom.mdx b/src/oss/langchain/middleware/custom.mdx index 0591c90883..c7bf3dfcd8 100644 --- a/src/oss/langchain/middleware/custom.mdx +++ b/src/oss/langchain/middleware/custom.mdx @@ -1049,6 +1049,8 @@ class CachedContextMiddleware(AgentMiddleware): ::: :::js +Modify system messages in middleware using the `systemMessage` field in `ModelRequest`. It contains a @[`SystemMessage`] object (even if the agent was created with a string @[`systemPrompt`]). + **Example: Chaining middleware** - Different middleware can use different approaches: ```typescript @@ -1060,7 +1062,7 @@ const myMiddleware = createMiddleware({ wrapModelCall: async (request, handler) => { return handler({ ...request, - systemMessage: request.systemMessage.concat(`\nAdditional context.`), + systemMessage: request.systemMessage.concat(`Additional context.`), }); }, }); @@ -1093,6 +1095,21 @@ const agent = createAgent({ }); ``` +The resulting system message will be: +```typescript +new SystemMessage({ + content: [ + { type: "text", text: "You are a helpful assistant." }, + { type: "text", text: "Additional context." }, + { + type: "text", + text: " More additional context. This will be cached.", + cache_control: { type: "ephemeral", ttl: "5m" }, + }, + ], +}); +``` + Use @[`SystemMessage.concat`] to preserve cache control metadata or structured content blocks created by other middleware. ::: From 08aad24fff5cc7f7cb7e29e64a8cf4ec220ea16c Mon Sep 17 00:00:00 2001 From: Sydney Runkle Date: Sun, 23 Nov 2025 17:18:16 -0500 Subject: [PATCH 20/21] changelog --- src/oss/javascript/releases/changelog.mdx | 21 ++++++++++++++++----- src/oss/python/releases/changelog.mdx | 5 ++++- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/oss/javascript/releases/changelog.mdx b/src/oss/javascript/releases/changelog.mdx index 3a1a061423..8ac6897ad1 100644 --- a/src/oss/javascript/releases/changelog.mdx +++ b/src/oss/javascript/releases/changelog.mdx @@ -1,22 +1,33 @@ --- title: Changelog sidebarTitle: Changelog +rss: true --- A chronological log of updates and improvements to LangChain JavaScript. -## v1.1 (11/25/2025) + + +### New Features * [Model profiles](/oss/langchain/models#model-profiles): Chat models now expose supported features and capabilities through a `.profile` getter. These data are derived from [models.dev](https://github.com/sst/models.dev), an open source project providing model capability data. +* [Model retry middleware](/oss/langchain/middleware/built-in#model-retry): New middleware for automatically retrying failed model calls with configurable exponential backoff, improving agent reliability. +* [Content moderation middleware](/oss/langchain/middleware/built-in#content-moderation): OpenAI content moderation middleware for detecting and handling unsafe content in agent interactions. Supports checking user input, model output, and tool results. + +### Improvements + * [Summarization middleware](/oss/langchain/middleware/built-in#summarization): Updated to support flexible trigger points using model profiles for context-aware summarization. * [Structured output](/oss/langchain/structured-output): `ProviderStrategy` support (native structured output) can now be inferred from model profiles. * [`SystemMessage` for `createAgent`](/oss/langchain/middleware/custom#working-with-system-messages): Support for passing `SystemMessage` instances directly to `createAgent`'s `systemPrompt` parameter and a new `concat` method for extending system messages. Enables advanced features like cache control and structured content blocks. * [Dynamic system prompt middleware](/oss/langchain/agents#dynamic-system-prompt): Return values from `dynamicSystemPromptMiddleware` are now purely additive. When returning a @[`SystemMessage`] or `string`, they are merged with existing system messages rather than replacing them, making it easier to compose multiple middleware that modify the prompt. -* [Model retry middleware](/oss/langchain/middleware/built-in#model-retry): New middleware for automatically retrying failed model calls with configurable exponential backoff, improving agent reliability. -* [Content moderation middleware](/oss/langchain/middleware/built-in#content-moderation): OpenAI content moderation middleware for detecting and handling unsafe content in agent interactions. Supports checking user input, model output, and tool results. -* __Compatibility improvements:__ Fixed error handling for Zod v4 validation errors in structured output and tool schemas, ensuring detailed error messages are properly displayed. -### Resources +### Bug Fixes + +* **Compatibility improvements:** Fixed error handling for Zod v4 validation errors in structured output and tool schemas, ensuring detailed error messages are properly displayed. + + + +## Resources - [V1 Migration guide](/oss/migrate/langchain-v1) - How to migrate to LangChain v1 - [V1 Release notes](/oss/releases/langchain-v1) - Detailed release notes diff --git a/src/oss/python/releases/changelog.mdx b/src/oss/python/releases/changelog.mdx index aea1b9ca42..0403f05543 100644 --- a/src/oss/python/releases/changelog.mdx +++ b/src/oss/python/releases/changelog.mdx @@ -1,11 +1,12 @@ --- title: Changelog sidebarTitle: Changelog +rss: true --- A chronological log of updates and improvements to LangChain Python. -## v1.1 (11/25/2025) + * [Model profiles](/oss/langchain/models#model-profiles): Chat models now expose supported features and capabilities through a `.profile` attribute. These data are derived from [models.dev](https://github.com/sst/models.dev), an open source project providing model capability data. * [Summarization middleware](/oss/langchain/middleware/built-in#summarization): Updated to support flexible trigger points using model profiles for context-aware summarization. @@ -14,6 +15,8 @@ A chronological log of updates and improvements to LangChain Python. * [Model retry middleware](/oss/langchain/middleware/built-in#model-retry): New middleware for automatically retrying failed model calls with configurable exponential backoff. * [Content moderation middleware](/oss/langchain/middleware/built-in#content-moderation): OpenAI content moderation middleware for detecting and handling unsafe content in agent interactions. Supports checking user input, model output, and tool results. + + ## Resources - [V1 Migration guide](/oss/migrate/langchain-v1) - How to migrate to LangChain v1 From 839bfe6d8998cec2189a3bc7420a29c1fe62db3d Mon Sep 17 00:00:00 2001 From: Sydney Runkle Date: Sun, 23 Nov 2025 17:26:23 -0500 Subject: [PATCH 21/21] changelog --- src/oss/javascript/releases/changelog.mdx | 8 -------- src/oss/python/releases/changelog.mdx | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/oss/javascript/releases/changelog.mdx b/src/oss/javascript/releases/changelog.mdx index 8ac6897ad1..1206b432de 100644 --- a/src/oss/javascript/releases/changelog.mdx +++ b/src/oss/javascript/releases/changelog.mdx @@ -8,21 +8,13 @@ A chronological log of updates and improvements to LangChain JavaScript. -### New Features - * [Model profiles](/oss/langchain/models#model-profiles): Chat models now expose supported features and capabilities through a `.profile` getter. These data are derived from [models.dev](https://github.com/sst/models.dev), an open source project providing model capability data. * [Model retry middleware](/oss/langchain/middleware/built-in#model-retry): New middleware for automatically retrying failed model calls with configurable exponential backoff, improving agent reliability. * [Content moderation middleware](/oss/langchain/middleware/built-in#content-moderation): OpenAI content moderation middleware for detecting and handling unsafe content in agent interactions. Supports checking user input, model output, and tool results. - -### Improvements - * [Summarization middleware](/oss/langchain/middleware/built-in#summarization): Updated to support flexible trigger points using model profiles for context-aware summarization. * [Structured output](/oss/langchain/structured-output): `ProviderStrategy` support (native structured output) can now be inferred from model profiles. * [`SystemMessage` for `createAgent`](/oss/langchain/middleware/custom#working-with-system-messages): Support for passing `SystemMessage` instances directly to `createAgent`'s `systemPrompt` parameter and a new `concat` method for extending system messages. Enables advanced features like cache control and structured content blocks. * [Dynamic system prompt middleware](/oss/langchain/agents#dynamic-system-prompt): Return values from `dynamicSystemPromptMiddleware` are now purely additive. When returning a @[`SystemMessage`] or `string`, they are merged with existing system messages rather than replacing them, making it easier to compose multiple middleware that modify the prompt. - -### Bug Fixes - * **Compatibility improvements:** Fixed error handling for Zod v4 validation errors in structured output and tool schemas, ensuring detailed error messages are properly displayed. diff --git a/src/oss/python/releases/changelog.mdx b/src/oss/python/releases/changelog.mdx index 0403f05543..e7f94e269c 100644 --- a/src/oss/python/releases/changelog.mdx +++ b/src/oss/python/releases/changelog.mdx @@ -6,7 +6,7 @@ rss: true A chronological log of updates and improvements to LangChain Python. - + * [Model profiles](/oss/langchain/models#model-profiles): Chat models now expose supported features and capabilities through a `.profile` attribute. These data are derived from [models.dev](https://github.com/sst/models.dev), an open source project providing model capability data. * [Summarization middleware](/oss/langchain/middleware/built-in#summarization): Updated to support flexible trigger points using model profiles for context-aware summarization.