Deployment Modes
ChatRAG supports two deployment modes from a single codebase. Choose the right mode for your use case before starting setup.
Choose Before Setup
Your deployment mode determines which database schema to use. While you can migrate between modes later, it's best to choose correctly from the start.
Single-Tenant
Shared Knowledge Base
┌─────────────────────────────────────┐
│ SHARED KNOWLEDGE BASE │
│ • All users see same documents │
│ • Perfect for chatbots │
│ • Simple setup │
└─────────────────────────────────────┘
👤 Alice 👤 Bob 👤 Carol
(all see same documents)All users share the same knowledge base. User chats are private, but documents are accessible to everyone.
Best For:
- • AI Twins / Personality Bots
- • Product Documentation Chatbots
- • Customer Support Assistants
- • Healthcare/Legal Assistants with shared guidelines
- • Simple knowledge base applications
Database Schema:
supabase/single-tenant-setup.sqlMulti-Tenant
Isolated Workspaces
┌──────────┐ ┌──────────┐ ┌──────────┐ │Workspace │ │Workspace │ │Workspace │ │ A │ │ B │ │ C │ │(Private) │ │(Private) │ │(Private) │ └──────────┘ └──────────┘ └──────────┘ 👤 Alice 👤 Bob 👤 Carol (A + B) (B only) (C only)
Each user/team gets isolated workspaces with completely private knowledge bases and team collaboration features.
Best For:
- • SaaS RAG Products (NotebookLM-style)
- • Enterprise Deployments with Departments
- • Agencies Managing Multiple Clients
- • Educational Platforms with Classes
- • Any scenario requiring data isolation
Database Schema:
supabase/multi-tenant-setup.sqlFeature Comparison
| Feature | Single-Tenant | Multi-Tenant |
|---|---|---|
| Knowledge Base | Shared globally | Per-workspace isolated |
| User Chats | Private per user | Private per user |
| Document Isolation | No | Yes (via org) |
| Collaborative Projects | No | Yes |
| Role-Based Access | No (admin only) | Yes (owner/admin/member/viewer) |
| Team Invitations | No | Yes (email-based) |
| Storage Quotas | No | Yes (per plan) |
| Subscription Tiers | Optional | Yes (enforced) |
| Personal Workspace | No | Yes (auto-created) |
| AI Customization per Workspace | No | Yes |
Multi-Tenant Features in Detail
Role-Based Access Control
Owner
Full control, delete org
Admin
Team management
Member
Regular access
Viewer
Read-only access
Subscription Tiers
| Tier | Storage | Documents | Team Members |
|---|---|---|---|
| Free | 1 GB | 50 | 1 (solo) |
| Pro | 10 GB | 500 | 10 |
| Enterprise | 100 GB | 5,000 | 100 |
| Custom | Fully customizable limits | ||
Configuration
Single-Tenant Setup
Environment Variable:
NEXT_PUBLIC_CHATRAG_DEPLOYMENT_MODE=single-tenantDatabase Schema:
supabase/single-tenant-setup.sqlMulti-Tenant Setup
Environment Variables:
NEXT_PUBLIC_CHATRAG_DEPLOYMENT_MODE=multi-tenant
ENABLE_ORGANIZATIONS=true
ENABLE_TEAM_INVITES=true
ENABLE_STORAGE_QUOTAS=trueDatabase Schema:
supabase/multi-tenant-setup.sqlUsing Config UI
Run
npm run config to open the visual configuration dashboard. Deployment Mode is the first tab - select your mode there before configuring other settings.Can You Migrate Between Modes?
Yes! You can switch between modes:
- Single → Multi-Tenant: Existing users get personal orgs auto-created. Documents assigned to admin organization.
- Multi-Tenant → Single: Export data first. All documents become globally shared.