Skip to content
Mostafa Mahmoud

All work

A real estate CRM agents run from WhatsApp

Real estate agents upload units, search inventory and book client calls by sending a WhatsApp text or voice note. AI agents turn each message into structured data.

Role
Founder, architect and QA. Designed workflows, prompts and data model; directed AI coding tools; deployed and supports it.
Period
Apr 2026 – present
Status
Live with 2 brokerages
Stack
n8n (queue mode), Qwen3 235B, Supabase, Evolution API (WhatsApp), React + Vite, Flutter, Docker, Nginx Proxy Manager
  • 2brokerages live
  • ~300units uploaded per month (one client)
  • 100–120searches per month (one client)
  • 21fields extracted per listing
  • 300+compounds matched by alias

Architecture

System steps in order

  1. Upload
    1. WhatsApp message (Input)
    2. Evolution API webhook (Logic)
    3. Strip PII and empty fields (Logic)
    4. Build prompt with live projects and areas, reads Supabase (Logic)
    5. AI agent: extract 21 fields (AI)
    6. Validate JSON (Logic)
    7. Insert unit, Supabase (Data)
    8. Confirm on WhatsApp (Output)
  2. Projects and areas alias table (Data). Feeds: Build prompt with live projects and areas; Build search prompt
  3. Search
    1. WhatsApp message (Input)
    2. Build search prompt (Logic)
    3. AI agent: 13-field filter (AI)
    4. Query inventory, Supabase (Data)
    5. Format results (Logic)
    6. Reply on WhatsApp (Output)
  4. Booking
    1. Text or voice note (Input)
    2. Gemini transcription (AI)
    3. AI agent: extract booking (AI)
    4. Check conflicts, appointments (Data)
    5. Conflict? warn and suggest a time (Alert)
    6. Save appointment (Data)
    7. Scheduled reminders (Logic)
    8. WhatsApp reminder before and at the time (Output)
  5. Operations
    1. Workflow error (Alert)
    2. Log (Data)
    3. WhatsApp alert to admin (Output)
    4. WhatsApp instance monitor with QR reconnection (Logic)

The problem

Brokerage agents share units and requests all day in WhatsApp, in Egyptian Arabic, English or a mix, full of typos and spoken price formats. That information never reached a searchable system, so agents scrolled chats to find a unit and missed follow-ups.

What I built

Three WhatsApp-triggered AI workflows on top of a multi-role CRM:

  • Upload: an agent pastes or types a unit. A code step strips client names and phone numbers before any model sees the text. The prompt is built live with the current list of projects and areas from Supabase, and an n8n AI agent returns a fixed 21-field JSON object, which is validated and saved.
  • Search: an agent asks in plain language ("twin house in New Cairo with a garden under 12 million"). The agent converts it into a 13-field filter, Supabase is queried, and matching units return on WhatsApp within seconds.
  • Booking: an agent sends a text or voice note ("book a call with a client tomorrow at 4, remind me 30 minutes before"). The system extracts type (meeting or call), client, time and reminder lead time, checks the agent's calendar, warns about conflicts with existing appointments, then sends WhatsApp reminders before and at the appointment time.

Key decisions

  1. Store everything in English, accept anything. Arabic, English and mixed input are normalised to one canonical English form at upload and at search, so a unit uploaded in Arabic is found by a search in English.
  2. Aliases instead of model guessing. A table of 300+ Egyptian compounds with Arabic names, abbreviations and common misspellings is injected into the prompt, so the model chooses from known values rather than inventing them.
  3. Privacy before the model. Client personal data is removed in code before the LLM call.
  4. One isolated server per client. Each brokerage gets its own VPS with self-hosted Supabase and n8n in queue mode (3 workers), so data never mixes between clients.

Results

Live with 2 brokerages. At one client, agents upload about 300 units and run 100–120 searches a month through WhatsApp.

In action

Upload

Inventory assistant

  1. شقة للبيع في مدينتي B12، 3 غرف و2 حمام، 165 متر، الدور التالت، متشطبة، السعر 6 ونص مليون، المقدم مليون ونص

    10:42
  2. Inventory assistant:

    Saved ✓ Apartment in Madinaty B12, 3 bedrooms, EGP 6.5M. Unit code U-2481

Behind the scenes

Extracting fields

project
Madinaty
phase
B12
type
Apartment
bedrooms
3
bathrooms
2
bua_m2
165
floor
3
finished
true
price
6500000
down_payment
1500000
remaining
5000000
listing
Sale
Demo data. The real systems run for companies in Egypt.

Search

Inventory assistant

  1. عايز توين هاوس في التجمع بجاردن تحت 12 مليون

    11:05
  2. Inventory assistant:

    Found 3 units:

    • Cedar Park: 4 bedrooms, EGP 11.2M
    • Lotus Hills: 4 bedrooms, EGP 10.75M
    • Rowan Gardens: 3 bedrooms, EGP 9.9M

Turning the request into a filter

type
Twin House
area
New Cairo
garden
true
price_max
12000000
CompoundTypeBedroomsGardenPrice (EGP)
Cedar ParkTwin House4120 m²11,200,000
Lotus HillsTwin House495 m²10,750,000
Rowan GardensTwin House380 m²9,900,000

3 units found in 1.2s

Demo data. The real systems run for companies in Egypt.

Booking

Inventory assistant

  1. 15:20
  2. Inventory assistant:

    You already have a site visit at 4:00 PM. Book 5:00 PM instead?

  3. Yes, 5

  4. Inventory assistant:

    Booked. Reminders at 4:30 PM and 5:00 PM.

Behind the scenes

Transcribing the voice note and extracting the booking

Transcript

Book a call with Karim tomorrow at 4, remind me 30 minutes before.

type
Call
client
Karim
date
tomorrow
time
16:00
remind_before_min
30
Demo data. The real systems run for companies in Egypt.

All work