In depth
Long agent sessions blow past any context window eventually. Compaction is the mechanism that compresses old turns into summaries before the context overflows. Done well, the agent keeps running indefinitely. Done poorly, the agent forgets the original goal halfway through. The cure for poor compaction is goal pinning plus a memory module that persists structured state across the compression boundary.
Related concepts
Working memoryPer-session state the agent can write and read across turns, including a goal, a todo list, and arbitrary key-value notes.Goal pinningA pattern where the original goal is auto-injected at the top of every turn so the LLM cannot lose the thread.Context windowThe maximum number of tokens an LLM can process in a single call. Modern frontier models offer 200K to 2M.
Newsletter
Get the next post in your inbox.
Engineering notes from the Digitorn team. No marketing, no launch announcements, no "10 prompts that will change your life". Just the things we write that we'd want to read.