Dr. Ravi Teja Thiriveedhi
Case study · Production AI · Live since June 2026

A 15-agent WhatsApp and Telegram platform for a real-estate brokerage

Enquiries are captured, qualified, routed, matched to properties and followed up by AI agents. The owner approves anything sensitive, gets a daily digest on Telegram and sees every lead in one dashboard. I designed, built and operate the whole system.

Client Hyderabad property brokerage (anonymised)Role Architect, builder, operator
460+leads handled
8,688customer interactions logged
−91%heartbeat token spend
7+ howner time saved a week (client-confirmed)
The problem

Enquiries arrived faster than people could answer them

Buyers write to the brokerage on WhatsApp and Telegram at all hours, often in Telugu written in English letters. Some enquiries went unanswered and some follow-ups slipped.

The brief: recover missed enquiries, keep a human in charge of anything sensitive, and run AI at a cost a small business can carry.

How it works

One message, five stages

  1. STAGE 1

    Capture

    WhatsApp Business API webhook with a signature check that fails closed and de-duplication; Telegram through a bot bridge.

  2. STAGE 2

    Record

    One writer service saves every write to SQLite, the source of truth. A Google Sheet is the owner's mirror, never the database.

  3. STAGE 3

    Qualify

    Rules first, then a small tool-less, memory-less extraction model turns each message into structured lead details.

  4. STAGE 4

    Act

    Routing, semantic property matching on local embeddings, six lead-risk scans and follow-ups on a written cadence.

  5. STAGE 5

    Report

    A deterministic daily digest on Telegram and an owner dashboard behind login.

Cost engineering

The same work on 91% fewer heartbeat tokens

ChangeEffect
Heartbeat intervals set per agent; 11 agents moved to scheduled runs only; a zero-token check wakes a model only when something changed12.0 M → 1.0 M tokens a day
Extraction moved out of the full intake agent into a tool-less, memory-less extractor, with rule-based parsing first~38 k → ~4 k tokens a message
(1,177 turns, 0 errors)
Cache-friendly prompts76–79% from cache
Monitoring, digests and project history written as plain code0 AI tokens
Privacy-aware fallback routingCustomer-data agents never fall back to providers that may train on prompts

Result: ₹0 marginal API cost per lead (about ₹13 at list price). The 18 methods are written up in llm-token-economics.

Safety and governance

A human stays in charge

  • Engagement rules live in one versioned policy file: answer first, ask at most one or two questions, never state prices, legal status or RERA claims. Behaviour changes by editing the policy, not the code.
  • Follow-up cadence by lead temperature, quiet hours 21:00–09:00, and leads cool automatically after four ignored messages.
  • 284 WhatsApp template follow-ups in four weeks, each approved by the owner in the dashboard. A cold-lead reactivation agent was built and deliberately kept off.
  • Human takeover: when staff reply from the business number, the agents step back for 24 hours.
  • Owner notes on Telegram apply only when unambiguous; sensitive changes ask first, and every write returns an undo handle.
  • Every dashboard route needs login, with rate limits and an audit log. No customer data is pulled to my machines; backups stay on client-owned storage.
Reliability

Built to recover what would otherwise be missed

Lessons from 129 closed bugs

What I carry into every build

Never route single-purpose model calls through a full agent.

Extraction went from about 38 k to 4 k tokens a message.

Deterministic checks first, a model only on change.

Most scheduled checks need no model at all.

Signature checks must fail closed.

A webhook that guesses can be forged.

A spreadsheet is a view, not a database.

One writer, provenance and a change log.

Timeline, 2026

Built over 154 days

19–21 May
Engagement policy written
29 May
First commits
15–29 Jun
WhatsApp live; security baseline
2–5 Jul
Owner dashboard live
1–13 Aug
Messaging tiers, human takeover, audit and resilience layer
23 Sep
Token optimisation: heartbeat spend −91%
24–25 Sep
Single-writer database, self-healing jobs; 65-chapter staff runbook in English, Hindi and Telugu
Oct
Operating with 15 agents deployed (heartbeat, scheduled or on demand)

Build record: 95 commits, 137 k lines added across 806 files, 129 bugs closed with root cause, 61 of 75 lessons promoted into a reusable delivery playbook. The code was written by AI coding agents from my specifications; I owned the architecture, review, testing, release and operations.

Why a dentist built this

Why a dentist built this

The rules that keep a clinic safe kept this system safe: written protocols, a root cause for every incident, and a human who signs off on anything that matters. I now apply them to healthcare AI.

Figures come from the platform's own dashboards and logs, 2026, and are shared with the client's permission. The client is anonymised; no customer data, code, prompts or configuration are published. The platform is presented as delivered and operating; it is not claimed to have driven sales.