[PR #2171] [MERGED] feat(oss/langgraph): StateSchema docs #2190

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/2171
Author: @hntrl
Created: 1/9/2026
Status: Merged
Merged: 1/15/2026
Merged by: @hntrl

Base: mainHead: hunter/graph-types


📝 Commits (2)

  • 2cf8eae feat(oss/langgraph): StateSchema docs
  • 4e5953e add changelog entry

📊 Changes

30 files changed (+2082 additions, -1306 deletions)

View changed files

📝 src/oss/concepts/context.mdx (+4 -8)
📝 src/oss/javascript/releases/changelog.mdx (+73 -0)
📝 src/oss/langchain/agents.mdx (+6 -7)
📝 src/oss/langchain/short-term-memory.mdx (+1 -1)
📝 src/oss/langgraph/add-memory.mdx (+79 -111)
📝 src/oss/langgraph/agentic-rag.mdx (+47 -50)
📝 src/oss/langgraph/choosing-apis.mdx (+394 -0)
📝 src/oss/langgraph/deploy.mdx (+17 -17)
📝 src/oss/langgraph/durable-execution.mdx (+11 -36)
📝 src/oss/langgraph/errors/GRAPH_RECURSION_LIMIT.mdx (+3 -3)
📝 src/oss/langgraph/errors/INVALID_CONCURRENT_GRAPH_UPDATE.mdx (+14 -13)
📝 src/oss/langgraph/errors/INVALID_GRAPH_NODE_RETURN_VALUE.mdx (+4 -4)
📝 src/oss/langgraph/functional-api.mdx (+5 -7)
📝 src/oss/langgraph/graph-api.mdx (+331 -110)
📝 src/oss/langgraph/interrupts.mdx (+154 -144)
📝 src/oss/langgraph/local-server.mdx (+14 -14)
📝 src/oss/langgraph/memory.mdx (+38 -38)
📝 src/oss/langgraph/observability.mdx (+3 -6)
📝 src/oss/langgraph/overview.mdx (+7 -3)
📝 src/oss/langgraph/persistence.mdx (+32 -77)

...and 10 more files

📄 Description

This PR migrates all JavaScript documentation from legacy state definition patterns (z.object(), Annotation.Root(), MessagesZodMeta) to the new unified StateSchema API, and updates node function typings to use State.Node or GraphNode<typeof State>.

Requisite for https://github.com/langchain-ai/langgraphjs/pull/1842 and https://github.com/langchain-ai/langgraphjs/pull/1852

Motivation

The new StateSchema API provides:

  • Unified state definition - Single API replacing multiple approaches
  • Better type inference - State.Node and GraphNode provide proper typing for node functions
  • Cleaner syntax - MessagesValue replaces verbose .register(registry, MessagesZodMeta) patterns
  • New capabilities - UntrackedValue for transient state, ConditionalEdgeRouter for typed routing

Changes

New Documentation

  • StateSchema overview and usage
  • UntrackedValue section with use cases (transient state, connections, caches)
  • Type utilities section (GraphNode, ConditionalEdgeRouter, State.Node)

Migration Patterns Applied

Before After
z.object({ ... }) new StateSchema({ ... })
Annotation.Root({ ... }) new StateSchema({ ... })
.register(registry, MessagesZodMeta) MessagesValue
.register(registry, { reducer: ... }) new ReducedValue(schema, { reducer })
state: z.infer<typeof State> typeof State.Node or GraphNode<typeof State>

Success Criteria

After this PR, the following patterns should have zero matches in :::js blocks:

  • z.object(
  • Annotation.Root or Annotation<
  • MessagesZodMeta
  • .register(registry
  • z.infer<typeof State> for node typing

🔄 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/2171 **Author:** [@hntrl](https://github.com/hntrl) **Created:** 1/9/2026 **Status:** ✅ Merged **Merged:** 1/15/2026 **Merged by:** [@hntrl](https://github.com/hntrl) **Base:** `main` ← **Head:** `hunter/graph-types` --- ### 📝 Commits (2) - [`2cf8eae`](https://github.com/langchain-ai/docs/commit/2cf8eae29297ed1ce3efb889742a2a67d257903f) feat(oss/langgraph): `StateSchema` docs - [`4e5953e`](https://github.com/langchain-ai/docs/commit/4e5953e98bbf991676097660156373cc81ceb207) add changelog entry ### 📊 Changes **30 files changed** (+2082 additions, -1306 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/concepts/context.mdx` (+4 -8) 📝 `src/oss/javascript/releases/changelog.mdx` (+73 -0) 📝 `src/oss/langchain/agents.mdx` (+6 -7) 📝 `src/oss/langchain/short-term-memory.mdx` (+1 -1) 📝 `src/oss/langgraph/add-memory.mdx` (+79 -111) 📝 `src/oss/langgraph/agentic-rag.mdx` (+47 -50) 📝 `src/oss/langgraph/choosing-apis.mdx` (+394 -0) 📝 `src/oss/langgraph/deploy.mdx` (+17 -17) 📝 `src/oss/langgraph/durable-execution.mdx` (+11 -36) 📝 `src/oss/langgraph/errors/GRAPH_RECURSION_LIMIT.mdx` (+3 -3) 📝 `src/oss/langgraph/errors/INVALID_CONCURRENT_GRAPH_UPDATE.mdx` (+14 -13) 📝 `src/oss/langgraph/errors/INVALID_GRAPH_NODE_RETURN_VALUE.mdx` (+4 -4) 📝 `src/oss/langgraph/functional-api.mdx` (+5 -7) 📝 `src/oss/langgraph/graph-api.mdx` (+331 -110) 📝 `src/oss/langgraph/interrupts.mdx` (+154 -144) 📝 `src/oss/langgraph/local-server.mdx` (+14 -14) 📝 `src/oss/langgraph/memory.mdx` (+38 -38) 📝 `src/oss/langgraph/observability.mdx` (+3 -6) 📝 `src/oss/langgraph/overview.mdx` (+7 -3) 📝 `src/oss/langgraph/persistence.mdx` (+32 -77) _...and 10 more files_ </details> ### 📄 Description This PR migrates all JavaScript documentation from legacy state definition patterns (`z.object()`, `Annotation.Root()`, `MessagesZodMeta`) to the new unified `StateSchema` API, and updates node function typings to use `State.Node` or `GraphNode<typeof State>`. Requisite for https://github.com/langchain-ai/langgraphjs/pull/1842 and https://github.com/langchain-ai/langgraphjs/pull/1852 ## Motivation The new `StateSchema` API provides: - **Unified state definition** - Single API replacing multiple approaches - **Better type inference** - `State.Node` and `GraphNode` provide proper typing for node functions - **Cleaner syntax** - `MessagesValue` replaces verbose `.register(registry, MessagesZodMeta)` patterns - **New capabilities** - `UntrackedValue` for transient state, `ConditionalEdgeRouter` for typed routing ## Changes ### New Documentation - `StateSchema` overview and usage - `UntrackedValue` section with use cases (transient state, connections, caches) - Type utilities section (`GraphNode`, `ConditionalEdgeRouter`, `State.Node`) ### Migration Patterns Applied | Before | After | |--------|-------| | `z.object({ ... })` | `new StateSchema({ ... })` | | `Annotation.Root({ ... })` | `new StateSchema({ ... })` | | `.register(registry, MessagesZodMeta)` | `MessagesValue` | | `.register(registry, { reducer: ... })` | `new ReducedValue(schema, { reducer })` | | `state: z.infer<typeof State>` | `typeof State.Node` or `GraphNode<typeof State>` | ## Success Criteria After this PR, the following patterns should have zero matches in `:::js` blocks: - `z.object(` - `Annotation.Root` or `Annotation<` - `MessagesZodMeta` - `.register(registry` - `z.infer<typeof State>` for node typing --- <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:09 -05:00
yindo closed this issue 2026-02-17 17:23:09 -05:00
yindo changed title from [PR #2171] feat(oss/langgraph): `StateSchema` docs to [PR #2171] [MERGED] feat(oss/langgraph): `StateSchema` docs 2026-06-05 18:17:10 -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#2190