Case studies / Personal AI assistant

A self-hosted AI assistant that plans the day and keeps it in sync with the calendar

A personal assistant that runs on the owner’s own server, talks over Telegram, and manages the working day: tasks in Notion, time in Google Calendar, and training and nutrition tracking.

Client
Private owner
Industry
Personal productivity
Service
Custom AI agent
Tools
Telegram, Notion, Google Calendar, TypeScript
0
critical issues and warnings in the platform’s security audit after hardening
14–20 s
AI replanning step, down from 34–71 seconds
~2.5 min
designed worst-case reaction to a calendar change, down from about 7.3 minutes

The brief

Build a personal assistant that runs on the owner’s own server, talks over Telegram, and manages the working day: tasks in Notion, time in Google Calendar, and training and nutrition tracking.

It had to be safe to leave running unattended, because it reads untrusted text (calendar invites, Notion pages) and can write to the calendar.

What we built

  • Daily operating loop. A morning brief (07:30 on weekdays, 09:00 on weekends) reads tasks and the live calendar, creates planning blocks, and sends the plan to Telegram. An evening review (20:30) checks what was done, and a weekly review runs on Sunday.
  • Calendar Watch, a custom TypeScript plugin. It polls Google Calendar every 60 seconds during the day and detects meaningful changes. A dedicated AI agent then re-plans only the assistant’s own planning blocks and never touches real meetings.
  • Fitness coach. It keeps the weekly training plan in Notion, puts today’s session on the calendar, and sends the workout programme about 15 minutes before it starts.
  • Guarded calendar tools. The assistant can create, change or delete events only on the owner’s explicit request, and never recurring events, events with other attendees, or events organised by someone else.
TelegramNotionGoogle CalendarTypeScriptSelf-hosted

Security audit and hardening

A read-only audit found serious problems, all fixed the same day:

  • Exposed services. Redis was open to the internet with no password, n8n was reachable over plain HTTP, and an old assistant instance was publicly accessible. All were closed, a host firewall was enabled, SSH was made key-only, and fail2ban was added.
  • Silent outage. Calendar sync had been failing for two days (559 failed polls) with no alert. The cause was a Google OAuth app left in “Testing” mode, where tokens expire every 7 days. The app was published and Telegram alerts were added for failures and recovery.
  • Prompt-injection containment. The assistant had a shell with access to every secret on the server. The shell and file-write tools were removed, replanning was moved to a separate minimal agent with five tools, and third-party connectors (Gmail, Calendar, Notion via the model provider) were switched off.
  • Adversarial testing. Each restriction was tested against the live agent. This exposed a bypass in which a sub-agent could still run shell commands; it was closed and retested.
  • Access. Telegram is restricted to the owner’s account and group chats are disabled.

The platform’s built-in security audit now reports 0 critical issues and 0 warnings.

Reliability and speed

  • Faster replanning. The AI step dropped from 34–71 seconds to 14–20 seconds. Designed worst-case reaction to a calendar change went from about 7.3 minutes to about 2.5 minutes.
  • No false triggers. A spurious replan that fired every night at midnight was eliminated, and the fix was replayed against real production history before deployment.
  • No lost changes. Edits made while a replan is running are now queued instead of dropped.
  • Bounded retries. A failed replan is retried at most 4 times, then the owner is alerted.
  • Safer state. All state writes go through a single queue with atomic saves.

Operations

  • Upgrades with a way back. Three platform upgrades were done with backups and a rollback image, each with 3–5 minutes of downtime.
  • One routine for every change. Back up, deploy, verify on real output, record in a dated log.
  • Project knowledge base. It keeps the specification, runbooks, lessons learned and status current across work sessions.

Have a process like this one?

Book a free 30-minute strategy call. We'll identify your biggest automation opportunities and outline a clear path forward.

Book a free strategy call