dinil balasuriya/ projects / receptionist ai

own projectoct 2026

receptionist ai

missed call triggers an instant text, then an ai agent books the job.

private repo, no public demo

  1. 01a call is missedtwilio calls /voice. unsigned webhooks get a 403.
  2. 02greeting, then hang upthe rest runs in the background after twilio gets its answer.
  3. 03a text goes outnew numbers get a template opener. known callers get one that mentions the last job.
  4. 04the customer repliesa 1.2 s debounce: two quick messages, one reply.
  5. 05the agent reads the threadcaller record, memory note, bookings, last 100 messages.
  6. 06toolscheck_availability, make_booking, cancel_booking, remember, flag_owner. a holding text goes first when a tool is needed.
  7. 07bookedthe booking is written to the database. double bookings are refused by code.
  8. 08loggedevery run, model call, event and message, with cost and timing.

the real webhook flow. bookings stay simulated: no real customer or calendar.

01 / story
  • whenoct 2026
  • built in2 days
  • teamsolo

a tradie on a roof misses a call, and the caller rings the next electrician on the list. the job is gone before he is back on the ground.

so i built the thing that answers for him. a missed call plays a short greeting, hangs up, and a text goes out within seconds.

then an ai agent takes over the text thread: it gets the job, the suburb and a time, checks a calendar and books it.

the hard part was making it feel instant and keep it cheap. a model call takes 6 to 9 seconds, so the agent sends a short holding text the moment it needs a tool, and the full answer follows.

it remembers each caller by phone number, so a returning caller gets a reply that picks up where the last job left off.

every call, text, model call and cost is written to the database, so i can see where the time and money go per run.

it got as far as a deployed app, two numbers, and two made-up business profiles. i called it myself and got the greeting and the text back. bookings stay simulated.

02 / how it works
  • stack: TypeScript on Node 24 with no build step, Hono for the web app, Twilio for voice and SMS, Postgres on Neon, deployed on Vercel in Sydney. The model is reached through OpenRouter and is a single env var (Claude Haiku class, for cost).
  • missed call: Twilio hits /voice, the app plays the greeting and hangs up, then does the rest in the background after answering Twilio. Webhooks are checked against Twilio's signature, and a bad one gets a 403.
  • the agent: before every model call it loads the caller's record, a memory note, their bookings and the last 100 messages in that thread. Unknown numbers get an instant template opener; known ones get an AI-written opener that references the last job.
  • tool loop: check_availability, make_booking, cancel_booking, remember (the agent rewrites a short note about the customer) and flag_owner (texts the owner when something is urgent or out of scope). Booking rules are code per business, so double bookings are refused. Bookings are written to the database, not to a real calendar.
  • double texts: a 1.2 second debounce means that if a customer sends two messages, only the newest triggers a reply.
  • multi-business: each business is a profile file (prompt, knowledge, hours, opener) selected by which Twilio number was called, with contacts, messages and bookings kept separate per business.
  • logging: every trigger is a "run". Tables runs, llm_calls (tokens, latency, USD cost reported by the model provider), events (timeline per step), messages (with Twilio SID and an estimated SMS cost), plus views for daily p50 and p95 first-reply time, cost by model and step timing. A small basic-auth inbox page and a stats JSON endpoint show conversations and the numbers.
  • size: about 840 lines of TypeScript in 15 source files, a 154-line idempotent SQL schema (6 tables, 4 views), 22 commits.
03 / numbers
  • 22commits, 18 to 19 Oct 2026
  • about 840lines of TypeScript, 15 source files
  • 6tables, 4 views in the schema
  • about US$0.001 per text with the Haiku model, versus about US$0.03 with a large model
  • holding text at about 3.5 seconds, full answer 6 to 9 seconds
  • offline test: new-caller reply about 7 seconds, returning-caller opener about 4 seconds
  • 5agent tools