DNA News

Act on this, mostly signal

Tutorial adds context compaction to a from-scratch agent

What to do

Read the session compaction part if you build your own agent loop.

Why

It summarizes older turns while keeping the full transcript on disk.

Read the source at ruxu.dev

What the research found

Part of a tutorial series building an AI agent from scratch; this part adds context compaction that summarizes older session turns while keeping the full transcript on disk.

Claims and how well the evidence supports them

  1. Automatic compaction starts after passing 80% of the max-context-tokens limit, which is about 19200 tokens with the default 24000 budget 99%
  2. Compaction splits at the latest user-turn boundary so tool calls and results stay paired 95%
  3. Full transcript stays on disk while older turns are summarized 98%

Evidence

Actionability rated medium.