← Writing

My agents used to crash right before finishing

A task-scoped memory that survives the context wall instead of a last-minute lossy summary.

The failure is not subtle. A long coding session runs out of context mid-task, compresses badly or not at all, and either produces degraded work or halts entirely.

The root cause is that agents treat memory as a flat append-only buffer. Everything goes in, nothing comes out until it is full, and then the only move is a bulk summary. That summary is lossy and untyped, and it destroys exactly the things the agent needs most: active constraints, in-progress reasoning, and patterns it already proved.

I saw five patterns over and over: the context-wall crash with no checkpoint, degraded resumption that forgets a constraint it used to respect, a sub-agent that crashes silently and hangs its orchestrator, redundant tool calls as pressure rises, and skill amnesia, where the agent solves a pattern in sub-task three and re-derives it from scratch in sub-task seventeen.

Mnemos treats task-local knowledge as typed nodes with per-type eviction, writes checkpoints at a token threshold, and resumes from them. You start with the minimum: monitor tokens, checkpoint, resume. That alone kills the most common failure. You add tiers only as production demands.

It is implemented, with a full reference in maggy. The point was never to make one agent last longer. It was to make a whole multi-agent task hierarchy finish reliably, with every agent managing fatigue before it hits the wall.

Distilled from my Mnemos RFC. The full RFCs are on github.com/alinaqi.