mirror of
https://github.com/langchain-ai/langchain-postgres.git
synced 2026-07-16 01:33:18 -04:00
[PR #231] [CLOSED] Feature: Add Document Retrieval with Metadata Filtering #253
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/langchain-ai/langchain-postgres/pull/231
Author: @cedrickrusche
Created: 7/2/2025
Status: ❌ Closed
Base:
main← Head:feature/search_by_metadata📝 Commits (5)
1b0c89dImplement get through filter99d1440Implement synchronous get with pydoc and test casesa986493Implement missing async implementation into sync vector storeb0ce110Merge branch 'main' into feature/search_by_metadata7e4ba91Merge 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
agetmethod to asynchronously retrieve documents based on optional filters and parameters.getmethod for synchronous document retrieval, leveraging the asynchronousagetmethod.__query_collection_with_filtermethod to support filtering conditions in the SQL WHERE clause without similarity function📈 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.