[PR #231] [CLOSED] Feature: Add Document Retrieval with Metadata Filtering #253

Closed
opened 2026-02-16 05:17:07 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langchain-postgres/pull/231
Author: @cedrickrusche
Created: 7/2/2025
Status: Closed

Base: mainHead: feature/search_by_metadata


📝 Commits (5)

  • 1b0c89d Implement get through filter
  • 99d1440 Implement synchronous get with pydoc and test cases
  • a986493 Implement missing async implementation into sync vector store
  • b0ce110 Merge branch 'main' into feature/search_by_metadata
  • 7e4ba91 Merge branch 'main' into feature/search_by_metadata

📊 Changes

4 files changed (+181 additions, -0 deletions)

View changed files

📝 langchain_postgres/v2/async_vectorstore.py (+120 -0)
📝 langchain_postgres/v2/vectorstores.py (+34 -0)
📝 tests/unit_tests/v2/test_async_pg_vectorstore_search.py (+13 -0)
📝 tests/unit_tests/v2/test_pg_vectorstore_search.py (+14 -0)

📄 Description

This pull request introduces the methods get and aget like in ChromaDB to retrieve data by metadata.

🔧 Changes

  • Asynchronous Document Retrieval: Implemented the aget method to asynchronously retrieve documents based on optional filters and parameters.
  • Synchronous Document Retrieval: Added the get method for synchronous document retrieval, leveraging the asynchronous aget method.
  • Metadata Filtering: Created the __query_collection_with_filter method to support filtering conditions in the SQL WHERE clause without similarity function
  • Test Cases: Added unit tests for both asynchronous and synchronous document retrieval methods to ensure functionality and reliability.

📈 Impact

These changes let us retrieve the current content to get insights about the data in the database e.g. to find outdated content.


🔄 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/231 **Author:** [@cedrickrusche](https://github.com/cedrickrusche) **Created:** 7/2/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feature/search_by_metadata` --- ### 📝 Commits (5) - [`1b0c89d`](https://github.com/langchain-ai/langchain-postgres/commit/1b0c89d2f9c9e16d4866176c031f769178f8ebdd) Implement get through filter - [`99d1440`](https://github.com/langchain-ai/langchain-postgres/commit/99d1440e6989b257361314c5e2e5a3db19d74d0c) Implement synchronous get with pydoc and test cases - [`a986493`](https://github.com/langchain-ai/langchain-postgres/commit/a9864930f3e873951c1157b47aadd37851b9ff80) Implement missing async implementation into sync vector store - [`b0ce110`](https://github.com/langchain-ai/langchain-postgres/commit/b0ce110252de1ab2765083f1b8f017701172b573) Merge branch 'main' into feature/search_by_metadata - [`7e4ba91`](https://github.com/langchain-ai/langchain-postgres/commit/7e4ba91c089e6b9b2cfd01c4d99c69d8b406bb7d) Merge branch 'main' into feature/search_by_metadata ### 📊 Changes **4 files changed** (+181 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `langchain_postgres/v2/async_vectorstore.py` (+120 -0) 📝 `langchain_postgres/v2/vectorstores.py` (+34 -0) 📝 `tests/unit_tests/v2/test_async_pg_vectorstore_search.py` (+13 -0) 📝 `tests/unit_tests/v2/test_pg_vectorstore_search.py` (+14 -0) </details> ### 📄 Description This pull request introduces the methods get and aget like in ChromaDB to retrieve data by metadata. ### 🔧 Changes - **Asynchronous Document Retrieval**: Implemented the `aget` method to asynchronously retrieve documents based on optional filters and parameters. - **Synchronous Document Retrieval**: Added the `get` method for synchronous document retrieval, leveraging the asynchronous `aget` method. - **Metadata Filtering**: Created the `__query_collection_with_filter` method to support filtering conditions in the SQL WHERE clause without similarity function - **Test Cases**: Added unit tests for both asynchronous and synchronous document retrieval methods to ensure functionality and reliability. ### 📈 Impact These changes let us retrieve the current content to get insights about the data in the database e.g. to find outdated content. --- <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:17:07 -05:00
yindo closed this issue 2026-02-16 05:17:07 -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#253