LangGraph.js API Reference
    Preparing search index...

    A LangGraph checkpoint saver backed by a MongoDB database.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    checkpointCollectionName: string = "checkpoints"
    checkpointWritesCollectionName: string = "checkpoint_writes"
    client: MongoClient
    db: Db
    serde: SerializerProtocol

    Methods

    • Parameters

      • config: RunnableConfig

      Returns Promise<undefined | Checkpoint<string, string>>

    • 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.

      Parameters

      • current: undefined | number

      Returns number

    • Retrieves a checkpoint from the MongoDB database based on the provided config. If the config contains a "checkpoint_id" key, the checkpoint with the matching thread ID and checkpoint ID is retrieved. Otherwise, the latest checkpoint for the given thread ID is retrieved.

      Parameters

      • config: RunnableConfig

      Returns Promise<undefined | CheckpointTuple>

    • Retrieve a list of checkpoint tuples from the MongoDB database based on the provided config. The checkpoints are ordered by checkpoint ID in descending order (newest first).

      Parameters

      • config: RunnableConfig
      • Optionaloptions: CheckpointListOptions

      Returns AsyncGenerator<CheckpointTuple>

    • Saves intermediate writes associated with a checkpoint to the MongoDB database.

      Parameters

      • config: RunnableConfig
      • writes: PendingWrite[]
      • taskId: string

      Returns Promise<void>