All Questions
Rag And Retrieval medium

A multi-tenant SaaS app stores all tenants in one vector index with a tenant_id field. Queries fetch the top 20 chunks by similarity and then drop chunks from other tenants. Small tenants often get 0-2 results. Why does this happen, and what is the fix?

  1. A The HNSW graph is undertrained for small tenants; rebuild the index more often so their vectors get better links.
  2. B Small tenants' documents are too short; merge them into larger chunks so that their vectors score higher globally.
  3. C Post-filtering discards most of the top 20; apply the tenant filter inside the search or partition by tenant.
  4. D Raise the similarity threshold for small tenants so that only highly relevant chunks survive the tenant filter.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions