Multi-Tenancy
Use this guide to choose between project-based isolation and RLS-based isolation for multi-tenant Wren AI deployments.
Wren AI supports multiple approaches to building multi-tenant architectures, allowing teams to choose the model that best fits their security, scalability, and operational requirements.
This document outlines the two recommended patterns and provides guidance on when to use each.
Overview of Supported Approaches
Wren AI supports two primary multi-tenancy models:
- Project-Based Multi-Tenancy
- Row-Level Security (RLS)-Based Multi-Tenancy
Both approaches are production-ready and can be used independently or combined depending on organizational needs.
1. Project-Based Multi-Tenancy
Architecture
In this model, each tenant is isolated into its own Wren AI project.
- One project = one tenant
- Each project has its own:
- Context layer
- Data source connections
- Security configuration
- Query history and metadata
How It Works
- A new project is created for each tenant using the Projects API
- Tenant-specific users and credentials are assigned to that project
- All queries and data access are fully isolated at the project boundary
Advantages
- Strong isolation between tenants
- Clear separation of environments
- Suitable for regulated or high-security use cases
- Allows tenant-specific schema or data model customization