What's the best method to separate different documents in one Namespace for RAG?

I am developing a RAG application using Pinecone Serverless. In this setup, each user’s data is isolated within its own Namespace. Every user has multiple documents, each distinguished by unique metadata. Currently, my approach involves using metadata filters to search for specific documents. However, as the number of vectors per user increases, potentially reaching millions, the cost associated with “Read Units” is likely to rise substantially.

My concern is whether it’s possible to store documents in separate partitions within the same Namespace. Such a structure would mean that during a query, Pinecone wouldn’t need to scan the entire Namespace of a user, potentially reducing costs and improving efficiency.

An alternative I considered was creating a separate index for each user. Within each user’s personal index, their documents would be divided by Namespaces. However, this approach restricts the ability to perform queries across multiple user documents, as queries are limited to a single namespace.

1 Like

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

Hi @ms.muhaaam, I have a couple of follow up questions for you:

Is the goal to search across only a single document at a time? Or will you be searching across multiple documents? If the latter, namespaces won’t work because you can only query one namespace at a time. And if you’re only searching across a single document at a time, you’re missing out on the strengths of using a vector database, where you need to find answers without already knowing which document to look in.

There’s not a sub-namespace, exactly. You could use metadata filtering to improve your results by filtering for just the documents you want to search against, but even then the total read units will be a factor of how large the namespace is.

1 Like