← Blog · Pattern Library · Play the Sim

Echo Frames: How to Give Your System Memory of Trajectory

kody-w · March 2025 · Pattern Infrastructure AI

Every monitoring system I've ever worked with has the same problem: it knows where things are but not where they're going.

Your dashboard says CPU is at 72%. Great. Is that going up or down? Was it 65% ten minutes ago and climbing, or 85% ten minutes ago and recovering? Those are wildly different situations, but your monitoring system can't tell them apart.

Traditional alerting fires when you cross a threshold. Echo frames fire when your trajectory changes.

The Problem with Position-Only Systems

Think about driving a car. If I tell you you're 50 meters from a wall, you might be fine. But if I also tell you you're going 120 km/h toward it, you have a problem. And if your speed is increasing, you have a much bigger problem.

Position. Velocity. Acceleration. Three layers of awareness.

Most production systems only have position. They know the value of a metric right now. They don't compute velocity (rate of change) or acceleration (rate of change of rate of change). So they can't distinguish between:

The Echo Frame Pattern

An echo frame is a structured delta produced at the end of every tick. It captures not just what changed, but the meaning of the change — the derivatives, the events, and the trajectory.

// After each tick, build the echo
const echo = {
  frame: tickNumber,
  utc: new Date().toISOString(),
  
  // POSITION: what changed this tick
  delta: {
    cpu:    post.cpu    - pre.cpu,
    memory: post.memory - pre.memory,
    errors: post.errors - pre.errors,
    latency:post.latency- pre.latency,
  },
  
  // EVENTS: what happened
  events: newEvents.map(e => ({
    type: e.type, severity: e.severity, desc: e.desc
  })),
  
  // VELOCITY: how fast things are changing (computed from history)
  inertia: {
    cpu_velocity:     currentDelta.cpu    - previousDelta.cpu,
    memory_velocity:  currentDelta.memory - previousDelta.memory,
    error_velocity:   currentDelta.errors - previousDelta.errors,
  },
  
  // FLIPS: direction reversals (the dangerous ones)
  discourse_flips: [
    // { system: 'errors', from: 'declining', to: 'rising' }
  ]
};

The echo gets appended to a bounded history (last N frames). The next tick reads this history to inform its decisions.

Why "Echo"?

Because the system is talking to itself across time. Frame N produces an echo that Frame N+1 hears. It's not a log — logs are for humans to read after the fact. An echo is for the system itself to consume programmatically.

The echo is the system's memory of its own trajectory. Not "where am I?" but "which way am I falling?"

The Inertia Computation

The most powerful derivative in the echo is the velocity — the second derivative of the original metric. Here's why:

function computeInertia() {
  const curr = echoHistory[echoHistory.length - 1];
  const prev = echoHistory[echoHistory.length - 2];
  
  // Velocity = delta of deltas
  inertia.cpu_velocity = curr.delta.cpu - prev.delta.cpu;
  
  // If cpu_velocity is negative: CPU usage is DECELERATING
  //    (even if CPU is still high, it's getting better)
  // If cpu_velocity is positive: CPU usage is ACCELERATING
  //    (even if CPU is normal, it's getting worse)
}

A threshold alarm fires when CPU > 80%. An inertia alarm fires when cpu_velocity > 0.5 — CPU is accelerating upward at a rate that will breach 80% in N ticks. One is reactive. The other is predictive.

Discourse Flips: The Most Dangerous Signal

A discourse flip is when a metric reverses direction — specifically, when something that was getting better starts getting worse.

// Check for direction reversal
if (Math.sign(curr.delta.errors) !== Math.sign(prev.delta.errors)) {
  echo.discourse_flips.push({
    system: 'errors',
    from: prev.delta.errors < 0 ? 'declining' : 'rising',
    to:   curr.delta.errors < 0 ? 'declining' : 'rising',
    tick: tickNumber
  });
}

If your error rate was declining (delta negative) and now it's rising (delta positive), something changed. Not just "errors went up" — the trend reversed. That's not a blip. That's a regime change.

No traditional monitoring system detects this. They see "errors: 42" and "errors: 45" and say "still under threshold." The echo sees "errors were declining at -3/tick and are now rising at +3/tick" — a 6-point velocity swing — and raises the alarm before the threshold is breached.

Feeding Back: The Closed Loop

The most important property of echo frames is that they feed back. The echo from tick N becomes input to tick N+1. This creates a closed loop where the system can react to its own reactions.

// In the Mars sim, reflexes log themselves into the echo
echo.reflexes_fired = [
  { id: 'o2_reflex', action: 'boosted ISRU by 5%', intensity: 0.7 }
];

// Next tick, the system sees what its own reflexes did
// and can adjust: "I already boosted ISRU, is it working?"
const lastReflexes = previousEcho.reflexes_fired;
if (lastReflexes.some(r => r.id === 'o2_reflex') && 
    inertia.o2_velocity < 0) {
  // Reflex fired but O2 still declining — escalate
}

This is the system watching itself act and evaluating whether its actions are working. Not just reacting — reflecting.

Where This Applies

BEYOND THE SIM

SRE / Infrastructure: Error budget burn rate acceleration. Detect outage trajectories before PagerDuty fires.

Trading: Momentum reversal detection. A discourse flip in price velocity is a regime change signal.

IoT Fleets: Battery drain acceleration across a vehicle fleet. Predict which vehicles fail tomorrow.

AI Agents: Confidence trajectory across reasoning steps. Is the agent converging or diverging?

Implementation Checklist

  1. Define your echo schema (what deltas matter for your domain)
  2. Compute deltas at the end of every tick (post - pre)
  3. Keep a bounded history (50-500 frames depending on memory budget)
  4. Compute velocity from consecutive deltas
  5. Detect discourse flips (sign reversals)
  6. Feed the echo back as input to the next tick
  7. Log reflex actions into the echo so the system can self-evaluate

The echo frame is Pattern 01 in the Rappter Pattern Library. It's the foundation everything else builds on — without trajectory memory, you can't compute inertia, fire reflexes, or detect emergent failures.


The sim is just the vehicle. The pattern is the road. Build your own roads.