Personal AI Operating System
A second-brain pipeline that turns Telegram bot captures (stored in D1) into organized notes, weekly focus, and automated daily digests, with role-specific AI agents handling triage and reviews under human approval.
How it works
- Step 1
Capture
One Telegram message, about three seconds, no classification at capture time. Links, thoughts, and to-dos all go the same way.
- Step 2
Store
A Cloudflare Worker saves each message to D1. A daily cron commits the day to a GitHub journal that is never edited afterwards.
- Step 3
Triage
In Claude Code sessions I start myself, role-specific agents file captures into notes, propose the week’s focus, and review the week. Anything that needs judgment waits for my approval.
- Step 4
See
A private dashboard shows this week’s focus, recent captures, and project status, behind a token plus one-time-code login.
Architecture
The top row is plain code: Telegram delivers the message, and the Worker and cron handle it. The amber box is where AI does its work: it reads the repository, commits its results back, and only runs when I open a session.
Design decisions
Git is the source of truth, not the database
D1 only buffers captures until the daily commit. Everything else is plain Markdown in a repo, so it is versioned, diffable, and readable by any tool. Media lives in R2 so the repo stays text-only.
AI proposes, a human approves
The agents are instruction files (Librarian, Planner, Reviewer) that a Claude Code session reads and follows. I trigger them, and judgment calls are asked one at a time instead of being decided silently.
Infrastructure cost is $0 by design
Workers, D1, cron, and R2 all run on free tiers. Every new feature gets checked against those limits before it is built.
Least privilege for a system full of personal notes
The dashboard needs a token and a TOTP code, then issues a signed 30-day session. The token that writes to the journal repo is separate from the read-only one used to list repositories.
What it is not
The Worker and the cron job contain no LLM calls. They only receive, store, commit, and send a plain status message with counts. The AI work happens in Claude Code sessions that I trigger, guided by instruction files in the repository, and nothing that needs judgment is applied without my approval.
Stack
The repository is private because it holds my personal notes. I am happy to walk through the architecture and the code on a call.