Appointment Booking Assistant Bot in Mobile App
Booking appointments via chat competes with native calendar pickers. To win, the dialog must be substantially shorter: the user describes desired time in words, the bot suggests suitable slots.
Parsing Time Expressions
The main technical challenge is understanding arbitrary time expressions: "tomorrow after noon", "Friday morning", "next week, preferably evening". This is an NLP task.
For Russian, the Natasha Python library extracts dates and times well from unstructured text:
from natasha import Segmenter, MorphVocab, NewsEmbedding, NewsDatesExtractor
segmenter = Segmenter()
morph_vocab = MorphVocab()
emb = NewsEmbedding()
dates_extractor = NewsDatesExtractor(morph_vocab)
text = "book me next Friday at 3pm"
for match in dates_extractor(text):
print(match.fact) # DateFact(year=2024, month=1, day=19, hour=15, minute=0)
With Dialogflow — built-in system entities @sys.date, @sys.time, @sys.date-time work for Russian. For Rasa — duckling extractor running as a separate HTTP service.
After parsing: request available slots from the scheduling system, offer nearest to requested time.
Scheduling System Integration
The bot works via the scheduling system API. Popular options in CIS: 1C:Enterprise (healthcare, services), YCLIENTS (beauty), Calendly API, Google Calendar API, custom systems.
For Google Calendar:
const { google } = require('googleapis');
const calendar = google.calendar({ version: 'v3', auth });
async function getAvailableSlots(serviceId, date) {
const freebusy = await calendar.freebusy.query({
requestBody: {
timeMin: dayjs(date).startOf('day').toISOString(),
timeMax: dayjs(date).endOf('day').toISOString(),
items: [{ id: serviceCalendarId }]
}
});
// Calculate free slots between busy times
const busySlots = freebusy.data.calendars[serviceCalendarId].busy;
return computeFreeSlots(busySlots, workingHours, serviceDuration);
}
Critical: handle the race condition where a slot is taken between the bot's offer and user confirmation. Solution — two-phase booking: temporary reservation for 3–5 minutes when showing slot, confirmation on agreement.
Bot UI for Appointments
Text dialog is supplemented with inline components:
Horizontal date scroll — when user hasn't specified a date, show next 7 days as chips. Tapping a date requests slots for that day.
Time grid — display available slots as buttons in a grid; occupied ones are inactive. On Android, use FlexboxLayout with dynamically added button chips. On iOS — UICollectionView with compositional layout.
Confirmation card — specialist, service, date/time, duration. "Confirm" and "Change" buttons.
Reminders
After successful booking, the bot schedules a reminder. Options:
- Push notifications 24 hours and 2 hours before — via FCM/APNs
- SMS via Twilio or SMS.ru — for those who disabled push
- Add to device calendar —
EventKiton iOS,CalendarContracton Android
Users choose method at confirmation.
Development Process
Analyzing target scheduling system, API documentation.
Developing NLP logic for time parsing and slot selection.
Server side: dialog state machine, calendar/booking API integration, slot reservation.
Mobile UI: inline date/time selection components, confirmation card.
Testing with real edge cases: all slots occupied, working/non-working days, midnight transitions.
Timeline Estimates
Appointment bot with basic NLP and Google Calendar API plus mobile UI — 1–2 weeks. With custom scheduling system, multiple specialists/services, SMS reminders — 3–4 weeks.







