# Building a WhatsApp Business AI Assistant for Real Estate: An Architecture Overview

> Source: <https://dev.to/getsabbaq/building-a-whatsapp-business-ai-assistant-for-real-estate-an-architecture-overview-2hj6>
> Published: 2026-10-16 06:31:55+00:00

*Canonical note: this is a technical companion to [Sabbaq](https://getsabbaq.com/en?utm_source=devto&utm_medium=syndication&utm_campaign=architecture). No credentials, keys or internal endpoints are included.*

Sabbaq is a WhatsApp-first lead desk for Dubai real estate brokerages. The product promise is simple:

Every Property Finder and Bayut lead answered in seconds, in Arabic or English, on your existing WhatsApp number. Median under 5 minutes, or your month back.

Putting money behind a reply-time number forces some interesting engineering decisions. This post walks through the architecture at a high level: ingestion, the conversation engine, guardrails, human handoff, tenancy and metrics.

```
 WhatsApp Cloud API webhook ──┐
                              ├──► Lead normaliser ──► Conversation engine
 Inbound lead email (parsed) ─┘
```

**WhatsApp.** Any inbound message to the connected number becomes (or updates) a lead. The webhook handler verifies the Meta signature, de-duplicates on message ID (Meta retries), persists the raw event, and enqueues work, returning 200 fast. Keep webhook handlers thin; do the slow work async.

One honest limitation: a plain WhatsApp message doesn't tell you which portal the lead came from.

**Email.** Portals send lead notification emails. Each workspace gets a unique inbound address; brokerages forward Property Finder, Bayut and Dubizzle lead emails there. A parser per portal extracts name, phone, listing reference and message, tags the lead with its portal, and triggers a WhatsApp intro using a Meta-approved template (business-initiated messages outside the 24-hour window need templates).

Each inbound message runs through a pipeline:

Qualification is deliberately one question at a time: buy or rent, budget, area, bedrooms, timing, cash or mortgage. Each answer is written to structured lead fields, not just left in the transcript, so routing and reporting can use it.

The very first message discloses that it's an AI assistant. That's a product decision and good practice under Meta's policies. We position it as the brokerage's own assistant for its own leads, not a general-purpose bot.

The biggest risk in real estate is a confident wrong number. Our rules:

The lesson: treat the LLM as a draft writer, and put deterministic checks on both sides of it.

Every workspace starts in **shadow mode**: the engine runs end to end, but output lands as a draft that an agent approves (with inline edits) or discards. This was the single best decision we made:

Implementation-wise, "send" is a strategy chosen per workspace and per chat. A take-over/hand-back toggle pauses the assistant for a single conversation when an agent steps in.

When a conversation needs a human, it's routed with a summary by area, language or listing. Handing off moves the latency risk from the model to people, so:

Each brokerage is a workspace. The workspace is bound in a signed session, membership is rechecked on every request, and the query layer refuses tenant-table queries without a workspace scope. Tests cover the isolation. In short: each brokerage's data is logically separated by workspace and enforced on every request.

Roles are layered: **Agent** (inbox, replies, approvals, viewings), **Admin** (plus settings, listings, knowledge, metrics), and **Owner** (plus billing, WhatsApp connection and users).

An outbound, signed webhook POSTs on events like *lead qualified* and *viewing confirmed*, so brokerages can push into any CRM. Lead and consent CSV exports are self-serve.

The metric we guarantee is the **median time to first reply from lead arrival, whoever replies** (assistant or agent). Median beats mean: one stuck chat can't hide behind fast ones, and one fast reply can't flatter a bad week.

The weekly report (Monday to Sunday, Dubai time) covers leads, after-hours leads, replied, median first reply, replies under 5 minutes, qualified, viewings requested and confirmed, handoffs, opt-outs and leaked leads. Owners and admins see the median view on every plan.

Arabic support isn't just the model. The agent inbox renders direction per message bubble, and numbers, prices and listing references are isolated so they don't flip inside right-to-left text. Small thing, huge difference for agents.

If you're running a brokerage in Dubai, or you're just curious how it behaves on real leads, see **[Sabbaq at getsabbaq.com](https://getsabbaq.com/en?utm_source=devto&utm_medium=syndication&utm_campaign=architecture)**.
