Inspiration

Most safety apps ask you to act when you're least able to: check in, hit a panic button, share your live location. On a night out, phones die and nobody wants to be the one who raises an alarm. The first real sign something is wrong is usually that someone is gone. We wanted the phone to notice that gap and tell the right friend, without anyone pressing anything.

What it does

BathroomBestie is an autonomous safety net that watches behavior, never condition. Say your night in a sentence and Gemini turns it into a contract. If you leave your group alone, go still, or miss your home deadline, alerts climb a ladder of friends, one step per acknowledgement timeout. Nothing contacts authorities, and there are no check-ins, no panic button and no live GPS.

How we built it

  • A pure engine: evaluate(contract, state, evidence, actions, now) never reads the clock, and logs are append-only, so any night can be replayed.
  • Confidence of normal, scored over four behavioral streams (corridor, movement, freshness, separation):

$$N = \exp!\Big(-\sum_i w_i \max!\big(0,\, x_i/\tau_i - 1\big)\Big)$$

  • Gemini at setup only. Alerts come from fixed templates, and a test scans them for banned words.
  • Privacy by construction: coordinates are rounded to about 100 m, the home geofence stays on the phone, and the server only learns "arrived," enforced in the schema, the API and a database constraint.
  • Stack: TypeScript monorepo, Fastify API, Postgres/TimescaleDB, Expo/React Native.

Challenges we ran into

  • Silence is ambiguous. A dead battery, lost signal and real trouble look alike, so we classify silence and suppress the uninformative kind.
  • False alarms versus speed. We built a 14-scenario simulator and measured each preset. Standard gives about 0.11 false alerts per normal night and a median 23 minutes to alert.
  • Alerting without inferring health. Every message is observable behavior or an attributed human report.

What we learned

Putting rules in data and pure functions makes a safety system testable and explainable. Deciding what not to build made it more trustworthy. Simulation beat tuning by feel.

Built With

Share this project:

Updates

Submission history