[PR #2397] [MERGED] feat(oss/langchain): Update LangChain JS docs to use StateSchema class #2395

Closed
opened 2026-02-17 17:23:22 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/2397
Author: @maahir30
Created: 1/28/2026
Status: Merged
Merged: 2/2/2026
Merged by: @maahir30

Base: mainHead: state-schema-langchain


📝 Commits (4)

  • 0ea0323 Update state to use StateSchema
  • 35fc0cc Fix zod/typing
  • 02cb16a update typing
  • 4515a33 Merge branch 'main' into state-schema-langchain

📊 Changes

10 files changed (+128 additions, -118 deletions)

View changed files

📝 src/oss/langchain/middleware/custom.mdx (+18 -10)
📝 src/oss/langchain/multi-agent/custom-workflow.mdx (+6 -4)
📝 src/oss/langchain/multi-agent/handoffs-customer-support.mdx (+12 -12)
📝 src/oss/langchain/multi-agent/handoffs.mdx (+27 -27)
📝 src/oss/langchain/multi-agent/router-knowledge-base.mdx (+18 -23)
📝 src/oss/langchain/multi-agent/skills-sql-assistant.mdx (+5 -4)
📝 src/oss/langchain/rag.mdx (+6 -5)
📝 src/oss/langchain/short-term-memory.mdx (+14 -13)
📝 src/oss/langchain/streaming/frontend.mdx (+20 -18)
📝 src/oss/langgraph/graph-api.mdx (+2 -2)

📄 Description

Updates JavaScript/TypeScript code examples across LangChain docs to use the new StateSchema class pattern instead of plain Zod objects for state definitions.

Changes:

  • Replace z.object({...}) with new StateSchema({...}) for state schemas
  • Use MessagesValue instead of MessagesZodState/MessagesZodSchema
  • Use ReducedValue for custom reducers
  • Update type annotations: z.infer<typeof X>typeof X.State
  • Update imports to use zod/v4
  • Fix typeof usage in graph-api.mdx type extraction examples

Files updated: middleware/custom.mdx, short-term-memory.mdx, agents.mdx, handoffs.mdx, handoffs-customer-support.mdx, custom-workflow.mdx, router-knowledge-base.mdx, skills-sql-assistant.mdx, streaming/frontend.mdx, rag.mdx, graph-api.mdx


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/docs/pull/2397 **Author:** [@maahir30](https://github.com/maahir30) **Created:** 1/28/2026 **Status:** ✅ Merged **Merged:** 2/2/2026 **Merged by:** [@maahir30](https://github.com/maahir30) **Base:** `main` ← **Head:** `state-schema-langchain` --- ### 📝 Commits (4) - [`0ea0323`](https://github.com/langchain-ai/docs/commit/0ea0323fd527ced6b3365fa5298c7635b5d302e3) Update state to use StateSchema - [`35fc0cc`](https://github.com/langchain-ai/docs/commit/35fc0cc8716604d8b6166808e53796ad3ee67cee) Fix zod/typing - [`02cb16a`](https://github.com/langchain-ai/docs/commit/02cb16a0256dc1e4f30ed5e424d256eb7ff7c366) update typing - [`4515a33`](https://github.com/langchain-ai/docs/commit/4515a33a2644ed35d3b8e6b074404d14cdd7ec85) Merge branch 'main' into state-schema-langchain ### 📊 Changes **10 files changed** (+128 additions, -118 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/langchain/middleware/custom.mdx` (+18 -10) 📝 `src/oss/langchain/multi-agent/custom-workflow.mdx` (+6 -4) 📝 `src/oss/langchain/multi-agent/handoffs-customer-support.mdx` (+12 -12) 📝 `src/oss/langchain/multi-agent/handoffs.mdx` (+27 -27) 📝 `src/oss/langchain/multi-agent/router-knowledge-base.mdx` (+18 -23) 📝 `src/oss/langchain/multi-agent/skills-sql-assistant.mdx` (+5 -4) 📝 `src/oss/langchain/rag.mdx` (+6 -5) 📝 `src/oss/langchain/short-term-memory.mdx` (+14 -13) 📝 `src/oss/langchain/streaming/frontend.mdx` (+20 -18) 📝 `src/oss/langgraph/graph-api.mdx` (+2 -2) </details> ### 📄 Description Updates JavaScript/TypeScript code examples across LangChain docs to use the new `StateSchema` class pattern instead of plain Zod objects for state definitions. **Changes:** - Replace `z.object({...})` with `new StateSchema({...})` for state schemas - Use `MessagesValue` instead of `MessagesZodState`/`MessagesZodSchema` - Use `ReducedValue` for custom reducers - Update type annotations: `z.infer<typeof X>` → `typeof X.State` - Update imports to use `zod/v4` - Fix `typeof` usage in graph-api.mdx type extraction examples **Files updated:** middleware/custom.mdx, short-term-memory.mdx, agents.mdx, handoffs.mdx, handoffs-customer-support.mdx, custom-workflow.mdx, router-knowledge-base.mdx, skills-sql-assistant.mdx, streaming/frontend.mdx, rag.mdx, graph-api.mdx --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-17 17:23:22 -05:00
yindo closed this issue 2026-02-17 17:23:22 -05:00
yindo changed title from [PR #2397] feat(oss/langchain): Update LangChain JS docs to use StateSchema class to [PR #2397] [MERGED] feat(oss/langchain): Update LangChain JS docs to use StateSchema class 2026-06-05 18:18:22 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#2395