Free Guide — No Signup Required

Agent Reliability Playbook

7 patterns that made my AI agent automations run 60+ days straight on a $35 Raspberry Pi. Battle-tested, not theoretical.

Why trust this? I run 15+ daily automations on a Raspberry Pi — morning briefings, content pipelines, geopolitical analysis, daily video learning. These patterns came from debugging real failures over months. Every pattern below was discovered because something broke at 3 AM and I had to fix it.

Pattern 1: Template-Driven Output

Fixed structure, variable content

The #1 reliability killer: freeform generation. Your agent outputs something different every time, and eventually it produces garbage.

Instead of "Write a morning briefing", use a template with fill-in sections:

## Morning Briefing — {{date}}

### 🌅 Weather
{{weather_summary}}

### 📅 Schedule
{{calendar_events}}

### 📰 AI News
{{news_summary_3_items}}

### 📊 Markets
{{market_snapshot}}

The agent fills in {{variables}} instead of deciding the structure. Result: consistent output, every single time.

Pattern 2: Independent Data Fetches

One API failure ≠ total failure

Your briefing needs weather, calendar, news, and market data. If the news API returns a 503, the whole briefing shouldn't die.

Wrap each data fetch in its own error handler:

def fetch_weather():
    try:
        return get_weather_data()
    except Exception as e:
        return "⚠️ Weather unavailable"

def fetch_news():
    try:
        return get_news_data()
    except Exception as e:
        return "⚠️ News unavailable"

The briefing still delivers — just with one section marked unavailable instead of the whole thing failing.

Pattern 3: Heartbeat Backup

Scheduled cron + heartbeat redundancy

Your 6:40 AM cron fires the briefing. But what if the server was restarting at 6:40? You get nothing.

Add a heartbeat check: every 30 minutes, the agent checks "did the daily briefing run today?" If not, it runs it. Two independent triggers, either one works.

# Cron: 6:40 AM daily
schedule: { kind: "cron", expr: "40 6 * * 1-5", tz: "America/Denver" }

# Heartbeat: checks every 30 min, fires if briefing hasn't run
# Implemented as a systemEvent in the heartbeat cron

Result: even if the server restarts, the briefing catches up within 30 minutes.

Pattern 4: Fail-Silent, Log-Loud

Never crash silently

When a tool call fails, your agent has two choices: crash or continue. Always continue — but log the failure for debugging.

My health monitor runs every 6 hours and reports if any cron has failed 3+ times in a row. That's how I caught a silently broken API key that had been failing for 2 days.

Pattern 5: Separate Environments for Each API

One .env file, isolated keys

When you have 12 API keys and one expires, which one broke the workflow?

Structure your config so each integration has its own labeled section:

# .env
# --- Weather ---
OPENWEATHER_API_KEY=...

# --- News ---
BRAVE_API_KEY=...
GNEWS_API_KEY=...

# --- Calendar ---
GOOGLE_CALENDAR_CREDENTIALS=/path/to/creds.json

When something breaks, grep -i "KEYWORD" ~/.openclaw/.env tells you exactly which key to rotate.

Pattern 6: Output Size Limits

Briefings should be brief

Your agent will happily produce 5,000 words if you let it. Telegram has message limits. Your attention has limits.

Hard constraints in the skill definition:

## Output Rules
- Total output: under 800 words
- Each section: 3-5 bullet points max
- Weather: 2 sentences
- News: 3 headlines, 1 sentence each
- Markets: numbers only, no commentary

This also saves token cost. A constrained briefing costs $0.02 instead of $0.15.

Pattern 7: Daily Health Check Cron

Automated self-monitoring

You won't notice your agent is broken until you wonder "why didn't I get my briefing today?"

Set up a health check cron that runs independently and reports:

This runs as its own cron job — separate from the automations it monitors. It's the agent watching the agent.

What This Looks Like in Practice

My current setup on a Raspberry Pi 5:

Every pattern above was discovered because something broke. The playbook is the scar tissue.

Want the Full Working System?

The Morning Briefing Blueprint includes all 7 patterns implemented in a ready-to-run OpenClaw skill:

Get the Morning Briefing Blueprint — $9

Or get the free setup checklist first