← All case studies

CASE STUDY · MULTI-TENANT SAAS

One platform for leads, conversations and AI, safely shared by many companies.

A multi-tenant SaaS combining a CRM, an AI agent with a knowledge base, and WhatsApp automation, built so each customer’s data stays strictly their own.

Role
Architect, analyst, project manager and developer
Client
Withheld for confidentiality
Platform
Multi-tenant SaaS: CRM, AI agent, WhatsApp
Stack
Python (FastAPI, Django), React and Next.js, PostgreSQL with row-level security, Celery and Redis, WhatsApp Business API

A SaaS product needs more than a customer database and an AI chat window. Each business needs its own workspace, its own knowledge and reliable follow-up, all on a shared platform. This project brings those capabilities together with tenant isolation designed into the system.

A strong fit for: Founders and product teams building a shared CRM, AI-assisted customer service or WhatsApp-led SaaS product for multiple businesses.

The challenge

Many business customers needed to use one product at the same time: a CRM to manage leads, an AI assistant that answers from each customer’s own knowledge, and WhatsApp as a main channel to their own customers. The hard part was not any single feature. It was keeping every customer’s data, conversations and AI knowledge completely separate on one shared system, and handing a conversation to a person when the AI should not answer.

Architecture

Architecture of a multi-tenant SaaS with CRM, AI agent and WhatsAppChannels such as WhatsApp, web and webhooks connect to an API with roles and an AI agent. Data is stored in PostgreSQL with row-level security, separated per tenant, with per-tenant vector namespaces. A human agent takes over from the AI, and a legacy ERP connects through a SOAP adapter.CHANNELSAPPLICATIONDATAWhatsApp Business APIMeta webhooks, templatesWeb appReact / Next.jsWebhooksinbound and outboundAPI, roles and automationFastAPI · RBAC · Celery / RedisAI agentanswers from the tenant's knowledgeHuman hand-offomnichannel inboxPostgreSQL · row-level securityTenant Adata + vector spaceTenant Bdata + vector spaceTenant Cdata + vector spaceLegacy ERPSOAP / XML adapterSimplified, generic diagram. No client names or data.

What was built

Tenant isolation by design

A tenant identifier on every record, enforced by PostgreSQL row-level security, with a separate vector namespace per tenant for the AI knowledge base.

Roles and permissions

Role-based access control so each user sees only what their role allows.

Lead pipelines with deduplication

Leads from every channel flow into pipelines, with duplicate detection so the team does not chase the same person twice.

AI agent with human hand-off

Retrieval-augmented answers drawn only from the customer’s own content, with a clean hand-off to a person when the AI should not answer.

WhatsApp Business API

Approved message templates, Meta webhooks and an omnichannel inbox, so the team handles every channel in one place.

Automation and integrations

Workflow automation, inbound and outbound webhooks, a REST API and a SOAP/XML adapter that connects a legacy ERP.

ARCHITECTURE & IMPLEMENTATION

The technology, and the work behind it.

How the documented stack supports the business workflow, from the application layer to integrations and operational controls.

Backend and background processing

Python · FastAPI / Django · Celery · Redis

The application combines APIs with asynchronous processing for automation. Background work supports follow-up sequences and integrations, while the system exposes REST endpoints and inbound and outbound webhooks.

Tenant data and permissions

PostgreSQL RLS · tenant_id · Role-based access · MFA / SSO

Every table carries a tenant identifier, with row-level security enforcing data boundaries. Role-based permissions and MFA / SSO form part of access control. The architecture must preserve the same boundaries across the user interface, APIs and background processing.

Customer-specific AI knowledge

LangChain / LlamaIndex · Qdrant / pgvector · RAG

Each tenant has a separate vector namespace. The AI agent retrieves knowledge from PDFs, websites and Q&A, with strict grounding. Negative sentiment or a customer request can trigger a hand-off to a human agent.

Messaging and CRM workflows

WhatsApp Business API · Meta webhooks · Kanban pipelines

Approved message templates and real-time webhooks connect WhatsApp conversations to a unified agent inbox. Custom fields, duplicate detection and lead pipelines support the operational CRM workflow around those conversations.

Product interface and legacy connectivity

React / Next.js · Tailwind · Docker · SOAP / XML adapter

The web application provides the customer-facing workspace. A SOAP / XML adapter connects a legacy ERP, and Docker is part of the delivery stack. The product connects existing business systems with the new SaaS experience.

Follow the workflow

An illustrative walkthrough of the capabilities described in this project.

  1. A business manages its leads and uploads knowledge within its own tenant workspace. Data and vector namespaces keep that context separate from other businesses.
  2. A customer conversation reaches the WhatsApp integration. The AI agent can answer using the business’s own content and hand the conversation to a person when required.
  3. Triggers, follow-up sequences and webhooks connect the conversation to the next CRM or integration action.

How the work was run

  1. Scope and architecture first. A written architecture was agreed before development.
  2. Milestones. Working software was delivered in stages that could be reviewed.
  3. Hardening. Roles, tenant boundaries, webhook reliability and error handling were reviewed before production use.

Why it matters for your project

If you are building a product for several customers, or adding AI and WhatsApp to a business system, the decisions that matter most are made early: how data is separated, how AI answers stay within each customer’s knowledge, and how a human takes over. This project shows that work handled end to end by one senior architect. See the related article, how to build a multi-tenant SaaS without leaking customer data.

Client details are withheld. The diagram is a simplified, generic illustration and contains no client data.

BUILD A SYSTEM AROUND YOUR BUSINESS

Your workflow could be the next case study.

If you want to turn a business workflow into a SaaS product, the foundation matters: who can see what, how AI uses customer knowledge and what happens when a person needs to take over. I can design and implement those foundations alongside the features your customers will use.

Share who your customers are, what they need to manage and how AI or WhatsApp fits the service. We can define a first product milestone with tenant isolation and the core workflow in scope.

Work directly with Itzhak Shaul, founder of Methodspire and Principal Software Architect with 30+ years of hands-on experience. Start with a focused conversation about the workflow, constraints and delivery scope.

Discuss a similar systemEmail me about your project