Autobot


Autobot is an automation system built with Google Apps Script that integrates Gmail, Google Calendar, and Google Sheets to manage personal productivity tasks, reminders, and tracking. It processes incoming text messages (via Google Voice emails) and executes predefined actions such as logging food, tracking workouts, creating documents, sending reminders, and interacting with OpenAI’s GPT API.


July 15th, 2017


#emgineering #google-apps-script

Project Summary: Autobot

Overview

Autobot is an automation system built with Google Apps Script that integrates Gmail, Google Calendar, and Google Sheets to manage personal productivity tasks, reminders, and tracking. It processes incoming text messages (via Google Voice emails) and executes predefined actions such as logging food, tracking workouts, creating documents, sending reminders, and interacting with OpenAI’s GPT API.

The project is designed as a self-contained personal assistant that continuously monitors periodic triggers and intake messages, then logs results, replies to messages, or updates spreadsheets/calendars accordingly.

Motivation

The creation of Autobot was motivated by my heavy reliance on Google tools for self‑tracking, note‑taking, and managing many aspects of daily life. While Google Sheets, Calendar, Docs, and Gmail provide powerful capabilities, they are not always mobile‑friendly in the way I needed for quick interactions on the go.

I wanted to make it easier to interact with these Google services in a lightweight, mobile‑accessible way. The most natural interface for this turned out to be text messaging, which is already integrated into daily routines. By leveraging Google Voice as a phone number for SMS intake, I could create a simple text‑based control panel for my personal productivity system.

This approach bridges the gap between the structured data of Google APIs and the immediacy of mobile communication. Instead of opening apps or navigating web interfaces, I can now log meals, track workouts, mark medications, create documents, or get summaries simply by sending a text message. Autobot processes these commands automatically and syncs them back into my Google ecosystem, unifying convenience with structure.

Key Features

  • Automated Tracking: Logs self-tracking data (weight, food, workouts, habits).
  • Calendar Integration: Parses natural-language event strings into Google Calendar events.
  • Gmail Automation: Archives threads, sends summaries, and replies to intake messages.
  • Health & Habits: Medication reminders, workout logging, food tracking.
  • Productivity Tools: Automatic weekly sheet extension, document creation, task summaries.
  • AI Assistance: Direct integration with OpenAI’s GPT API for conversational queries.
  • GitHub Automation: Can read/write repo files programmatically for updating assets (e.g., pix.yaml).

Example Usage

  • Send a text: "food banana 100 cals" → logs banana intake in Sheets.
  • Send a text: "doc Meeting Notes …" → creates a Google Doc with that content.
  • Send "ping" → Autobot replies "pong".
  • Send "gpt summarize today’s plan" → forwards to ChatGPT and returns the response.
  • Autobot automatically calculates daily tracking percentage and writes it to Sheets & Calendar.

Strengths

  • Extensible architecture: modular action classes make it easy to add new automations.
  • Deep Google Workspace integration: seamless use of Sheets, Calendar, and Gmail.
  • Personal assistant functionality: supports a wide range of productivity and wellness tasks.
  • Automated scheduling: periodic tasks reduce manual overhead.

Appendix: Core Components

  • Main Loop (main.js): Executes tests, loads Google Sheet, processes Gmail messages, runs periodic and intake tasks.
  • Tasks (TASKS.js): Defines periodic tasks (scheduled) and intake tasks (triggered by SMS/email commands).
  • Actions (src/*Action.js): Encapsulates automation features: GptAction, CreateDocAction, TrackingRatioFilledAction, FoodAction, LastFoodAction, WorkoutAction, MedsTakenAction, ArchiveAutobotEmailsAction, SummaryAction, PingPongAction, etc.
  • Utilities (MISC.js): Spreadsheet, Gmail, Calendar, GitHub integration, and helper functions like formatUSD, formatAsPercentage, truncateWithEllipses, etc.
  • Constants (CONSTANTS.js): Stores spreadsheet URLs, GitHub access tokens, regex patterns, and calendar names.

This site is open source. Improve this page »