This page shows you how to use the delete endpoint to remove records from an index namespace.

Delete specific records by ID

Since Pinecone records can always be efficiently accessed using their ID, deleting by ID is the most efficient way to remove specific records.

To remove records from the default "" namespace, don’t specify a namespace in your request.

Delete specific records by metadata

Serverless indexes do not support deleting by metadata. You can delete records by ID prefix instead.

To use metadata values to select vectors to be deleted, pass a metadata filter expression to the delete operation. This deletes all vectors matching the metadata filter expression.

For example, to delete all vectors with genre “documentary” and year 2019 from an index, use the following code:

Delete all records from a namespace

To delete all records from a namespace, provide a namespace parameter and specify the appropriate deleteAll parameter for your SDK. To target the default namespace, set namespace to "".

Deleting all records from a namespace also deletes the namespace itself.

Delete all records from an index

To remove all records from an index, delete the index and recreate it.

Data freshness

Pinecone is eventually consistent, so there can be a slight delay before new or changed records are visible to queries. You can use the describe_index_stats endpoint to check data freshness.