-
Notifications
You must be signed in to change notification settings - Fork 1k
1.1 release notes #1555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
1.1 release notes #1555
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d783557
relnotes draft
sydney-runkle 9323182
Merge branch 'main' into sr/1.1-release-notes
christian-bromann f909b9a
v1.1 JS release notes (#1557)
christian-bromann 6d8570d
updates
ccurme 1098a58
nits: v1.1 release notes (#1577)
mdrxy d1ca5c2
Merge branch 'main' into sr/1.1-release-notes
sydney-runkle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,136 @@ | ||
| --- | ||
| 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, | ||
sydney-runkle marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| <CodeGroup> | ||
| ```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 | ||
| ``` | ||
| </CodeGroup> | ||
|
|
||
| ## 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 | ||
|
|
||
| <CardGroup cols={3}> | ||
| <Card title="Agents" icon="robot" href="/oss/langchain/agents" arrow> | ||
| Learn about building agents with LangChain | ||
| </Card> | ||
| <Card title="Middleware" icon="layer-group" href="/oss/langchain/middleware/overview" arrow> | ||
| Deep dive into middleware concepts | ||
| </Card> | ||
| <Card title="Tools" icon="wrench" href="/oss/langchain/tools" arrow> | ||
| Working with tools in agents | ||
| </Card> | ||
| <Card title="Migration guide" icon="arrow-right-arrow-left" href="/oss/migrate/langchain-v1" arrow> | ||
| How to migrate to LangChain v1 | ||
| </Card> | ||
| <Card title="GitHub" icon="github" href="https://github.com/langchain-ai/langchainjs"> | ||
| Report issues or contribute | ||
| </Card> | ||
| </CardGroup> | ||
|
|
||
| ## See also | ||
sydney-runkle marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - [Versioning](/oss/javascript/versioning) - Understanding version numbers | ||
| - [Release policy](/oss/javascript/release-policy) - Detailed release policies | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| --- | ||
| 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, | ||
sydney-runkle marked this conversation as resolved.
Show resolved
Hide resolved
sydney-runkle marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| <CodeGroup> | ||
| ```bash pip | ||
| pip install -U langchain | ||
| ``` | ||
| ```bash uv | ||
| uv add langchain | ||
| ``` | ||
| </CodeGroup> | ||
|
|
||
| ## 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. | ||
sydney-runkle marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ### 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). | ||
sydney-runkle marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## Additional resources | ||
|
|
||
| <CardGroup cols={3}> | ||
| <Card title="Agents" icon="robot" href="/oss/langchain/agents" arrow> | ||
| Learn about building agents with LangChain | ||
| </Card> | ||
| <Card title="Middleware" icon="layer-group" href="/oss/langchain/middleware/overview" arrow> | ||
| Deep dive into middleware concepts | ||
| </Card> | ||
| <Card title="Tools" icon="wrench" href="/oss/langchain/tools" arrow> | ||
| Working with tools in agents | ||
| </Card> | ||
| <Card title="Migration guide" icon="arrow-right-arrow-left" href="/oss/migrate/langchain-v1" arrow> | ||
| How to migrate to LangChain v1 | ||
| </Card> | ||
| <Card title="GitHub" icon="github" href="https://github.com/langchain-ai/langchain"> | ||
| Report issues or contribute | ||
| </Card> | ||
| </CardGroup> | ||
|
|
||
| ## See also | ||
|
|
||
| - [Versioning](/oss/python/versioning) - Understanding version numbers | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe these should be combined w the "Additional resources" section? |
||
| - [Release policy](/oss/python/release-policy) - Detailed release policies | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's order this newest to oldest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, can you remove the /releases/langchain-v1 from the langchain tab?
i think the release notes should live in the Reference tab and we can keep the migration guide on the main tab
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break the drilldown nav. It needs either needs to be old -> new (within the current setup) or we need to un-nest the releases dropdown in the left sidebar.
https://www.mintlify.com/docs/organize/navigation#enable-auto-navigation-for-groups
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to refactor this area to not be in a sidebar nav folder, as drilldown to v1 always is not wanted