Statisv0.4 · beta
Try in 5 min →
Back to Blog

Why we open-sourced the agent compressor

We built Statis Context Kit for our own agents — compressor, cost meter, pattern guard. Then we realized every agent builder needs it. So we made it free.

We built Statis Context Kit for our own agents. Then we gave it away.

If you’ve shipped an agent into production, you already know the feeling: a seven-figure monthly inference bill that crept up while nobody was looking, a hallucination trail that turned out to be a stale tool response buried on turn 14, a prompt-injection report from a user who pasted something you never imagined. The model isn’t the problem. The context you hand the model is the problem.

The 7,800 → 3,200 token run

Our first internal dogfood was embarrassing. An agent that kept failing at turn 20, not because the reasoning was wrong, but because context had bloated past the effective window. We sketched a compressor in an afternoon — pin the system prompt, summarize anything older than the last two turns, prune tool calls whose results were already restated.

The next run: 7,800 tokens collapsed to 3,200. Same answer, same latency, $0.018 less per call. At the volume our staging agent was running, that was four figures a month off the bill. So we kept building: a cost meter, a pattern guard, a diff viewer so we could see what was pinned versus pruned.

The call we kept having with every AI team

We started showing this to friends at other agent companies. Every one of them had built or was about to build the same three things. Compressor. Cost meter. Guard. None of them wanted to maintain it. All of them wanted it free, local, and without a vendor signup wall between them and the first run.

So Statis Context Kitis what we wanted: five lines of Python, zero account, MIT license, runs entirely in-process. It’s what we already use on our own agents. Now it’s what you use on yours.

pip install statis-kit

from statis_kit import process

result = process(messages, config={"pin_top": ["system"], "recent_turns": 2})
print(result.report.token_delta, result.report.cost_estimate)

What’s in the box

  1. 1CompressorPin, prune, summarize. Configurable. Deterministic. Reports the delta so you can audit what changed.
  2. 2Cost meterPer-turn, per-model token accounting. GPT-4o, Claude 4.5, Gemini, Llama — priced against the live rate cards.
  3. 3Pattern guardPrompt-injection, secret exfiltration, and PII patterns. Runs before the model call, not after the incident.
  4. 4Diff viewer CLIPaste two transcripts, get a side-by-side of what the compressor would do. Good for CI, good for debugging.

Why free, not freemium

Because this is the context inpillar of the Statis trust layer — and we want every agent on the planet to ship with it, not just the ones who are ready to buy. The paid tiers are what you graduate into when you need a hosted policy editor, execution history, approvals, or a hash-chain audit ledger that passes a SOC2 review.

Put differently: the Kit is the firewall. The cloud is the SIEM. The enterprise product is the compliance report. You need all three eventually. You need the first one today, for free, without asking anyone’s permission.


pip install statis-kit. Five minutes from now you’ll know what your context actually costs. And you’ll stop paying for the turns you don’t need.

← All postsTry the gate in 5 min →