I've built over 50 AI agents. Most failed. The ones that survived all share the same skeleton.
Here's the exact template I use for every new agent — and why most people overcomplicate this.
The Problem with "Building an AI Agent"
Most tutorials start with:
- Complex frameworks
- Expensive cloud services
- Weeks of setup
I started there too. Wasted 40+ hours.
Then I realized: an AI agent is just a bash script + a timer.
That's it.
The Minimal Viable Agent
Every agent I build has exactly 5 parts:
1. The Worker Script (koi-worker-*.sh)
#!/bin/bash
# koi-worker-example.sh — Minimal agent template
set -euo pipefail
LOG="$HOME/.openwork/worker-example.log"
STATE="$HOME/.openwork/worker-example-state.json"
echo "[$(date)] Starting worker" >> "$LOG"
# Your logic here
# 1. Fetch data (API, web, files)
# 2. Process it (filter, analyze, decide)
# 3. Act (post, send, update)
# 4. Log results
echo "[$(date)] Worker completed" >> "$LOG"
2. The Timer (*.timer)
[Unit]
Description=Run koi worker every hour
[Timer]
OnCalendar=*-*-* *:00:00
Persistent=true
[Install]
WantedBy=timers.target
3. The State File (*-state.json)
{
"last_run": "2026-06-19T03:00:00",
"runs": 142,
"successes": 138,
"failures": 4,
"last_result": "ok"
}
4. The Log (*.log)
Simple append-only text. No fancy logging framework needed.
5. The Kill Switch
# Disable agent instantly
systemctl stop koi-worker-example.timer
What This Gets You
With just these 5 components, you can:
- Find freelance jobs automatically (Openwork worker)
- Post to social media on schedule (content worker)
- Monitor GitHub trending daily (trending worker)
- Track metrics across platforms (analytics worker)
- Generate leads from multiple sources (leads worker)
The Real Secret
The template isn't the hard part. The hard part is knowing what to automate.
My framework:
- Track your time for 1 week — What do you do repeatedly?
- Pick the most annoying task — Not the most important. The most annoying.
- Build a minimal agent — Just bash + timer. No frameworks.
- Run it for 1 week — Does it save time? Keep it. If not, kill it.
- Repeat — Add one agent per week.
Common Mistakes
❌ Starting with the tech
Don't pick a framework before you know what you're building.
❌ Building the "perfect" agent
A simple agent that runs beats a complex agent that doesn't.
❌ No kill switch
Every agent needs an off button. If it breaks, you need to stop it fast.
❌ No logging
If you can't see what happened, you can't fix it.
❌ Automating the wrong thing
If a task takes 2 minutes and you do it once a week, don't automate it.
The Numbers
After 6 months of building agents:
- 50+ agents built
- ~20 still running (the rest were experiments)
- ~15 hours saved per week
- ~€200/month in value (time saved + leads generated)
- Total setup cost: €0 (all free tools)
Get the Full Template
If you want the complete template with:
- Multi-model fallback chain
- Error handling patterns
- 3 real worker examples
- Step-by-step setup guide
→ AI Agent Template ($99): https://koihub.gumroad.com/l/koi-agent-template
It's the exact system I use. Copy it, modify it, ship it.
Building agents is a skill. Start simple, iterate fast, and automate the boring stuff.
Top comments (0)