01PK2026 — ongoingLatest project
AI Receptionist
Answers customer conversations, checks business opening hours, finds available appointment slots, books against Google Calendar with configurable slot duration, and notifies the team over Slack. It picks up on the phone through Twilio and on WhatsApp — the channels customers already use.
- median first response
- ~380ms
- before the work
- 1–2s
- edge-case tests
- 20
The hard parts
The hard partlatency
It worked, but took 1–2 seconds to start responding, which feels slow in a conversation. Rather than accept it, I traced where the time actually went and made four changes: moved to a smaller low-latency model with tool-calling support, cached upcoming availability instead of re-querying the database, stripped the system prompt down to what the agent actually needed, and added semantic caching so common questions never reach the LLM at all.
Result: 1–2 seconds down to roughly 300–400 ms average.
The hard partnot making customers wait on other people’s APIs
Booking no longer blocks on Calendar, Gmail, and Slack. The AI confirms, the appointment is written to the database, and an event goes onto a Celery queue where integrations run in the background with retries. The database is the source of truth; external services sync independently. Fast responses and more reliable integrations, rather than a trade between them.
The hard partavailability logic
The part that sounded simplest took longest. Deciding which slots are genuinely free means handling current time, requested ranges, past slots, partial ranges, missing time values, and existing bookings. I solved it by computing an effective date/time range before querying, and wrote 20 tests aimed squarely at those edge cases rather than the happy path.
Stack
- Python
- FastAPI
- Google Calendar API
- Celery
- semantic caching
- PostgreSQL