Skip to content

Commit e3f5932

Browse files
sydney-runklechristian-bromannccurmemdrxy
authored
1.1 changelog (#1581)
Ended up pivoting to a simple changelog approach for the 1.1 release notes. This is more sustainable and motivates us to write up robust docs that we can link out to for new features and changes. Post actual release, we can link out to the changelog on github w/ nitty gritty details. Also fixing some broken links :) --------- Co-authored-by: Christian Bromann <[email protected]> Co-authored-by: Chester Curme <[email protected]> Co-authored-by: Mason Daugherty <[email protected]>
1 parent f502d5f commit e3f5932

File tree

13 files changed

+303
-22
lines changed

13 files changed

+303
-22
lines changed

pipeline/preprocessors/link_map.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ class LinkMap(TypedDict):
333333
"BaseMessage": "classes/_langchain_core.messages.BaseMessage.html",
334334
"HumanMessage": "classes/_langchain_core.messages.HumanMessage.html",
335335
"SystemMessage": "classes/_langchain_core.messages.SystemMessage.html",
336+
"SystemMessage.concat": "classes/_langchain_core.messages.SystemMessage.html#concat",
336337
"ToolMessage": "classes/_langchain_core.messages.ToolMessage.html",
337338
"ToolCallChunk": "classes/_langchain_core.messages.ToolCallChunk.html",
338339
"BaseChatModel": "classes/_langchain_core.language_models_chat_models.BaseChatModel.html",
@@ -350,8 +351,8 @@ class LinkMap(TypedDict):
350351
"Document": "classes/_langchain_core.documents.Document.html",
351352
"Embeddings": "classes/_langchain_core.embeddings.Embeddings.html",
352353
"initChatModel": "functions/langchain.chat_models_universal.initChatModel.html",
353-
"RunnableConfig": "interfaces/_langchain_core.runnables.RunnableConfig.html",
354354
"Runnable": "classes/_langchain_core.runnables.Runnable.html",
355+
"RunnableConfig": "interfaces/_langchain_core.runnables.RunnableConfig.html",
355356
"Retrievers": "interfaces/_langchain_core.retrievers.BaseRetriever.html",
356357
"VectorStore": "classes/_langchain_core.vectorstores.VectorStore.html",
357358
"VectorStore.maxMarginalRelevanceSearch": "classes/_langchain_core.vectorstores.VectorStore.html#maxMarginalRelevanceSearch",
@@ -376,7 +377,9 @@ class LinkMap(TypedDict):
376377
"BaseCheckpointSaver": "classes/_langchain_langgraph-checkpoint.BaseCheckpointSaver.html",
377378
"BaseStore": "classes/_langchain_langgraph-checkpoint.BaseStore.html",
378379
"BaseStore.put": "classes/_langchain_langgraph-checkpoint.BaseStore.html#put",
380+
"InMemorySaver": "classes/_langchain_langgraph-checkpoint.MemorySaver.html",
379381
"MemorySaver": "classes/_langchain_langgraph-checkpoint.MemorySaver.html",
382+
"AsyncPostgresSaver": "classes/_langchain_langgraph-checkpoint-postgres.AsyncPostgresSaver.html",
380383
"PostgresSaver": "classes/_langchain_langgraph-checkpoint-postgres.index.PostgresSaver.html",
381384
"protocol": "interfaces/_langchain_langgraph-checkpoint.SerializerProtocol.html",
382385
"SerializerProtocol": "interfaces/_langchain_langgraph-checkpoint.SerializerProtocol.html",
@@ -390,24 +393,22 @@ class LinkMap(TypedDict):
390393
"addEdge": "classes/_langchain_langgraph.index.StateGraph.html#addEdge",
391394
"add_node": "classes/_langchain_langgraph.index.StateGraph.html#addNode",
392395
"add_messages": "functions/_langchain_langgraph.index.messagesStateReducer.html",
396+
"LastValue": "classes/_langchain_langgraph.channels.LastValue.html",
397+
"Topic": "classes/_langchain_langgraph.channels.Topic.html",
393398
"BinaryOperatorAggregate": "classes/_langchain_langgraph.index.BinaryOperatorAggregate.html",
394399
"Command": "classes/_langchain_langgraph.index.Command.html",
395400
"CompiledStateGraph": "classes/_langchain_langgraph.index.CompiledStateGraph.html",
396-
"create_agent": "functions/langchain.index.createAgent.html",
397-
"create_react_agent": "functions/_langchain_langgraph.prebuilt.createReactAgent.html",
398-
"create_supervisor": "functions/_langchain_langgraph-supervisor.createSupervisor.html",
401+
"createAgent": "functions/langchain.index.createAgent.html",
402+
"createReactAgent": "functions/_langchain_langgraph.prebuilt.createReactAgent.html",
403+
"createSupervisor": "functions/_langchain_langgraph-supervisor.createSupervisor.html",
399404
"entrypoint": "functions/_langchain_langgraph.index.entrypoint.html",
400405
"entrypoint.final": "functions/_langchain_langgraph.index.entrypoint.html#final",
401406
"get_state_history": "classes/_langchain_langgraph.pregel.Pregel.html#getStateHistory",
402407
"getStateHistory": "classes/_langchain_langgraph.pregel.Pregel.html#getStateHistory",
403408
"HumanInterrupt": "interfaces/_langchain_langgraph.prebuilt.HumanInterrupt.html",
404409
"interrupt": "functions/_langchain_langgraph.index.interrupt.html",
405-
"InMemorySaver": "classes/_langchain_langgraph-checkpoint.MemorySaver.html",
406-
"AsyncPostgresSaver": "classes/_langchain_langgraph-checkpoint-postgres.index.PostgresSaver.html",
407410
"CompiledStateGraph.invoke": "classes/_langchain_langgraph.index.CompiledStateGraph.html#invoke",
408411
"langgraph.json": "cloud/reference/cli/#configuration-file",
409-
"LastValue": "classes/_langchain_langgraph.channels.LastValue.html",
410-
"Topic": "classes/_langchain_langgraph.channels.Topic.html",
411412
"messagesStateReducer": "functions/_langchain_langgraph.index.messagesStateReducer.html",
412413
"Pregel": "classes/_langchain_langgraph.pregel.Pregel.html",
413414
"Pregel.stream": "classes/_langchain_langgraph.pregel.Pregel.html#stream",
@@ -435,6 +436,7 @@ class LinkMap(TypedDict):
435436
"ContextEdit": "interfaces/langchain.index.ContextEdit.html",
436437
"toolRetryMiddleware": "functions/langchain.index.toolRetryMiddleware.html",
437438
"modelRetryMiddleware": "functions/langchain.index.modelRetryMiddleware.html",
439+
"systemPrompt": "types/langchain.index.CreateAgentParams.html#systemprompt",
438440
},
439441
},
440442
]

