-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question]: How to delete nodes using node ids from index which is VectorStoreIndex instance when created directly using nodes instead of documents? #9245
Comments
🤖 Hello @pavansandeep2910, Nice to meet you! I'm Dosu, a friendly bot here to assist you with your queries about LlamaIndex, help solve bugs, or guide you to become a contributor. While we wait for a human maintainer to join us, feel free to ask any questions you might have. I'm here to help! Based on the error message you provided, it seems like you're trying to use the However, you can delete nodes indirectly by deleting the reference document that they are associated with. This can be done using the Here is an example of how you can use this method: ref_doc_id = "<your_ref_doc_id>"
vector_store_index_instance.delete_ref_doc(ref_doc_id) This will delete the document with the given vector_store_index_instance.delete_ref_doc(ref_doc_id, delete_from_docstore=True) Please note that this will only work if the nodes you want to delete are associated with the same reference document. If they are not, you will need to call This information is based on the llama_index/indices/vector_store/base.py file in the LlamaIndex repository and a similar issue [Feature Request]: delete and update node that was resolved recently. I hope this helps! If you have any other questions, feel free to ask. SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
@dosu-bot but i don't have ref_doc_id's as i have created the index directly from the nodes without creating documents. is there any other way to delete nodes? |
@pavansandeep2910 there is not. It needs fo be implemented. Feel free to open a PR though |
🤖 Based on the information you've provided and the context from the LlamaIndex repository, it seems that you're encountering a In the LlamaIndex framework, a As for deleting nodes from the index, there is an alternative method to delete nodes from the LlamaIndex. If you have created the index directly from nodes and thus don't have index.delete_nodes(['node_id_1', 'node_id_2'], delete_from_docstore=True) This will delete the nodes with IDs 'node_id_1' and 'node_id_2' from the index and the document store. You can find more details about this in the LlamaIndex source code. However, please note that the Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Hi @dosubot, I am also face same issue to delete data in GPTVectorStoreIndex so used information given to solve but again I face issue to call the index to indexdict I called the vector_store.json assign it as IndexDict but I am getting type error vector_store_index_instance = GPTVectorStoreIndex(BaseIndex[IndexDict]) vector_store_index_instance.delete_ref_doc(ref_doc_id, delete_from_docstore=True) TypeError("object of type '_GenericAlias' has no len()") |
Hey, is it implemented now? Please let me know, I want to delete nodes I'm using faiss vectorstore. You can suggest me any other vectorstore if that supports deleting of nodes or indices |
@mdhuzaifapatel |
Question Validation
Question
How to delete nodes using node ids from the index which is a VectorStoreIndex instance when created directly using nodes instead of documents?
I tried the delete_nodes method to delete nodes using node IDs. but got the following error:
The text was updated successfully, but these errors were encountered: