← All notes

Compact conversation context before you hit the window limit

Answer: Compaction automatically manages conversation context as it grows so agents can stay within context window limits. An LLM can see only data from the conversation history.

Why it matters

Compaction enables you to automatically manage conversation context as it grows. The only data an LLM can see is from the conversation history. Several compaction strategies are available.

The default threshold is 0.9. If you want to make some new data available to the LLM, add it to the conversation history. CompactionAuto is the recommended default for most use cases.

Compaction affects only the input that the model sees. You can add it to the Agent instructions, or add it to the input when calling Runner.run. The core history with all messages is still retained by agents.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Inspect AI compaction docs (MIT); OpenAI Agents SDK context.md (MIT). Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Inspect AI compaction docs (MIT); OpenAI Agents SDK context.md (MIT). Text was condensed and changed from the originals.

Cite this

Permanent ID: iil:note:a9c3v3m3

iinventedlight. 2026. "Compact conversation context before you hit the window limit." iinventedlight Library, iil:note:a9c3v3m3, version of 2026-11-22. https://iinventedlight.com/library/notes/inspect-eval-compaction/. License: CC-BY-4.0.

@misc{iil_note_a9c3v3m3,
  author = {{iinventedlight}},
  title = {{Compact conversation context before you hit the window limit}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-22},
  url = {https://iinventedlight.com/library/notes/inspect-eval-compaction/},
  note = {Permanent ID iil:note:a9c3v3m3. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/inspect-eval-compaction.md.