Open ArtemMartus opened 4 weeks ago
If you're triggering this condition:
if type(destination).adelete == VectorStore.adelete:
# Checking if the vectorstore has overridden the default delete method
# implementation which just raises a NotImplementedError
raise ValueError("Vectorstore has not implemented the delete method")
It looks like it's b/c the underlying vecotrstore has not implemented an async delete. This is a bug/missing feature in the vectorstore not in the aindex
function
Currently, Chroma implements a synchronous delete method as shown:
class Chroma(VectorStore):
def delete(self, ids: Optional[List[str]] = None, **kwargs: Any) -> None:
"""Delete by vector IDs.
Args:
ids: List of ids to delete.
kwargs: Additional keyword arguments.
"""
self._collection.delete(ids=ids, **kwargs)
Upon closer inspection, the Chroma vector store doesn't provide any asynchronous functionality, even though its docstring suggests otherwise. However, Chroma offers an asynchronous ClientApi that could be leveraged to implement this.
We’re interested in investigating this further and submitting a PR to address it.
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
File "/home/artem/.local/lib/python3.12/site-packages/langchain_core/indexing/api.py", line 521, in aindex raise ValueError("Vectorstore has not implemented the delete method") ValueError: Vectorstore has not implemented the delete method
From langchain_core/indexing/api.py
Description
I am trying to follow the documentation examples but it seems that
aindex
function is broken. Can someone tell about the correctness of the following check:How is that supposed to work with langchain_chroma ? It works just fine with index and doesn't want to work with aindex
System Info
$ python -m langchain_core.sys_info
System Information
Package Information
Other Dependencies