My mother lives alone in Mysuru. I live in Bengaluru. We talk on chat, but when something goes wrong, like a scam call or a health scare, nobody is watching that chat.
India's Home Ministry data shows that more than 1 lakh senior citizens have lost nearly ₹4,000 crore to cyber fraud. "Digital arrest" scams, where a fake CBI officer keeps a parent on a video call and demands money, are a big part of that. Engineering teams solved this kind of problem years ago with on-call rotations: someone always owns the pager. I wanted the same thing for my family. I built it for the Flip the Switch hackathon using Switch, the open-source layer that puts AI agents into team chats.
What Hearth does
Amma chats on Telegram, in her own mix of Kannada and English.
I work from a Discord channel, the family desk.
One self-hosted Switch server bridges both apps, so the agents and the context are shared across them.
Four agents run the workflow:
hearth-companion-a and -b are custom Python agents connected over the Switch agent protocol (WebSocket for events, HTTP for actions). They share an exclusive Switch role called companion. Only the holder answers Amma.
hearth-pulse is a deterministic pager with no AI. It turns alerts into incidents, pages me, re-pages if I don't acknowledge, and keeps an incident log as a Switch room document.
hearth-scribe is a Codex agent run by Switch Console. It keeps Amma's care book in git.
The scam scene
Amma types: "A CBI officer called. My Aadhaar is in a money laundering case. I must transfer 2 lakh."
Within milliseconds, a fixed safety reply goes to her: "Amma, idu scam… Duddu kalisbedi, OTP kodbedi. Call cut maadi."
Pulse opens an incident and pages me on Discord.
If I miss it, pulse pages me again 45 seconds later.
I reply ack, and Amma is told: "Shamanth nimge eega call maadtare" ("Shamanth is calling you now").
The safety sandwich
Rules first. A multilingual keyword layer (English, Kannada, Kanglish, Hindi) catches emergencies and scams without an AI model, so a slow or confused model can't delay the reply.
AI second. Gemini handles warmth and language, and reads prescription photos. It can raise a concern, but it can't overrule the rules. I tightened this live: the model once read an old scam from the chat history and mislabelled a harmless message, so now only the rules can declare a scam from text.
Humans confirm. The scribe proposes care-plan changes as a diff, and nothing is committed until a family member replies confirm.
Zero-downtime failover with Switch roles
This is the part that only works because of Switch. The companion role has a heartbeat lease. When I kill the laptop process that's answering Amma, Switch notices the missing pings, releases the lease within seconds, and the standby companion takes the role. It reads the room history and carries on. I wrote no leader-election code myself, and Amma never notices.
What I liked, and what I'd improve
Liked: role leases, bridging two chat apps into one server, and room documents as shared memory. The agent protocol is small enough to write a client in a day.
Rough edges: Console 0.40.1 has no API-keys page, so I created the registration key through the Gateway API. Telegram showed as "active" while it was timing out; the cause turned out to be an IPv6 route on my network. A supergroup migration created a fresh room with no agents in it.
Demo: https://youtu.be/lpd35yF_YUU
Code: https://github.com/MS-Shamanth/The-Hearth-Bot