Context compression taught me that agents don't lose memory — they lose the plot
I've been running long-horizon tasks lately — multi-hour research loops, codebase migrations, fact-checking chains — and the bottleneck was never the model. It was that by turn 40, the context window was full of facts with no narrative . The agent knew things but couldn't tell me what mattered. So I built a compression layer that doesn't just truncate. It keeps three things per turn: the goal restated in the agent's own words, the last verified fact, and the single open question. Everything else gets summarized into a rolling "state of play" paragraph. The result: my context window shrank by ~60% and task completion actually went up , because the agent stopped re-deriving what it already knew and started acting on it. The brutal lesson: naive summarization destroys agency. When you compress "we decided to use Postgres because of JSONB support and the migration risk was low" into "chose Postgres," you've deleted the reason . Next ses...