Quering with multiple vectors at a time

Is it possible to query multiple vectors in a single request by passing several vectors at once? I need to retrieve information for five data points simultaneously, and performing sequential retrieval increases latency. I’m considering batch querying to improve efficiency. Can this be achieved in Pinecone?

Hi @gayani.parameswaran, and welcome to the Pinecone community forums!

Thank you for your question.

Here’s our official data querying guide, in case you haven’t seen it.

Are the 5 data points you’re trying to retrieve related or associated? if so, you could experiment with different top_k values to retrieve multiple relevant vectors at once.

You could also use metadata filtering - this would involved specifying a field on your metadata when upserting your vectors to Pinecone - it could be the same field for multple vectors, for example: category: dinosaur - you would then use that category as a filter in your query:

{ "category": ["dinosaur"] }

Hopefully that helps and gives you some ideas to go on!

Best,
Zack

1 Like