‘memba?: Twilio & Vertex AI Reminder System for Seniors who don’t ‘memba.

‘memba?: Twilio & Vertex AI Reminder System for Seniors who don’t ‘memba.

Image description
✨ As part of dev.to Twilio AI challange me and @isitayush crafted a digital guardian angel for seniors (not you… probably).

Here’s how ‘memba works:

  1. You simply send an SMS message to a designated Twilio phone number +44 7822 021078. The message should be formatted like this: Remind me to take medicine on 24nd June 18:00.

  2. Twilio sends SMS to our Node.js/Express.js app container.

    ⚡ This app is containerized using Docker Hub and run using Google Cloud Run (hail automation).

  3. The Cloud Run application forwards the SMS content to Vertex AI (Gemini LLM), with our predefined instructions.

Functionality:Parse reminder text into JSON format.
Input:The text of the reminder and/or date, time.Output:JSON string in the format: {'reminder_text': "<text>", 'reminder_datetime': "<ISO 8601 extended format>"}.
Don't include any introduction text likt "Hello...", "Remind me to...", "Please..." in reminder_text. Error handling:If the reminder text doesn't follow the expected format (e.g., missing date/time), return an empty JSON string {}.
If the date/time is not set or can't be parsed, return an empty JSON string {}.
If reminder_text is empty or not set, return an empty JSON string {}.
If date is set, but time is not set, use current time. If time is set, but date is not set, use current date.
Don't return the JSON string as markdown.
Do not delimit the output JSON with anything.
If reminder text contains abstract date, time meanings like "tomorrow", "next week", "next month", etc. then convert them to date, time as ISO8601 extended format - for example, "tomorrow" becomes <current_date> + 1 day or "next week" becomes <current_date> + 7 days, etc.
Enter fullscreen mode
Exit fullscreen mode
  1. Vertex AI then translates the extracted information into a structured JSON format like this:
{ "reminder_text": "take medicine", "reminder_datetime": "2024-06-24T18:00:00.000Z"
}
Enter fullscreen mode
Exit fullscreen mode
  1. We then send the JSON out to our Cloud SQL MySQL database and store it (we chose to use Prisma in our Node.js app).

  2. Then a background job (we also put it directly in our Node.js app) runs every minute. This job scans the database for reminders scheduled within the next minute.

  3. For identified reminders, the job triggers an SMS notification back to the senior’s phone via the Twilio API precisely at the set “reminder_datetime”.

Demo

  • Send your SMS reminder (for example, Remind me to take medicine on 24nd June 18:00) to +44 7822 021078.

⚡ We bravely topped up our Twilio account.

  • You can also fork our solution from here: richardevcom/memba
  • Check out our landing page (yeah, because why not?): ‘memba?
  • Here is a quick demo video:

Discover more from Coursity

Subscribe to get the latest posts sent to your email.

Leave a Comment

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply

    Your email address will not be published. Required fields are marked *