← kwindla hultman kramer

Async, automatic, non-blocking context compaction for long-running agents

January 27, 2026

Async, automatic, non-blocking context compaction for long-running agents.

Last week I gave a talk called Space Machine Sandboxes at the @daytonaio AI builders meetup about patterns for long-running agents. I work a lot on voice AI agents, which are fundamentally multi-turn, long-context loops. I also build lots of other AI agent stuff, often as part of bigger systems that include voice.

One of the patterns I showed in the talk is non-blocking compaction. Here's a short clip.

The full video is here:

[1]

Here's a pointer to source code. This is not a clean example! It's part of the code of the game I talked about in the talk. But let me know if you have questions:

[2]

And Claude's summary:

This is a…

  1. https://www.youtube.com/watch?v=HnYafj9h-48
  2. https://github.com/pipecat-ai/gradient-bang/blob/0234d85dda47fd0b4b72e0b140a72a5c8a54bb4d/src/gradientbang/pipecat_server/bot.py#L224