Autonomous AI Assistant
Problem
Repetitive ops work — email triage, daily briefings, record-keeping, deployments, server health checks — consumed hours that should go into building. The context-switching cost was the real killer.
Solution
An autonomous assistant on my own infrastructure: it administers a production mail stack (Exim/Dovecot with DKIM signing), sends verified mail, keeps persistent memory across sessions, and runs daily briefings — all without human prompting.
Architecture
- Core: Python 3.12 + asyncio + LangGraph for agent orchestration
- Mail: Exim 4.99 + Dovecot + OpenDKIM (all self-hosted, full DKIM/SPF/DMARC)
- Memory: SQLite + vector embeddings (local, no cloud) for persistent context
- LLM: Groq (Llama-3.1-70B) for reasoning, local embeddings (sentence-transformers)
- Scheduling: systemd timers + custom cron daemon for precision
- Monitoring: Custom Prometheus exporter + Grafana dashboard
Capabilities
Email Pipeline
- Fetches via IMAP, classifies (urgent/actionable/noise) with LLM + rules
- Drafts replies for review; sends via Exim with DKIM signing
- Maintains 11-check regression suite for mail stack (DKIM, SPF, DMARC, rDNS, TLS, queue health)
Daily Briefing
Runs 06:00 UTC. Fetches: calendar, GitHub notifications, server health (disk, CPU, mail queue, SSL expiry), security alerts, bug bounty program updates, deployed PRs. Formats as markdown, sends via mail, posts to Slack.
Server Ops
- Monitors: disk, CPU, RAM, mail queue, SSL certs (30-day warning), Docker container health
- Auto-renews Let's Encrypt certs, reloads nginx
- Deploys tagged releases: pulls image, runs migrations, health checks, rolls back on failure
Persistent Memory
SQLite + vector store. Every interaction, decision, and observation stored with embeddings. Retrieval via semantic search + recency weighting. Context window managed via summarization + importance scoring.
Testing & Reliability
The assistant maintains an 11-check email regression suite that must stay green after every server change — the same discipline this site's deploys go through.
# Regression suite (runs before any deploy)
1. DKIM signing works (test key + selector)
2. SPF passes (alignment check)
3. DMARC policy enforced (reject/quarantine)
4. rDNS matches hostname
5. TLS 1.2+ only, secure ciphers
6. Queue depth < 100 (no backlog)
6. IMAP/Dovecot authentication works
7. DKIM verification of outbound mail
8. SPF alignment (header From vs envelope)
9. DMARC report parsing works
10. Bounce processing works
11. Reply routing (alias to Gmail + Maildir)
Results
- Time saved: ~15 hrs/week of ops work automated
- Email reliability: 99.9%+ delivery, zero DKIM failures since deploy
**Context retention:** Full memory across restarts, deployments, months- Zero-downtime deploys: 50+ successful, zero rollbacks needed
Key Technical Decisions
- Self-hosted mail over SaaS: Full control, DKIM keys never leave server, no per-email costs
- Local embeddings over API: Zero latency, zero cost, privacy, works offline
- SQLite for memory: Zero config, portable, ACID, fast enough for single-agent
- LangGraph over custom loops: Structured state machines, built-in persistence, debugging
- Systemd over cron: Precision timing, logging, dependency management, restart policies
What's Next
- Multi-agent delegation (researcher, coder, reviewer sub-agents)
- Voice interface (local Whisper + TTS)
- Proactive anomaly detection (learn normal patterns, alert on deviation)
- Cross-server fleet management (manage multiple VPS from single agent)
Private infrastructure — no public demo by design. Back to Case Studies