Pinecone Vector Store Queries

Describe the problem/error/question

I’m using Pinecone as a Vector Database of documentation as part of a RAG AI workflow. I need to be able delete docs as they’re being updated, but I’m struggling to query the Pinecone DB via filters on, e.g. “file” (filename) in the metadata, in order to delete existing chunks associated with the updated file. I realise Supabase might be a better alternative, but I’d rather get Pinecone working if possible. Many thanks in advance for any help folks can give!

What is the error message (if any)?

No errors are returned from the HTTP node, just an empty object, so I’m guessing my curl request is malformed in some way.

Please share your workflow

Information on your n8n setup

  • n8n version: 1.71.3
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu 23

Why not just use the Pinecode node’s Update operation?

I need the id for the vector in order to do that, which I don’t have stored anywhere, and in any case there might be dozens of IDs associated with one doc, so i need to be able to compile those from a query before performing the update.

This is the problem I have. I also need to access the pinecone ids of the element I want to update. But the get does not deliver the id. This would be a good update id we get the ids related to a file named in the meta-data. Meta data-info is reported when sending a query but we do need the id to delete or update…

When creating the pinecone data, its a good idea to also pass the data to a database eg supabase with the ids and other data… When it comes to deleting you already have a good option to do that

I found a solution to the metadata query issue after getting it working via curl. The Vector needs passing as an array of zeros (length determined by dimension of the vector). There must be a better way to do this as a calculation; in python it’s simple but I’ve had no luck in JS so far. Here’s my http node if it helps others:

1 Like

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