langchain.js
    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

    Methods

    • Parameters

      • threadId: string

      Returns Promise<void>

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

    • 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: any

      Returns AsyncGenerator<CheckpointTuple>

    • Saves a checkpoint to the MongoDB database. The checkpoint is associated with the provided config and its parent config (if any).

      Parameters

      • config: RunnableConfig
      • checkpoint: Checkpoint
      • metadata: CheckpointMetadata

      Returns Promise<RunnableConfig<Record<string, any>>>

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

      Parameters

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

      Returns Promise<void>