In an era where 'production-grade' often implies Kubernetes clusters and managed queues, self-taught founder Asadulelah proves that a single VPS and some disciplined systemd configuration can keep an AI assistant running reliably 24/7. His setup, centered on an assistant named Ziggy, avoids heavy orchestration tools in favor of a Discord bot front-end, user-level systemd timers, and a robust, external alerting system. The architecture demonstrates that infrastructure complexity should scale with failure modes, not just feature requests.

The Minimalist Stack

The core of Ziggy’s infrastructure is a single Ubuntu VPS with 4 vCPUs and 16 GB of RAM. There is no Kubernetes, no message queue service, and no custom dashboard. Instead, the system relies on three pillars: a Discord bot acting as the sole interface, a Markdown-based notes vault synced via Syncthing for memory, and approximately thirty user-level systemd timers for scheduling. This approach reduces the attack surface for configuration drift and keeps the operational overhead low, allowing the builder to focus on the assistant's logic rather than the platform's plumbing.

Alerting Outside the Box

Asadulelah highlights a critical failure mode in early iterations: silent failures. A nightly maintenance job failed for twelve days because the subscription lapsed, and the system never notified him. To fix this, he implemented a two-layer alerting strategy. Layer one catches crashes using a ziggy-alert@.service template that triggers on OnFailure. Crucially, this alert script runs independently of the bot process, ensuring it works even if the bot itself is the thing that crashed. Layer two addresses 'silent successes'β€”jobs that exit with code 0 but do nothingβ€”by using a daily watchdog that checks last_run_at state files and alerts if they are stale.

Resource Management and Subscription Costs

Running an AI assistant on a small box requires strict resource capping. Asadulelah uses MemoryHigh=4G and MemoryMax=5G for the bot service to prevent out-of-memory kills from taking down the entire server. He also avoids API keys entirely, running jobs via claude -p logged into a Max subscription. A guard timer monitors usage, stopping background jobs at 80% of the 5-hour window and 90% of the weekly limit to preserve quota for interactive use. This decision prevents unexpected cloud bills from runaway automation, a common pitfall for developers using API-based agents.

The Watchdog Paradox

One of the most instructive parts of the write-up is the evolution of the watchdog itself. Initially, the alerting logic lived inside the user systemd manager. When the user manager exited cleanly on November 2, taking all user timers with it, the alerts failed silently. The solution was a root-level timer that checks the user manager every five minutes and restarts it if necessary. This reinforces a fundamental DevOps principle: the watcher must live outside the thing it watches. If your monitoring system depends on the same process space as your application, you are building a house of cards.

Practical Lessons from Failure

Asadulelah shares specific mistakes that cost him time and sanity. He learned that systemctl --user restart on a persistent timer fires the job immediately, requiring daemon-reload instead for schedule changes. He also discovered that letting the assistant restart its own bot service via systemctl restart ziggy-bot kills the process writing the response, leading to silence. The fix involves scheduling detached restarts using systemd-run with a delay, ensuring the current job completes before the service cycles. Additionally, he throttled alerts to one per unit every six hours after a crash-looping service sent over 500 DMs in a single night.

Key Takeaways

  • Use loginctl enable-linger to ensure user-level systemd timers survive logout and reboots.
  • Separate alerting logic from the application process to catch crashes that kill the app itself.
  • Cap memory usage with MemoryMax to prevent a single runaway job from crashing the VPS.
  • Prefer a 'rebuild kit' backup (configs, state, dumps) over full disk images for faster, more reliable recovery.
  • Always test your alerting system by intentionally failing a service; an untested alert is just a guess.

The Bottom Line

Asadulelah’s setup is a masterclass in pragmatic infrastructure. It proves that you don't need enterprise-grade tools to run a reliable AI agent, but you do need to respect the boundaries of your hardware and the opacity of silent failures. By keeping the stack simple and the observability external, he turned a hobby project into a resilient, self-healing system.