DEV Community

Cover image for What I Learned Today: Building a Daily Haiku Agent That Runs on My Phone
Rahul Rathod
Rahul Rathod

Posted on

What I Learned Today: Building a Daily Haiku Agent That Runs on My Phone

Today I built something that feels small but is surprisingly full of learning: a daily haiku blog that runs entirely from my Android phone, posts to the web, and costs nothing in GitHub secrets or cloud APIs I don't control.

You can see it here: Daily Haiku


The Idea

Every morning at 7 AM UK time, my phone picks a poet—Bashō, Dickinson, Rumi, Yeats, and a dozen others—and asks an AI to write a haiku inspired by one of their poems. The haiku goes to a public blog, saved as markdown on the device, and I get a Telegram notification. All of it runs on my Samsung M30 in Termux.

What I Learned

1. You Don't Need the Cloud to Schedule Things

I used to assume cron jobs needed a server. They don't. Termux has cronie. With CRON_TZ=Europe/London you can run jobs at 7 AM UK time from your phone. The catch: the phone has to be on and Termux running. For a personal project that's fine. For something critical, you'd want a cloud cron—but that was the whole point: avoid putting secrets in GitHub.

2. Supabase Is a Great “No Backend” Backend

I didn't want to store API keys in GitHub. Supabase solved it: the phone inserts haikus with the anon key (plus an RLS policy to allow inserts), and the blog reads them. No server, no serverless functions, no env vars in the repo for sensitive stuff. The anon key can live in the frontend—it's designed for that. RLS does the rest.

3. Netlify + Static Files = Simple

The blog is static HTML, CSS, and JavaScript. It fetches from Supabase at load time. Deploy to Netlify, point a custom domain (or use a tinyurl), and it just works. No build step needed once the config is inline.

4. Python on Termux Doesn't Need Heavy Dependencies

The openai package failed to build on the phone (jiter, Rust, etc.). Swapping to raw requests calls to the OpenAI API fixed it. A few extra lines of code, zero new dependencies. Sometimes the “batteries included” package isn't worth the build cost.

5. PicoClaw Reuses Config Nicely

PicoClaw (the AI assistant on my phone) already has OpenAI and Telegram configured. The daily haiku script reads from ~/.picoclaw/config.json so I didn't duplicate keys. One config, many tools.

6. Voice Calls Without Twilio

We also set up Vapi for AI phone calls—no Twilio signup, no ngrok. Free US numbers for testing. For India/UK you'd import a number, but the flow is the same: POST to an API, Vapi handles the rest.


The Stack, Briefly

Part What I Used
Phone agent PicoClaw + Termux
Haiku generation OpenAI (gpt-4o-mini)
Storage Supabase (haikus table)
Blog Static HTML/JS, Netlify
Scheduling cron (Termux, 7 AM UK)
Notifications Telegram (via PicoClaw bot)

What's Next

  • See if the cron actually fires tomorrow at 7 AM
  • Maybe add an RSS feed
  • Tweak the poet list or the system prompt

The haikus are at tinyurl.com/haiku-agent.

Top comments (0)