Menu

Design a Secure Multi-Tenant RAG System

A strong answer to this problem, stage by stage, with the reasons behind each choice.

Note

Other good designs exist. Where another choice works as well, this solution says so and explains the trade-off.

Understanding the problem

What is a multi-tenant document assistant?

A document assistant answers employees’ questions from their company’s internal documents, such as “Who needs to approve my travel?”, and shows the passages it used. Multi-tenant means one system serves several companies. Each company has its own documents: some are open to every employee, and others are restricted to particular groups.

Functional requirements

  1. An employee can ask a question about their company’s documents and get an answer.
  2. Every answer cites the passages it came from, so the employee can check it.
  3. An administrator can add, update and delete their company’s documents, and choose which access groups may read each one.
  4. When the documents don’t cover a question, the assistant says so instead of guessing.

Out of scope:

  • Follow-up questions that depend on earlier ones in a conversation
  • Documents other than plain text, such as PDFs and scanned images
  • Syncing documents from other systems

Read the rest with Premium

Premium includes every solution, and practice in Architecture Workshop and Incident Room.

Premium is coming soon.