Strix (STRIX) — llm
What this is
strix/llm keeps a long-running agent conversation from outgrowing its model's
context window. As an agent runs many turns (reading files, running tools, reading
output), its conversation history grows — this module decides when that history is
getting too big and compresses it.
What flows through it
Technical details
Package: strix/llm/
Depends on: strix.config (ContextSettings — compaction/tool-output caps).
Depended on by: strix.core (the turn loop consults this before a cycle would
otherwise exceed the model's context window).
Files at a glance
| File | Role |
|---|---|
compaction.py |
Summarizes older turns in an agent's conversation history once it's grown large, keeping recent turns verbatim. |
context_budget.py |
Tracks token usage against the model's context limit and ContextSettings, deciding when compaction should trigger. |
Files & functions, explained
Deterministic bookkeeping (token counting, threshold checking) drives when
compaction happens; the summarization step itself may call the model to produce a
condensed version of older turns — a narrower, cheaper use of the LLM than the main
agent reasoning loop, similar in spirit to report/dedupe.py's separate judgment call
(see agentic-framework.md).
Related: STRIX — Architecture (HLD), core.md, ../design/agentic-framework.md.