I am now evaluating a mechanism that using index for an embedding space, and uses namespace for each specific embedding version, per our logic we only need to keep the last 7 days’ versions, so I am wondering if there is any API to delete the old versions, aka. older namespaces.
I checked the APIs it seems that I can only delete embeddings by Ids or delete the whole index and deleting a namespace is not yet supported. Delete (pinecone.io)
The API of delete supports deleting a whole namespace. It is done by using delete_all flag.
e.g. calling index.delete(delete_all=True, namespace="example") will delete all vectors inside “example” namespace and only them.
Yes, the delete call is async.
You can check the completion of namespace deletion by polling the describe_index_stats API call until its response doesn’t contain the deleted namespace.
Hi @ssimarpreet11
The deleteAll functionality is currently unavailable due to some ongoing behind-the-scene changes, but it will be reintroduced soon.
In the meantime, you can try deleting and re-creating the index to achieve the same effect.
Let me know if the workaround works for you.
Thanks
Ben
This is a critical piece of functionality for a system we are building. Can you provide some info on when this functionality will be available again? I don’t see any mention of this not working in the API docs.
The delete_all function, which allows for the deletion of an entire namespace, is available even on the Starter plan. As far as I know, this function has never been temporarily disabled.
Have you confirmed that this function is not working as expected? I just tested it and the delete_all function is working without any issues. If you’re just performing a simple check using HTTP, it should take about a minute.
‘delete_response’ is always empty. I am trying to verify if deletion is working using index.describe_index_stats() and it doesn’t seem to have changed. I am currently on the starter plan.
Not sure whats going wrong here, any help is appreciated!
This works for me on a paid plan. But interesting to note, if you specify the project name in the init call, the delete throws an error. Seems like a bug.
Circling back to this one: index.delete() returns an empty result if no errors exist, so the behavior described is accurate. If you want to confirm that the deletion has completed, you should run index.describe_index_stats().
But keep in mind that the deletes are happening behind the scenes so the numbers may not reflect in the output for describe_index_stats() immediately. It can take a couple of minutes on very large indexes (billions of vectors) for the work to complete.