Plans die in the group chat. Someone says “game night Saturday?”, five people reply, and nobody makes the calendar invite.
So I built a bot with one phone number. The group texts it the way they’d text a friend, and it turns that into a real event on a shared Google Calendar. No app to install and no link to click.
One text, start to finish
you: game night sat 7 at sam's
bot: Got it! I still need how long it will run.
you: 3 hrs
bot: Please confirm the event details:
Title: Game Night
Date: 2026-12-05
Start Time: 19:00
Duration: 180 minutes
Location: Sam's
Description:
Reply 'Y' to confirm or 'N' to cancel.
you: Y
bot: Game Night is on the calendar for Sat Dec 5, 7:00 PM at Sam's.
Those are the bot’s real replies. Every event needs a title, date, start time, duration and location. Whatever is missing, it asks for, and nothing touches the calendar until you say Y.
The rule: the LLM returns JSON, Python decides
This is the design choice the whole project hangs on. The model has one job: read a text and fill in a fixed set of fields.
{
"intent": "create",
"title": "Game Night",
"date": "2026-12-05",
"start_time": "19:00",
"duration": null,
"location": "Sam's",
"description": null,
"rsvp": null
}
It never decides what happens next. Plain Python reads those fields and does the rest: asking for what’s missing, confirming, checking permissions and calling Google Calendar.
That keeps the bot predictable. A few guardrails make it hold:
- JSON mode at temperature 0, and the model is told to use
nullfor anything the text doesn’t say. Guessing a date is worse than asking. - Today’s date goes into the prompt on every call, so “next Friday” is right even on a server that has been running for weeks.
- The text is treated as data, not instructions. The prompt says so, and nothing the model returns can do anything by itself anyway.
- Python checks every field. An unknown intent becomes
other, a duration has to be a positive whole number, and strings get trimmed and capped.
If the model is wrong, the worst case is a wrong field on a confirmation message that you then say N to.
More than “create an event”
The same loop handles ten other intents: edit, cancel, list, RSVP (“I’m in for game night”), who’s coming, announce, review, add a person, and change your name.
There are three roles:
- Members propose events, which go into an approval queue, and RSVP.
- Organizers approve proposals, create, edit and cancel events, and send announcements to everyone attending.
- The admin can do all of that and add people to the group.
Unknown phone numbers get no reply at all.
It also warns you when a new event overlaps an existing one. Everyone who RSVP’d yes or maybe gets a reminder text 24 hours before and again 2 hours before.
The unglamorous parts
Most of the work wasn’t the AI. It was making a text-message bot behave:
- Twilio’s 15-second limit. Twilio stops waiting for a reply after 15 seconds, and group texts go out one at a time. So announcements and notifications go out on a background thread, and the reply comes back right away.
- Double texts. Each phone number gets its own lock, so two quick texts can’t corrupt the event being drafted.
- Restarts. In-progress conversations are saved in SQLite, so a deploy mid-conversation doesn’t lose your draft. Abandoned drafts expire after 30 minutes.
- Spoofed requests. Every incoming webhook has its Twilio signature checked. Anything that fails gets a 403.
Testing without a phone
smoke_test.py runs the whole bot end to end with a fake calendar and a fake model, on a throwaway database. It needs no internet and no API keys, and it ends with ALL GOOD. So the conversation logic can change without texting the real number to check it.
Getting it live
The stack is FastAPI for the webhook, Groq for the model, the Google Calendar API through a service account, Twilio for SMS, and SQLite for storage. It needs an always-on host with a disk that survives restarts, because reminders run in a background loop. Free tiers that sleep or wipe the disk won’t work, so it’s set up to deploy on Railway with a health check.
The surprise was carriers. US carriers block texting from unregistered numbers. A local number needs A2P 10DLC registration, and a toll-free number needs toll-free verification. Either one can take days. A Twilio trial account can’t run the bot end to end either. Start that paperwork early.
The code isn’t public, but I’m happy to walk through it.