Skip to content

Conversation

cedrickrusche
Copy link

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.

@dishaprakash
Copy link
Collaborator

dishaprakash commented Aug 20, 2025

@cedrickrusche Thank you for opening this PR! I've left a couple of comments

@cedrickrusche
Copy link
Author

@dishaprakash Thank you for commenting but I can not see the comments
image

results = result_map.fetchall()
return bool(len(results) == 1)

async def aget(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a synchronous function get which returns an error, similar to these.

k: Optional[int] = None,
**kwargs: Any,
) -> list[Document]:

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a docstring to this function

@dishaprakash
Copy link
Collaborator

@cedrickrusche sorry about the confusion, is it visible now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants