How to delete items in Pinecone database (with filter)

Describe the question

I made a workflow to insert a file (chunked) in a Pinecone database, with filename as metadata.
What I would like to do is to be able to delete all chunks of the file if I want to (for instance before I insert a newer version of the file).

Since I’m using the cloud version, I can’t use the LangChain code node.

Is there a way to delete all items having metadata.filename == something in the database?

Information on your n8n setup

  • n8n version: 1.60.1
  • Database (default: SQLite): Pinecone
  • n8n EXECUTIONS_PROCESS setting (default: own, main): ?
  • Running n8n via (Docker, npm, n8n cloud, desktop app): cloud
  • Operating system: cloud
1 Like

Hi @PhunkyBob,

In the cloud version of Pinecone, I don’t think you can delete items by metadata due to limitations on serverless indexes according to their docs: Delete data - Pinecone Docs but you could try deleting records using their ID prefix instead?

When I add data in Pinecone database with N8N, how can I specify the ID prefix?

It currently isn’t possible to specify id prefix in the current Pinecone node, but it’s in our backlog [AI-282]. There’s also a relevant feature request you can go and upvote: Retrieve Vector ID After Document Upsert in Pinecone Integration

For the time being, you might be able to use the HTTP request node mentioned in a post here although I haven’t managed to test it out.

1 Like

Thank you.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.