LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
LangGraph SDK
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Server
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
WebChannelsPregelPrebuiltRemote
LangGraph SDK
ClientAuthReactLoggingReact UiServer
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-checkpoint-postgresstorePostgresStore
Class●Since v0.0

PostgresStore

Copy
class PostgresStore

Bases

BaseStore

Used in Docs

  • Long-term memory
  • Memory

Constructors

Methods

Inherited fromBaseStore(langchain_core)

Methods

MmgetMamgetMmsetMamsetMmdelete
View source on GitHub
Mamdelete
Myield_keys
Mayield_keys
constructor
constructor
method
batch→ Promise<OperationResults<Op>>
method
delete→ Promise<void>
method
get→ Promise<Checkpoint<string, string> | undefined>
method
getStats→ Promise<__type>
method
hybridSearch
method
listNamespaces→ Promise<string[][]>
method
put→ Promise<RunnableConfig<Record<string, any>>>
method
search→ Promise<SearchItem[]>
method
setup→ Promise<void>
method
start→ Promise<void>
method
stop→ Promise<void>
method
sweepExpiredItems→ Promise<number>
method
vectorSearch
method
fromConnString→ PostgresSaver

PostgreSQL implementation of the BaseStore interface. This is now a lightweight orchestrator that delegates to specialized modules.

Execute multiple operations in a single batch.

Delete an item by namespace and key.

Get statistics about the store.

List namespaces with optional filtering.

Save a checkpoint to the database.

This method saves a checkpoint to the Postgres database. The checkpoint is associated with the provided config and its parent config (if any).

Search for items in the store with support for text search, vector search, and filtering.

Set up the checkpoint database asynchronously.

This method creates the necessary tables in the Postgres database if they don't already exist and runs database migrations. It MUST be called directly by the user the first time checkpointer is used.

Start the store. Calls setup() if ensureTables is true.

Stop the store and close all database connections.

Manually sweep expired items from the store.

Creates a new instance of PostgresSaver from a connection string.