Find answers from the community

Updated last year

Do the CRUD methods on VectorStoreIndex

At a glance
The community members are discussing issues with the CRUD (Create, Read, Update, Delete) methods on the VectorStoreIndex when using a PGVectorStore. One community member notes that the delete method works using the ref_doc_id, but another community member is encountering an error when trying to use the delete_ref_doc method, stating that the ref_doc_id expects a string, not a number. The community members suggest checking the delete method implementation and providing a more complete traceback to help diagnose the issue. Another community member mentions that the refresh method may not work as intended without additional configuration. In the end, the community member who was experiencing the issue was able to resolve it by creating a simple example, but does not provide a clear answer or solution.
Useful resources
Do the CRUD methods on VectorStoreIndex not support a PGVectorStore?
L
e
10 comments
It does as far as I know -- delete is done by "ref_doc_id" tho
I keep getting an "Error occured on delete of document. ID: 0. Error: %d format: a number is required, not str". And I am using the newer method calls like delete_ref_doc(ref_doc_id=doc_id)
ref_doc_id takes a string...
Uhhh lemme check the delete method
same thing happens for all of them... refresh etc...
Maybe if you have a more complete traceback I could track it down. But the delete method is dead simple

https://github.com/run-llama/llama_index/blob/8d2ad8ba9cecf250e501587ff1e8541cc5bf6725/llama_index/vector_stores/postgres.py#L585
Refresh won't work without some extra TLC to work as intended (it requires enabling/using the docstore, which is disabled for most vectordb integrations)

Otherwise, it will just always insert duplicates
If I use the simple vec store same code works fine... I'll create simple example using the pgvec example code and see if I get the same thing. The delte does look straightforward... πŸ˜•
simple example works. it's me. somehow. thanks anyway. :thankyou50:
Add a reply
Sign up and join the conversation on Discord