[PR #85] feat: add hnsw index functionality to PGVector #158

Open
opened 2026-02-16 05:16:47 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langchain-postgres/pull/85
Author: @wulifu2hao
Created: 7/6/2024
Status: 🔄 Open

Base: mainHead: add_hnsw


📝 Commits (2)

  • d4608c9 feat: add hnsw index functionality to PGVector
  • b46576b add raise exception in create_hnsw_index

📊 Changes

2 files changed (+265 additions, -8 deletions)

View changed files

📝 langchain_postgres/vectorstores.py (+193 -8)
📝 tests/unit_tests/test_vectorstore.py (+72 -0)

📄 Description

issue: https://github.com/langchain-ai/langchain/issues/23853

description: unlike the PGEmbedding class (which uses "pg_embedding" extension) , the PGVector class (which uses "pg_vector" extension) currently doesn't support HNSW index. Since the pg_embedding project is deprecated since 2023 https://github.com/neondatabase/pg_embedding and it is encouraged to move to pg_vector, I added the HNSW support in the PGVector class


🔄 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/langchain-postgres/pull/85 **Author:** [@wulifu2hao](https://github.com/wulifu2hao) **Created:** 7/6/2024 **Status:** 🔄 Open **Base:** `main` ← **Head:** `add_hnsw` --- ### 📝 Commits (2) - [`d4608c9`](https://github.com/langchain-ai/langchain-postgres/commit/d4608c9d97caaa00cd348ea061def6407342a468) feat: add hnsw index functionality to PGVector - [`b46576b`](https://github.com/langchain-ai/langchain-postgres/commit/b46576b7e0535915ad147adcd37afcd294299a0c) add raise exception in create_hnsw_index ### 📊 Changes **2 files changed** (+265 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `langchain_postgres/vectorstores.py` (+193 -8) 📝 `tests/unit_tests/test_vectorstore.py` (+72 -0) </details> ### 📄 Description issue: https://github.com/langchain-ai/langchain/issues/23853 description: unlike the PGEmbedding class (which uses "pg_embedding" extension) , the PGVector class (which uses "pg_vector" extension) currently doesn't support HNSW index. Since the pg_embedding project is deprecated since 2023 [https://github.com/neondatabase/pg_embedding](url) and it is encouraged to move to pg_vector, I added the HNSW support in the PGVector class --- <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-16 05:16:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langchain-postgres#158