LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
  • Stream
LangGraph SDK
  • Ui
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Utils
  • Server
  • Stream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
  • Store
LangGraph Checkpoint Redis
  • Shallow
  • Store
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
  • Cli
LangGraph API
LangGraph CLI
LangGraph CUA
  • Utils
LangGraph Supervisor
LangGraph Swarm
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangGraph
WebChannelsPregelPrebuiltRemoteStream
LangGraph SDK
UiClientAuthReactLoggingReact UiUtilsServerStream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
Store
LangGraph Checkpoint Redis
ShallowStore
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
Cli
LangGraph API
LangGraph CLI
LangGraph CUA
Utils
LangGraph Supervisor
LangGraph Swarm
Language
Theme
JavaScript@langchain/langgraph-sdkstreamSubgraphDiscovery
Classā—Since v1.9

SubgraphDiscovery

Copy
class SubgraphDiscovery

Constructors

Properties

Methods

View source on GitHub
constructor
constructor
property
byNodeStore: StreamStore<SubgraphByNodeMap>
property
store: StreamStore<SubgraphMap>
property
byNodeSnapshot: SubgraphByNodeMap
property
snapshot: SubagentMap
method
push
method
reset
method
seedFromHistory

The client for interacting with the KV store.

Drop all discovery state. Called on thread rebind / dispose so a new thread's subagents cannot bleed into the previous UI.

Seed subgraph hosts from checkpoint history (see namespace-from-history.collectSubgraphHostNamespaces) so subgraph cards render on thread refresh without waiting for the depth-1 SSE replay. Supplies the host/promotion decision from history instead of the live strict-prefix heuristic, then reuses the same #ensureShadow / #promoted / #commit path. Idempotent: never downgrades an entry that already reached a terminal state.