src/docs.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,10 @@
146146
"pages": [
147147
"oss/python/langchain/overview",
148148
{
149-
"group": "LangChain v1.0",
149+
"group": "Releases",
150150
"pages": [
151151
"oss/python/releases/langchain-v1",
152+
"oss/python/releases/changelog",
152153
"oss/python/migrate/langchain-v1"
153154
]
154155
},
@@ -417,6 +418,7 @@
417418
{
418419
"group": "Releases",
419420
"pages": [
421+
"oss/python/releases/changelog",
420422
"oss/python/releases/langchain-v1"
421423
]
422424
},
@@ -487,9 +489,10 @@
487489
"pages": [
488490
"oss/javascript/langchain/overview",
489491
{
490-
"group": "LangChain v1.0",
492+
"group": "Releases",
491493
"pages": [
492494
"oss/javascript/releases/langchain-v1",
495+
"oss/javascript/releases/changelog",
493496
"oss/javascript/migrate/langchain-v1"
494497
]
495498
},
@@ -792,6 +795,7 @@
792795
{
793796
"group": "Releases",
794797
"pages": [
798+
"oss/javascript/releases/changelog",
795799
"oss/javascript/releases/langchain-v1"
796800
]
797801
},

src/langsmith/rate-limiting.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def evaluator(inputs: dict, outputs: dict, reference_outputs: dict) -> dict:
3030
...
3131
```
3232

33-
See the [`langchain`](oss/langchain/models#rate-limiting) documentation for more on how to configure rate limiters.
33+
See the [`langchain`](/oss/langchain/models#rate-limiting) documentation for more on how to configure rate limiters.
3434

3535
## Retrying with exponential backoff
3636

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: Changelog
3+
sidebarTitle: Changelog
4+
rss: true
5+
---
6+
7+
A chronological log of updates and improvements to LangChain JavaScript.
8+
9+
<Update label="v1.1" description="November 25, 2025">
10+
11+
* [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.
12+
* [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.
13+
* [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.
14+
* [Summarization middleware](/oss/langchain/middleware/built-in#summarization): Updated to support flexible trigger points using model profiles for context-aware summarization.
15+
* [Structured output](/oss/langchain/structured-output): `ProviderStrategy` support (native structured output) can now be inferred from model profiles.
16+
* [`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.
17+
* [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.
18+
* **Compatibility improvements:** Fixed error handling for Zod v4 validation errors in structured output and tool schemas, ensuring detailed error messages are properly displayed.
19+
20+
</Update>
21+
22+
## Resources
23+
24+
- [V1 Migration guide](/oss/migrate/langchain-v1) - How to migrate to LangChain v1
25+
- [V1 Release notes](/oss/releases/langchain-v1) - Detailed release notes
26+
- [Release policy](/oss/release-policy) - Detailed release policies
27+
- [Versioning](/oss/versioning) - Understanding version numbers
28+
- [Report issues on GitHub](https://github.com/langchain-ai/langchainjs/issues)
29+

src/oss/javascript/releases/langchain-v1.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: What's new in v1
3-
sidebarTitle: Release notes
3+
sidebarTitle: V1 Release Notes
44
---
55

66
**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
310310
<Card title="LangChain 1.0" icon="rocket" href="https://blog.langchain.com/langchain-langchain-1-0-alpha-releases/">
311311
Read the announcement
312312
</Card>
313-
<Card title="Middleware Guide" icon="puzzle-piece" href="https://blog.langchain.com/agent-middleware/">
313+
<Card title="Middleware guide" icon="puzzle-piece" href="https://blog.langchain.com/agent-middleware/">
314314
Deep dive into middleware
315315
</Card>
316316
<Card title="Agents Documentation" icon="book" href="/oss/langchain/agents" arrow>

src/oss/langchain/middleware/custom.mdx

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,201 @@ const agent = createAgent({
919919

920920
:::
921921

922+
### Working with system messages
923+
924+
:::python
925+
926+
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`).
927+
928+
**Example: Adding context to system message**
929+
930+
<Tabs>
931+
<Tab title="Decorator">
932+
933+
```python
934+
from langchain.agents.middleware import wrap_model_call, ModelRequest, ModelResponse
935+
from langchain.messages import SystemMessage
936+
from typing import Callable
937+
938+
939+
@wrap_model_call
940+
def add_context(
941+
request: ModelRequest,
942+
handler: Callable[[ModelRequest], ModelResponse],
943+
) -> ModelResponse:
944+
# Always work with content blocks
945+
new_content = list(request.system_message.content_blocks) + [
946+
{"type": "text", "text": "Additional context."}
947+
]
948+
new_system_message = SystemMessage(content=new_content)
949+
return handler(request.override(system_message=new_system_message))
950+
```
951+
952+
</Tab>
953+
954+
<Tab title="Class">
955+
956+
```python
957+
from langchain.agents.middleware import AgentMiddleware, ModelRequest, ModelResponse
958+
from langchain.messages import SystemMessage
959+
from typing import Callable
960+
961+
962+
class ContextMiddleware(AgentMiddleware):
963+
def wrap_model_call(
964+
self,
965+
request: ModelRequest,
966+
handler: Callable[[ModelRequest], ModelResponse],
967+
) -> ModelResponse:
968+
# Always work with content blocks
969+
new_content = list(request.system_message.content_blocks) + [
970+
{"type": "text", "text": "Additional context."}
971+
]
972+
new_system_message = SystemMessage(content=new_content)
973+
return handler(request.override(system_message=new_system_message))
974+
```
975+
976+
</Tab>
977+
</Tabs>
978+
979+
**Example: Working with cache control (Anthropic)**
980+
981+
When working with Anthropic models, you can use structured content blocks with cache control directives to cache large system prompts:
982+
983+
<Tabs>
984+
<Tab title="Decorator">
985+
986+
```python
987+
from langchain.agents.middleware import wrap_model_call, ModelRequest, ModelResponse
988+
from langchain.messages import SystemMessage
989+
from typing import Callable
990+
991+
992+
@wrap_model_call
993+
def add_cached_context(
994+
request: ModelRequest,
995+
handler: Callable[[ModelRequest], ModelResponse],
996+
) -> ModelResponse:
997+
# Always work with content blocks
998+
new_content = list(request.system_message.content_blocks) + [
999+
{
1000+
"type": "text",
1001+
"text": "Here is a large document to analyze:\n\n<document>...</document>",
1002+
# content up until this point is cached
1003+
"cache_control": {"type": "ephemeral"}
1004+
}
1005+
]
1006+
1007+
new_system_message = SystemMessage(content=new_content)
1008+
return handler(request.override(system_message=new_system_message))
1009+
```
1010+
1011+
</Tab>
1012+
1013+
<Tab title="Class">
1014+
1015+
```python
1016+
from langchain.agents.middleware import AgentMiddleware, ModelRequest, ModelResponse
1017+
from langchain.messages import SystemMessage
1018+
from typing import Callable
1019+
1020+
1021+
class CachedContextMiddleware(AgentMiddleware):
1022+
def wrap_model_call(
1023+
self,
1024+
request: ModelRequest,
1025+
handler: Callable[[ModelRequest], ModelResponse],
1026+
) -> ModelResponse:
1027+
# Always work with content blocks
1028+
new_content = list(request.system_message.content_blocks) + [
1029+
{
1030+
"type": "text",
1031+
"text": "Here is a large document to analyze:\n\n<document>...</document>",
1032+
"cache_control": {"type": "ephemeral"} # This content will be cached
1033+
}
1034+
]
1035+
1036+
new_system_message = SystemMessage(content=new_content)
1037+
return handler(request.override(system_message=new_system_message))
1038+
```
1039+
1040+
</Tab>
1041+
</Tabs>
1042+
1043+
**Notes:**
1044+
- `ModelRequest.system_message` is always a @[`SystemMessage`] object, even if the agent was created with `system_prompt="string"`
1045+
- Use `SystemMessage.content_blocks` to access content as a list of blocks, regardless of whether the original content was a string or list
1046+
- When modifying system messages, use `content_blocks` and append new blocks to preserve existing structure
1047+
- You can pass @[`SystemMessage`] objects directly to `create_agent`'s `system_prompt` parameter for advanced use cases like cache control
1048+
1049+
:::
1050+
1051+
:::js
1052+
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`]).
1053+
1054+
**Example: Chaining middleware** - Different middleware can use different approaches:
1055+
1056+
```typescript
1057+
import { createMiddleware, SystemMessage, createAgent } from "langchain";
1058+
1059+
// Middleware 1: Uses systemMessage with simple concatenation
1060+
const myMiddleware = createMiddleware({
1061+
name: "MyMiddleware",
1062+
wrapModelCall: async (request, handler) => {
1063+
return handler({
1064+
...request,
1065+
systemMessage: request.systemMessage.concat(`Additional context.`),
1066+
});
1067+
},
1068+
});
1069+
1070+
// Middleware 2: Uses systemMessage with structured content (preserves structure)
1071+
const myOtherMiddleware = createMiddleware({
1072+
name: "MyOtherMiddleware",
1073+
wrapModelCall: async (request, handler) => {
1074+
return handler({
1075+
...request,
1076+
systemMessage: request.systemMessage.concat(
1077+
new SystemMessage({
1078+
content: [
1079+
{
1080+
type: "text",
1081+
text: " More additional context. This will be cached.",
1082+
cache_control: { type: "ephemeral", ttl: "5m" },
1083+
},
1084+
],
1085+
})
1086+
),
1087+
});
1088+
},
1089+
});
1090+
1091+
const agent = createAgent({
1092+
model: "anthropic:claude-3-5-sonnet",
1093+
systemPrompt: "You are a helpful assistant.",
1094+
middleware: [myMiddleware, myOtherMiddleware],
1095+
});
1096+
```
1097+
1098+
The resulting system message will be:
1099+
```typescript
1100+
new SystemMessage({
1101+
content: [
1102+
{ type: "text", text: "You are a helpful assistant." },
1103+
{ type: "text", text: "Additional context." },
1104+
{
1105+
type: "text",
1106+
text: " More additional context. This will be cached.",
1107+
cache_control: { type: "ephemeral", ttl: "5m" },
1108+
},
1109+
],
1110+
});
1111+
```
1112+
1113+
Use @[`SystemMessage.concat`] to preserve cache control metadata or structured content blocks created by other middleware.
1114+
1115+
:::
1116+
9221117
## Additional resources
9231118

9241119
- [Middleware API reference](https://reference.langchain.com/python/langchain/middleware/)

0 commit comments

Comments
 (0)