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

✨ 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:

You simply send an SMS message to a designated Twilio phone number +44 7822 021078. Th…


This content originally appeared on DEV Community and was authored by richardevcom

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.
  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"
}
  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?
  • Finally, here's a quick screen-recording/demo:


This content originally appeared on DEV Community and was authored by richardevcom


Print Share Comment Cite Upload Translate Updates
APA

richardevcom | Sciencx (2024-06-24T18:34:03+00:00) ‘memba?: Twilio & Vertex AI Reminder System for Seniors who don’t ‘memba.. Retrieved from https://www.scien.cx/2024/06/24/memba-twilio-vertex-ai-reminder-system-for-seniors-who-dont-memba/

MLA
" » ‘memba?: Twilio & Vertex AI Reminder System for Seniors who don’t ‘memba.." richardevcom | Sciencx - Monday June 24, 2024, https://www.scien.cx/2024/06/24/memba-twilio-vertex-ai-reminder-system-for-seniors-who-dont-memba/
HARVARD
richardevcom | Sciencx Monday June 24, 2024 » ‘memba?: Twilio & Vertex AI Reminder System for Seniors who don’t ‘memba.., viewed ,<https://www.scien.cx/2024/06/24/memba-twilio-vertex-ai-reminder-system-for-seniors-who-dont-memba/>
VANCOUVER
richardevcom | Sciencx - » ‘memba?: Twilio & Vertex AI Reminder System for Seniors who don’t ‘memba.. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/06/24/memba-twilio-vertex-ai-reminder-system-for-seniors-who-dont-memba/
CHICAGO
" » ‘memba?: Twilio & Vertex AI Reminder System for Seniors who don’t ‘memba.." richardevcom | Sciencx - Accessed . https://www.scien.cx/2024/06/24/memba-twilio-vertex-ai-reminder-system-for-seniors-who-dont-memba/
IEEE
" » ‘memba?: Twilio & Vertex AI Reminder System for Seniors who don’t ‘memba.." richardevcom | Sciencx [Online]. Available: https://www.scien.cx/2024/06/24/memba-twilio-vertex-ai-reminder-system-for-seniors-who-dont-memba/. [Accessed: ]
rf:citation
» ‘memba?: Twilio & Vertex AI Reminder System for Seniors who don’t ‘memba. | richardevcom | Sciencx | https://www.scien.cx/2024/06/24/memba-twilio-vertex-ai-reminder-system-for-seniors-who-dont-memba/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.