[PR #1242] [CLOSED] feat(checkpoint-postgres): Add PostgresStore for LangGraph.js #1322

Closed
opened 2026-02-15 20:15:16 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraphjs/pull/1242
Author: @abogacki
Created: 5/30/2025
Status: Closed

Base: 0.4Head: langgraph-postgres-store


📝 Commits (10+)

  • 9ac4383 feat(langgraph): remove Checkpoint.pending_sends (#1307)
  • 6332b38 feat(checkpoint): add deleteThread method (#1327)
  • 8e8524d Create new lib for postgres store
  • 9c44a26 init lock
  • 9a57b3d Add postgres store
  • f727d2c Add simple search with differentiation between vector and full text search
  • 3d246ce Remove redundant file
  • 88eac5b Modularize PostgresStore class
  • f05b993 Remove examples
  • 990d80e Adjust formatting

📊 Changes

84 files changed (+5125 additions, -2345 deletions)

View changed files

.changeset/bright-pianos-sniff.md (+8 -0)
.changeset/brown-ears-shop.md (+5 -0)
.changeset/curly-onions-mix.md (+5 -0)
.changeset/deep-islands-tell.md (+5 -0)
.changeset/fresh-geckos-matter.md (+5 -0)
.changeset/moody-shrimps-visit.md (+5 -0)
.changeset/nine-plums-teach.md (+5 -0)
.changeset/spicy-kids-make.md (+5 -0)
.changeset/two-toes-chew.md (+5 -0)
📝 int-test-deps-docker-compose.yml (+1 -1)
libs/checkpoint-mongodb/docker-compose.yml (+12 -0)
📝 libs/checkpoint-mongodb/src/index.ts (+15 -14)
📝 libs/checkpoint-mongodb/src/tests/checkpoints.int.test.ts (+34 -10)
📝 libs/checkpoint-postgres/.env.example (+7 -1)
📝 libs/checkpoint-postgres/.gitignore (+4 -0)
📝 libs/checkpoint-postgres/docker-compose.yml (+1 -1)
📝 libs/checkpoint-postgres/langchain.config.js (+2 -1)
📝 libs/checkpoint-postgres/package.json (+14 -1)
📝 libs/checkpoint-postgres/src/index.ts (+115 -25)
📝 libs/checkpoint-postgres/src/sql.ts (+44 -10)

...and 64 more files

📄 Description

Implement PostgreSQL Store with Vector Search Capabilities

Overview

This PR implements a PostgreSQL-based store for LangGraph.js inspired by https://github.com/langchain-ai/langgraphjs/pull/887 and Python implementation. The implementation includes comprehensive vector similarity search, hybrid search (combining vector and text search), and TTL management for automatic data expiration.

Key Features

  • Modular architecture with specialized components for different responsibilities
  • Vector similarity search with support for multiple distance metrics (cosine, L2, inner product)
  • Hybrid search combining vector similarity and full-text search
  • Advanced filtering with rich query operators ($eq, $gt, $lt, $in, etc.)
  • Automatic TTL management with configurable expiration settings
  • Support for PostgreSQL's pgvector extension for efficient vector operations

Implementation Details

  • Split the monolithic implementation into specialized modules:
    • database-core.js: Core connection and transaction management
    • database-setup.js: Schema initialization and migration
    • crud-operations.js: Basic CRUD operations
    • search-operations.js: Advanced search capabilities
    • vector-operations.js: Vector embedding and similarity calculations
    • ttl-manager.js: Expiration and cleanup management
    • query-builder.js: SQL query construction
  • Added comprehensive TypeScript types for better developer experience
  • Implemented efficient text extraction from JSON documents using configurable field paths
  • Added extensive test coverage for all features

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/langgraphjs/pull/1242 **Author:** [@abogacki](https://github.com/abogacki) **Created:** 5/30/2025 **Status:** ❌ Closed **Base:** `0.4` ← **Head:** `langgraph-postgres-store` --- ### 📝 Commits (10+) - [`9ac4383`](https://github.com/langchain-ai/langgraphjs/commit/9ac4383da8697d60dc8e1f51d2438ad05bd49355) feat(langgraph): remove Checkpoint.pending_sends (#1307) - [`6332b38`](https://github.com/langchain-ai/langgraphjs/commit/6332b38650267e60b0de401be4aebcede1e40052) feat(checkpoint): add deleteThread method (#1327) - [`8e8524d`](https://github.com/langchain-ai/langgraphjs/commit/8e8524df1f8ebab758c553c3990fba13b04b2856) Create new lib for postgres store - [`9c44a26`](https://github.com/langchain-ai/langgraphjs/commit/9c44a26356149f0b3b3c7bf73178c80b3838d800) init lock - [`9a57b3d`](https://github.com/langchain-ai/langgraphjs/commit/9a57b3d5b38738d774fc62433b6852ab9aff2816) Add postgres store - [`f727d2c`](https://github.com/langchain-ai/langgraphjs/commit/f727d2c1a455d89e2821a30cb3e34076b222be54) Add simple search with differentiation between vector and full text search - [`3d246ce`](https://github.com/langchain-ai/langgraphjs/commit/3d246cee0d2415d1de030544ee60bd6843e40fcf) Remove redundant file - [`88eac5b`](https://github.com/langchain-ai/langgraphjs/commit/88eac5b5444f26cce81c95770b92f406190841dc) Modularize PostgresStore class - [`f05b993`](https://github.com/langchain-ai/langgraphjs/commit/f05b993ec5755f04ba30c77acf69c8f486470870) Remove examples - [`990d80e`](https://github.com/langchain-ai/langgraphjs/commit/990d80ed60391f3bda3a81ea114a933915a714f3) Adjust formatting ### 📊 Changes **84 files changed** (+5125 additions, -2345 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/bright-pianos-sniff.md` (+8 -0) ➕ `.changeset/brown-ears-shop.md` (+5 -0) ➕ `.changeset/curly-onions-mix.md` (+5 -0) ➕ `.changeset/deep-islands-tell.md` (+5 -0) ➕ `.changeset/fresh-geckos-matter.md` (+5 -0) ➕ `.changeset/moody-shrimps-visit.md` (+5 -0) ➕ `.changeset/nine-plums-teach.md` (+5 -0) ➕ `.changeset/spicy-kids-make.md` (+5 -0) ➕ `.changeset/two-toes-chew.md` (+5 -0) 📝 `int-test-deps-docker-compose.yml` (+1 -1) ➕ `libs/checkpoint-mongodb/docker-compose.yml` (+12 -0) 📝 `libs/checkpoint-mongodb/src/index.ts` (+15 -14) 📝 `libs/checkpoint-mongodb/src/tests/checkpoints.int.test.ts` (+34 -10) 📝 `libs/checkpoint-postgres/.env.example` (+7 -1) 📝 `libs/checkpoint-postgres/.gitignore` (+4 -0) 📝 `libs/checkpoint-postgres/docker-compose.yml` (+1 -1) 📝 `libs/checkpoint-postgres/langchain.config.js` (+2 -1) 📝 `libs/checkpoint-postgres/package.json` (+14 -1) 📝 `libs/checkpoint-postgres/src/index.ts` (+115 -25) 📝 `libs/checkpoint-postgres/src/sql.ts` (+44 -10) _...and 64 more files_ </details> ### 📄 Description # Implement PostgreSQL Store with Vector Search Capabilities ## Overview This PR implements a PostgreSQL-based store for LangGraph.js inspired by https://github.com/langchain-ai/langgraphjs/pull/887 and [Python implementation](https://github.com/langchain-ai/langgraph/tree/main/libs/checkpoint-postgres/langgraph/store/postgres). The implementation includes comprehensive vector similarity search, hybrid search (combining vector and text search), and TTL management for automatic data expiration. ## Key Features - Modular architecture with specialized components for different responsibilities - Vector similarity search with support for multiple distance metrics (cosine, L2, inner product) - Hybrid search combining vector similarity and full-text search - Advanced filtering with rich query operators ($eq, $gt, $lt, $in, etc.) - Automatic TTL management with configurable expiration settings - Support for PostgreSQL's pgvector extension for efficient vector operations ## Implementation Details - Split the monolithic implementation into specialized modules: - `database-core.js`: Core connection and transaction management - `database-setup.js`: Schema initialization and migration - `crud-operations.js`: Basic CRUD operations - `search-operations.js`: Advanced search capabilities - `vector-operations.js`: Vector embedding and similarity calculations - `ttl-manager.js`: Expiration and cleanup management - `query-builder.js`: SQL query construction - Added comprehensive TypeScript types for better developer experience - Implemented efficient text extraction from JSON documents using configurable field paths - Added extensive test coverage for all features --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 20:15:16 -05:00
yindo closed this issue 2026-02-15 20:15:16 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#1322