Here's my problem: I study something once and completely forget it exists until the moment I actually need it, usually mid-interview, when it's too late.
I wanted to fix this without adding another thing to my already full plate. So I built two things:
- An automated script that runs every morning at 8am, picks random topics from everything I've studied, and sends me a plain-text summary to iMessage. No app to open, no habit to build, it just shows up.
- An interactive study agent using Antigravity CLI that I can talk to anytime. I ask it to quiz me, it quizzes me. I ask it to fill gaps in my notes, it tells me exactly what's missing.
The cool part: I take notes in Obsidian, and instead of syncing or exporting anything, I used symlinks to point the AI directly at my actual Obsidian files. Edit in Obsidian, agent sees it instantly. One source of truth.
Here's exactly how I built it.
The morning automation
The script itself is straightforward.
It sets the path to my Obsidian vault, walks through every folder, and collects all the .md files into a list. Then it picks one randomly using random.choice(), reads its content, and builds a prompt telling Gemini what to do with it: summarise this note, plain text, no markdown, keep it short.
The API call goes directly to Gemini, response comes back as JSON, and I extract the actual text from data["candidates"][0]["content"]["parts"][0]["text"]. Then an AppleScript — macOS's built-in automation language — tells the Messages app to send it to my number.
Run the script, summary lands in iMessage. Simple.
Here's the full script:
import os
import random
import subprocess
import urllib.request
import urllib.error
import json
import time
# auto scan entire Obsidian vault for all markdown notes
vault_path = "/Users/your-username/Documents/Obsidian Vault"
notes = []
for root, dirs, files in os.walk(vault_path):
for file in files:
if file.endswith(".md"):
notes.append(os.path.join(root, file))
if not notes:
print("No notes found in Obsidian vault")
exit(1)
# pick one random note
picked = random.choice(notes)
note_name = os.path.basename(picked)
with open(picked, "r") as f:
content = f.read()
# build prompt
prompt = f"""You are a system design study assistant for an MSCS student.
Below are the student's personal notes on "{note_name}".
Read them and give a concise morning summary in plain text — no markdown, no asterisks, no bold, no bullet symbols.
Format exactly like this:
TOPIC: <topic name>
WHAT IT COVERS: one line overview
KEY CONCEPTS:
1. first concept
2. second concept
3. third concept
KEY TAKEAWAY: one line the student must remember
WATCH OUT FOR: one common mistake or tricky part
Keep it short and sharp — this is a morning refresh, not a lecture.
Notes:
{content}
"""
# call Gemini API with retry
api_key = os.environ.get("GEMINI_API_KEY")
url = f"https://generativelanguage.googleapis.com/v1beta/models/gemini-3.5-flash:generateContent?key={api_key}"
payload = json.dumps({
"contents": [{"parts": [{"text": prompt}]}]
}).encode("utf-8")
summary = None
for attempt in range(3):
try:
req = urllib.request.Request(
url,
data=payload,
headers={"Content-Type": "application/json"},
method="POST"
)
with urllib.request.urlopen(req) as response:
data = json.loads(response.read())
summary = data["candidates"][0]["content"]["parts"][0]["text"]
break
except urllib.error.HTTPError as e:
if e.code == 429:
print(f"Rate limited, waiting 30 seconds... (attempt {attempt+1}/3)")
time.sleep(30)
else:
raise
if not summary:
print("Failed after 3 attempts, try again later")
exit(1)
# send via iMessage
imessage_target = "your-imessage-target" # your phone number or Apple ID
applescript = f'''
tell application "Messages"
set targetService to 1st service whose service type = iMessage
set targetBuddy to buddy "{imessage_target}" of targetService
send "{summary}" to targetBuddy
end tell
'''
subprocess.run(["osascript", "-e", applescript])
print("Summary sent to iMessage!")
print(summary)
For scheduling, I used launchd: macOS's built-in task scheduler. You write a .plist file describing three things: what script to run, when to run it, and where to save the logs. Load that file into launchd and it handles everything from there.
Here's the plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.harsh.sysdesign</string>
<key>ProgramArguments</key>
<array>
<string>/opt/homebrew/bin/python3</string>
<string>/Users/your-username/Documents/system-design-study/sysdesign-morning.py</string>
</array>
<key>EnvironmentVariables</key>
<dict>
<key>GEMINI_API_KEY</key>
<string>your-gemini-api-key</string>
</dict>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>8</integer>
<key>Minute</key>
<integer>15</integer>
</dict>
<key>StandardOutPath</key>
<string>/Users/your-username/Documents/system-design-study/sysdesign-morning.log</string>
<key>StandardErrorPath</key>
<string>/Users/your-username/Documents/system-design-study/sysdesign-morning.log</string>
</dict>
</plist>
One problem: launchd runs at 8am but my Mac might still be asleep. So I used pmset to schedule an automatic wake at 7:55am every day:
sudo pmset repeat wakeorpoweron MTWRFSU 07:55:00
One requirement — the Mac needs to be plugged in and in sleep mode, not fully shut down. Just close the lid at night and you're good.
The interactive study agent
For the interactive part, I used Antigravity CLI — Google's new agentic coding tool. The idea is simple: instead of asking AI generic questions about system design, I wanted it to know MY notes and quiz me on what I actually studied.
Two files make this work.
AGENTS.md sits at the root of my project folder. It tells the agent who I am and how to behave — think of it as a letter you write to the AI before the conversation starts. It loads automatically every time I open that folder.
SKILL.md lives inside .agents/skills/system-design/.
---
name: system-design-notes
description: Use this skill when the user asks about system design, HLD, LLD, DDIA, distributed systems, architecture patterns, or wants to be quizzed on any system design topic they have studied.
---
You are a system design study partner for an MSCS student preparing for software engineering interviews.
The user's personal Obsidian notes are in references/:
- references/HLD/ → High Level Design notes
- references/LLD/ → Low Level Design notes
- references/DDIA/ → Designing Data Intensive Applications notes
Treat these notes as the source of truth over your general knowledge.
When quizzing:
- Ask one question at a time
- Wait for the user's answer before responding
- Compare their answer to the notes and point out specific gaps
- Tell them which note/topic the answer came from
When filling gaps:
- Point out what's missing or shallow in their notes on a topic
- Suggest what they should add
It has two parts — a description that tells the agent when to activate this skill, and a body that tells it how to behave once it does. When I type "quiz me on consistent hashing", Antigravity reads the description, finds a match, and loads my notes into context automatically. I never call it by name.
Folder structure:
system-design-study/
├── AGENTS.md
└── .agents/
└── skills/
└── system-design/
├── SKILL.md
└── references/
├── HLD → Obsidian/HLD Concepts
├── LLD → Obsidian/LLD
└── DDIA → Obsidian/DDIA
The notes themselves are linked via symlinks:
ln -s ~/Documents/Obsidian\ Vault/HLD .agents/skills/system-design/references/HLD
This creates a pointer inside the project that points to my real Obsidian folder. The agent reads through the pointer. I edit in Obsidian. Same file, always fresh, zero maintenance.
Now when I open the folder and type "quiz me on HLD", it quizzes me using my own notes — not generic internet knowledge.
What broke
Three things gave me the most trouble.
First, the Gemini API kept returning 429 — Too Many Requests — even on a fresh key with zero usage. Turned out my key was tied to a VS Code project that the Gemini extension was quietly burning through in the background. Creating a new key under a separate project fixed it immediately.
Second, figuring out the Mac wake issue. launchd can schedule a script but if your Mac is asleep, it won't run. I needed pmset to wake the Mac before the script fires. And it only works when plugged in — if the laptop is on battery and closed, nothing wakes it. The fix is simple: just don't shut down, close the lid instead. But it took me a while to figure out why the automation wasn't running at all.
What my mornings look like now
I wake up, check iMessage, and two summaries are sitting there. One with 5 random LeetCode problems and their approaches. One with a random system design topic from my Obsidian notes.
It takes two minutes to read both. I'm not learning anything new — I'm just keeping what I already studied from fading. That's the whole point.
For the interactive part, I open the terminal and type:
cd ~/Documents/system-design-study
agy
Then just talk to it. "Quiz me on HLD." "What gaps do my DDIA notes have?" It responds using my actual notes. It's like having a study partner who has read everything I've written.
Was it worth it?
Yes. It took a day. But, the system runs every morning without me doing anything. The only maintenance is adding one line to a text file every time I solve a LeetCode problem.
If you're an MSCS student or prepping for interviews, the setup is worth it. You don't need any prior knowledge of AI agents or macOS automation. You just need a free Gemini API key from AI Studio and a few hours.
The code is straightforward enough that you can adapt it to whatever you study. Swap the Obsidian vault for any folder of markdown files. Change the iMessage target to email or Telegram. Run it on whatever schedule works for you.
Built with: Antigravity 2.0 CLI, Gemini API (free tier), Python, launchd, pmset, AppleScript, Obsidian


Top comments (1)
trying to build habits manually. What's your stack look like for the SMS delivery?