Free Guide

5 Agent Patterns That Actually Work in Production

Not theory. These are the patterns I run every day to keep AI assistants alive, in sync, and doing useful work — even after crashes, context wipes, and long gaps between sessions.

✓ Patterns 1 & 2 are completely free — copy-paste ready

What's Inside

  1. The Memory Handoff — FREE ↓
  2. The Heartbeat Health Check — FREE ↓
  3. The Escalation Ladder — Library
  4. Multi-Agent Memory Bus — Library
  5. Cold Start Recovery — Library
Free Patterns
Pattern 1 of 5

The Memory Handoff

How to pass context between AI sessions without losing state

The Problem

Every AI assistant starts each conversation with a blank slate. Ask it to "continue where we left off" and it genuinely doesn't know what you mean. This isn't a bug — it's how these systems work. But it kills productivity when your assistant forgets the decisions you made yesterday, the tone you approved, or the task it was halfway through.

Most people solve this by copy-pasting notes at the start of every chat. That works, but it's manual and it scales badly. The Memory Handoff automates it.

How It Works

At the end of every session, your assistant writes a short "handoff note" to a file. At the start of the next session, it reads that file first. The note is structured so the next session can pick up immediately — no re-explaining, no context loss.

Three parts make it work:

  1. The Handoff File — a plain text or markdown file your assistant writes to automatically
  2. The End-of-Session Prompt — the instruction that triggers the write
  3. The Start-of-Session Prompt — the instruction that reads and applies the handoff

Copy-Paste Implementation

Add this to your assistant's instructions (SOUL.md or system prompt):

End-of-session instruction (add to your assistant's prompt)
## Session Handoff

At the end of every session, write a handoff note to memory/handoff.md.

Format it exactly like this:

## Handoff — [DATE]

### What we did this session
- [bullet list, 3-5 items max]

### Active tasks (in progress)
- [task name]: [one-line status]

### Decisions made
- [decision]: [why we made it]

### Pick up here next time
[1-2 sentences: what to do first in the next session]

### Context that matters
- [anything unusual, preferences, or constraints active right now]
Start-of-session instruction (add to your assistant's prompt)
## Session Start

Before doing anything else, read memory/handoff.md if it exists.
Apply any active tasks, decisions, and context from that file.
Do not ask me to repeat things that are already in the handoff.
Confirm you've read it in one sentence, then proceed.
Real result: I've run this pattern for 68+ days. Session startup time dropped from ~5 minutes of re-explanation to under 30 seconds. The assistant picks up mid-thought, no prompting required.

What to Watch Out For

Tip: Keep two files — handoff.md for the latest session state, and MEMORY.md for long-term facts that should always be loaded. The handoff is ephemeral; MEMORY.md is permanent.
Pattern 2 of 5

The Heartbeat Health Check

How to monitor agent health with a 5-line prompt addition

The Problem

AI assistants fail silently. They don't crash with an error message — they just start giving worse answers, missing tasks, or quietly doing nothing. By the time you notice, you've lost hours or days of work the assistant should have been doing.

The Heartbeat Health Check gives you a dead-man's switch. If your assistant is healthy and running, it responds. If it's stuck, confused, or drifted off-task, the check catches it before it becomes a problem.

How It Works

Every 30–60 minutes (or whenever you want a check-in), send your assistant a short "heartbeat" message. The assistant is pre-programmed to respond with a brief status report — or flag a problem if something's wrong.

It takes 5 lines in your system prompt. Here's the exact implementation:

Add to your assistant's system prompt / SOUL.md
## Heartbeat Protocol

When you receive the message "HEARTBEAT", respond with:
1. Current status (what you're doing or waiting on)
2. Any blockers or problems you've hit
3. Last completed task
4. Next planned action

If everything is fine and there's nothing to report, reply: HEARTBEAT_OK

If something is wrong — you're stuck, confused, or hit an error —
reply: HEARTBEAT_ALERT: [brief description of the problem]

Setting Up the Check-In Schedule

You can send heartbeats manually, but the pattern works best when automated. Three ways to do this depending on your setup:

  1. Manual (easiest): Just type "HEARTBEAT" whenever you want a status check. Takes 2 seconds, gives you instant visibility.
  2. Scheduled message (most common): Use a simple cron job or automation tool (Zapier, Make, or a basic script) to send "HEARTBEAT" every 30 minutes during working hours.
  3. Triggered by silence: If your assistant hasn't sent a message in X minutes, trigger a heartbeat automatically. This catches cases where it got stuck and stopped responding.
Simple bash cron (every 30 min, 9am–6pm)
# Add to crontab with: crontab -e
*/30 9-18 * * 1-5 echo "HEARTBEAT" | your-assistant-cli

What a Good Heartbeat Response Looks Like

You → HEARTBEAT

Assistant → HEARTBEAT_OK

Current: Drafting follow-up email for the Johnson account.
Last completed: Updated the Q3 report with new figures.
Next: Send the email draft to you for review once done.
No blockers.
Red flag: If you send a heartbeat and get a confused, rambling response instead of a clean status — your agent has lost the thread. That's your signal to restart the session and check the handoff file (Pattern 1).

Going Further

Once you have basic heartbeats running, you can layer in more checks:

Real result: Before heartbeats, I'd discover agent problems 4–6 hours after they happened. After implementing this pattern, the average catch time dropped to under 35 minutes. That's the difference between a small correction and a full day of cleanup.
Library — 3 More Patterns
🔒

Pattern 3: The Escalation Ladder

A decision tree baked into your agent's prompt that tells it exactly when to stop and ask a human — and who to ask. Eliminates both "asks too much" and "does too much without permission" problems. Includes 4 trigger levels and real prompt examples.

🔒

Pattern 4: Multi-Agent Memory Bus

When you have 3+ agents running in parallel, they need a single source of truth. This pattern creates a shared memory file with read/write rules that prevent agents from overwriting each other's work. Full setup for 3-agent systems with role separation.

🔒

Pattern 5: Cold Start Recovery

What to do when an agent crashes, loses context, or returns after a long gap with no memory of what it was doing. A structured recovery protocol that gets agents back on track in under 2 minutes — no re-explaining, no lost work.

Get All 5 Patterns + 47 More

The Library has everything I actually run — patterns, configs, templates, and troubleshooting playbooks. Updated every week with what's working right now.

✓ All 5 patterns ✓ 47+ more playbooks ✓ Copy-paste configs ✓ Weekly updates ✓ Daily Briefing
Join the Library — $9/month →

Cancel anytime. No fluff, no theory — only tested, production-ready material.