Multi-tenancy and Vector search


Working to build a search platform with many tenants (B2C model) and would love to use vector search to support semantic search for the end users.

Ideally all tenants data would live in the same collection, but tenant data must remain separate when returning results (likely by use of shard key per user and/or filters on user_id). Using multiple collections or databases isn’t really a feasible strategy as user base changes rapidly.

I’d like to understand:

  1. What mechanisms exist to setup multi tenant search with vector indexes specifically?
  2. Can vector indexes be separated via a shading style pattern - essentially miniature indexes for each tenant which follow the same structure, but have different data?
  3. Performance and cost implications of hosting many indexes?
  4. Can indexes or portions of indexes be offloaded from memory (Atlas/Lucene) while not in use?

In general, what would be best recommendations/best practices for setting up vector search in a multi tenant architecture?

For multi-tenant architecture a good way is to use a text field in the document to identify that tenant, and then use a pre-filter in the vector search query