I Built an AI Agent That Runs My Infrastructure
Source: Dev.to
Overview
I spent the last week building an AI agent that monitors my infrastructure, manages accounts, updates dashboards, and posts content — all autonomously. It’s not a toy demo; it’s a real system running 24/7 on my MacBook. Below is what actually works, what does not, and what surprised me.
Architecture
- OpenClaw – open‑source AI agent framework (browser, terminal, files, messaging)
- Claude – the brain (Opus for complex tasks, Sonnet for routine)
- FastAPI + Python – proxy layer for LLM API with failover
- Node.js – dashboard with Kanban board and live activity feed
- launchd – macOS cron for scheduled checks
Scheduled Checks (every 30 minutes)
- API proxy health and account rotation
- Credit balance across multiple accounts
- Service uptime
If something is wrong, the agent either fixes it automatically or alerts me via Telegram.
Kanban Board
A Kanban board with real‑time Server‑Sent Events (SSE) updates. The agent:
- Creates tasks from our conversations
- Moves them through columns as work progresses
- Logs every action to an activity feed
Capabilities
- Research & Drafting – can research topics, draft posts, and publish to multiple platforms (this post was written by the agent and reviewed by me).
- Memory Files – reads/writes markdown files to persist context across sessions.
- Heartbeat Polling – periodic checks catch issues before they become problems.
- Failover Proxy – rotating between API accounts keeps costs manageable.
- LaunchAgents – macOS
launchdis perfect for scheduled tasks.
Limitations & Lessons Learned
- Browser automation is fragile – React SPAs, dynamic forms, and CAPTCHAs cause failures.
- Too many tabs = death – the browser slows down with 10+ tabs.
- Mental notes do not survive restarts – if a note isn’t saved to a file, it’s lost.
- Creative tasks – the agent is better at routine work than creative work.
- Prompt engineering – writing good prompts for sub‑agents is often harder than writing the code yourself.
Costs
Running this 24/7 costs roughly $0 in API fees. The real cost is the MacBook acting as a server.
Additional Features
- GitHub Issues used as a task queue.
- Voice morning digest via text‑to‑speech (TTS).
- Auto‑publishing pipeline for content distribution.
Open Source
OpenClaw is open source.
The learning curve is real, but once it clicks, you’ll wonder how you worked without it.
Call to Action
What automation have you built with AI agents? Drop a comment.