Keep a diary automatically

Programmable way to keep a diary

April 09, 2023

Everyone would agree on the importance of keeping a diary, but they would also acknowledge the challenge of maintaining motivation to write one. For me, the biggest issue was the difficulty in recalling what I did during the day when writing a diary at night, which ultimately led to a loss of motivation.

Me giving up keeping a diary

Me giving up keeping a diary

One day, I had an epiphany that I had been unknowingly maintaining another diary: I consistently use my TODO list app to manage most stuff of my daily life, and a list of tasks marked as completed in a day well depicts what I did during that day! Additionally, the day’s weather can be obtained from other data sources. I keep my schedule on Google Calendar. I realized that aggregating this information could create a comprehensive diary entry for the day.

My TODO list is like this

My TODO list on TickTick is structured as follows: I note down tasks (both physical and mental), along with some ideas and miscellaneous notes.

Following this observation, I began to automatically keep my diary by storing this data. This blog post introduces the automation pipeline for achieving this.

Storage: BigQuery

I use BigQuery for data storage. Although it’s not specifically optimized for diary purposes, you can build a viewer on top of it. (I’m OK to view my diary by querying BigQuery.) BigQuery is also useful when integrating with various data sources.

Data flow to BigQuery

Data flow to BigQuery.

Data Flow

I developed a simple Python function using cloud functions to store data in my BigQuery. When a trigger (such as task completion, weather broadcast, or CarPlay activation) is activated, automation tools send an HTTPS request to the function with the trigger information. The function then writes the data to BigQuery. All the services used in this process are serverless, meaning that there is no need to keep a compute instance running continuously.

Data are stored like this

Data are stored like this.

And.. that’s it!

Future work

Some people may argue that it is not a “diary” entry but rather a collection of data records. While I understand this perspective, I believe that just summarizing the data into a natural language paragraph would result in a more natural diary entry. I think generative AI would be well-suited for this task, and I plan to give it a try in the near future!

Profile picture

Thank you for reading this article! This article is written by Wataru Hirota (email: {my_first_name} Please follow me on Twitter  or connect via LinkedIn  if you're interested in articles like this. :)

© 2023 Wataru Hirota