LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
  • Stream
LangGraph SDK
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Server
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
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
ClientAuthReactLoggingReact UiServer
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
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/langgraphindexMemorySaver
Class●Since v1.0

MemorySaver

Copy
class MemorySaver

Bases

BaseCheckpointSaver

Used in Docs

  • Build a multi-source knowledge base with routing
  • Build a personal assistant with subagents
  • Build a SQL assistant with on-demand skills
  • Build a voice agent with LangChain
  • Build customer support with handoffs
(5 more not shown)

Constructors

constructor
constructor→ MemorySaver

Properties

property
serde: SerializerProtocol
property
storage: Record<string, Record<string, Record<string, [Uint8Array, Uint8Array, string | undefined]>>>
property
writes: Record<string, Record<string, [string, string, Uint8Array]>>

Methods

method
deleteThread→ Promise<void>

Delete all checkpoints and writes associated with a specific thread ID.

method
get→ Promise<Checkpoint<string, string> | undefined>
method
getDeltaChannelHistory→ Promise<Record<string, DeltaChannelHistory>>

Override: walk the parent chain ONCE for all requested channels using direct storage access.

Each channel terminates independently at the nearest ancestor whose stored channel_values[ch] is populated. Other channels keep walking until they find their own terminator or hit the root.

The seed value (whether a DeltaSnapshot or a plain pre-delta migration blob) is the value AT that ancestor, prior to its own pending writes that produce the child. Those on-path writes — including the ones stored on the terminating ancestor — are always collected and replayed on top of the seed, so a thread migrated from a pre-delta channel does not drop the writes saved under the migration boundary checkpoint.

method
getNextVersion→ number

Generate the next version ID for a channel.

Default is to use integer versions, incrementing by 1. If you override, you can use str/int/float versions, as long as they are monotonically increasing.

method
getTuple→ Promise<CheckpointTuple | undefined>
method
list→ AsyncGenerator<CheckpointTuple>
method
put→ Promise<RunnableConfig<Record<string, any>>>
method
putWrites→ Promise<void>

Store intermediate writes linked to a checkpoint.

method
toJSON→ string

Prevent JSON.stringify from traversing backend clients (e.g. pg Pool timers) when a checkpointer is present in runnable configurable.

Inherited fromBaseCheckpointSaver

Properties

Pserde: SerializerProtocol

Methods

MdeleteThread→ Promise<void>
—

Delete all checkpoints and writes associated with a specific thread ID.

Mget→ Promise<Checkpoint<string, string> | undefined>MgetDeltaChannelHistory→ Promise<Record<string, DeltaChannelHistory>>
—

Walk the parent chain returning per-channel writes + seed, used to

MgetNextVersion→ V
—

Generate the next version ID for a channel.

MgetTuple→ Promise<CheckpointTuple | undefined>Mlist→ AsyncGenerator<CheckpointTuple>Mput→ Promise<RunnableConfig<Record<string, any>>>MputWrites→ Promise<void>
—

Store intermediate writes linked to a checkpoint.

MtoJSON→ string
—

Prevent JSON.stringify from traversing backend clients (e.g. pg Pool

View source on GitHub