SB
Soban Bin NadeemAI ENGINEER
INDEX // ALL PROJECTS
PRODUCTION SPECIFICATION
AI Automation / WhatsApp / Rental BookkeepingProduction AI Automationgit: main

RentDesk

An AI-powered WhatsApp assistant that automates rental bookkeeping, records tenant payments directly into Google Sheets, and answers tenant balance queries in real time.

Repository: [RENTDESK_REPOSITORY_URL]@Nabos23 ↗
SYSTEM TELEMETRY & SPECIFICATIONProduction Deployment
RoleAI Automation Engineer
Primary FocusConversational Bookkeeping & Spreadsheets
Integrations
WhatsApp Business APIGoogle Sheets APILLM Structured ParsingPython
01 // THE CHALLENGE

The Problem Context

Landlords and property operators waste countless hours fielding repetitive WhatsApp messages from tenants ('What is my current balance?', 'Did you get my transfer?'), while manually copying unstructured payment screenshots or text notes into spreadsheet ledgers.

⚠WHY THIS WAS TECHNICALLY DIFFICULT:
  • ›Incoming WhatsApp messages are messy, colloquial, and prone to ambiguous phrasing (e.g., 'sent 25k for last month and electricity').
  • ›Spreadsheet writes must be strictly idempotent to avoid duplicate ledger entries if a webhook retries or a tenant sends duplicate confirmations.
  • ›Tenant phone numbers must reliably map to property and unit records without exposing private tenant information.
02 // THE SOLUTION

Engineering Architecture

Built RentDesk: an automated WhatsApp assistant that intercepts inbound tenant messages, extracts structured transaction metadata via LLM schema validation, queries or updates real-time Google Sheets ledgers, and responds conversationally with precise balance statements.

Execution Sequence:

STEP 1Tenant sends message or payment notification to property WhatsApp number.
STEP 2Webhook routes payload to Python processing service.
STEP 3AI extraction engine parses intent (Payment Submission, Balance Query, History Request, General FAQ).
STEP 4For payments, the system extracts amount, date, payment method, and unit ID into validated JSON.
STEP 5System validates tenant ID against the tenant registry in Google Sheets.
STEP 6Ledger row is appended with verification timestamp and remaining balance is recalculated.
STEP 7Instant conversational receipt and updated ledger status is returned via WhatsApp.
03 // SYSTEM TOPOLOGY

Interactive Architecture & Data Flow

Bi-directional WhatsApp automation pipeline linking real-time conversational AI to audited Google Sheets ledgers.

rentdesk // bi-directional-bookkeeping-pipeline
Idempotency Guard: Active
💬
WhatsApp
Tenant natural language payload
➔ Webhook ➔
⚡
AI Parser
Pydantic schema validation
➔ Append ➔
📊
Google Sheets
Idempotent ledger & balance update
Zero Duplicates:Idempotency key checks prevent double-crediting if webhooks retry.
Instant Balance:Direct formula reads return tenant statement in under 1.2s.
Audited Storage:Property managers retain full control over spreadsheet rows.
01WhatsApp Inbound

Tenant sends natural language query or payment notice.

02Webhook Gateway

Payload validated and dispatched to Python backend.

03LLM Parsing Engine

Extracts structured entity schemas (amount, date, unit, intent).

04Google Sheets Service

Queries tenant records, checks balance, appends payment row.

05Balance Calculation

Calculates updated ledger totals and flags outstanding dues.

06WhatsApp Outbound

Sends immediate conversational verification and receipt.

04 // ENGINEERING DEEP-DIVE

Key Technical Challenges

CHALLENGE 01

Interpreting Unstructured Payment Notices

Problem:Tenants use colloquial expressions, misspellings, and mixed currencies.

✓ Engineering Solution:Employed strict Pydantic schema validation over LLM outputs, falling back to clarifying questions when confidence thresholds drop below safety limits.
CHALLENGE 02

Preventing Accidental Duplicate Writes

Problem:WhatsApp webhooks can trigger retries upon network hiccups, threatening duplicate financial credits.

✓ Engineering Solution:Implemented an idempotency key cache based on message ID and sender timestamp before executing any Google Sheets append operation.
CHALLENGE 03

Maintaining Contextual Multi-Turn Dialogues

Problem:A tenant might say 'Here is my rent' and then send the transaction receipt screenshot two minutes later.

✓ Engineering Solution:Constructed a short-lived conversational state buffer that correlates related tenant messages within active conversation windows.
05 // STACK & LIBRARIES

Verified Technology Stack

Languages & Core
PythonFastAPI
Backend Services
Google Sheets APIWebhook Handlers
AI & Orchestration
LLM Structured ExtractionIntent ClassificationConversational Context
Infrastructure
Cloud DeploymentSecure Webhooks
06 // ARCHITECTURAL TRADE-OFFS

Design Decisions & Rationales

Google Sheets as Primary Ledger Storage

Allowed property managers to retain full manual oversight, filtering, and spreadsheet formulas without forcing them onto an unfamiliar proprietary dashboard.

Defensive Parsing with Clarification Fallbacks

Financial data cannot tolerate hallucinations. If an extracted amount has ambiguity, the agent immediately prompts the tenant for confirmation.

07 // PRODUCTION OUTCOME

Technical Results

  • ✓Eliminated manual payment copy-pasting by logging tenant payments straight to Google Sheets.
  • ✓Automated real-time tenant balance lookups directly within WhatsApp.
  • ✓Built idempotent write pipelines safeguarding against duplicate ledger records.

Lessons Learned

  • •Conversational UI succeeds when users do not have to learn commands — letting tenants speak naturally while enforcing rigid backend data schemas.

Future Improvements

  • •Integrate OCR receipt image parsing to extract transaction IDs directly from banking screenshots.
  • •Add automated monthly rent reminder triggers based on due-date calculations in the sheet.

Have questions about this architecture?

Let's discuss multi-agent systems, backend scaling, or custom integrations.