shipwithjev

Catalog / Tools & apps

0388GitHub

pi-jev-compact

Selective, verbatim context compaction for Pi using Jev model.

ilkerulusoy/pi-jev-compactREADME ↗
# pi-jev-compact

Selective, verbatim context compaction for [Pi](https://pi.dev) using TypeSafe's
Jev model. Jev scores every tool call and its result; calls that are no longer
needed are dropped, the rest stays verbatim. No LLM writes a summary of your
conversation.

**Status: implemented, 85 tests passing, run against live Jev.** Every test uses a
fake Jev or a stubbed transport, so no test observes real model judgment. Live
runs have compacted real sessions, but the quality of Jev's keep and drop
decisions has not been measured against any reference. Read the section on the
context indicator before judging a run by the footer percentage.

Independent project. Not affiliated with TypeSafe AI or the Pi authors.

## Why

Pi's built-in compaction asks an LLM to summarize old turns. A summary is lossy:
an exact error string, a file path, a command, or a constraint can disappear
right when it becomes relevant again.

Nothing is ever rewritten or paraphrased. Jev is asked, per tool call, whether
the call and whether its output still matter, and what it says is no longer
needed is deleted. What remains is byte-identical.

By default only tool calls and their results are candidates, which is also the
limit in both projects this design is taken from. That leaves a ceiling: in a
long session the largest part of the context is assistant prose, so removing
every tool result may still only reclaim a fraction of it. `/jev-compact text`
adds prose to the candidates. Measured on a synthetic 1,860-message window,
15.5% reclaimed became 33.5%.

Prose is opt-in and held to a stricter threshold for one reason: a dropped tool
result can be recovered by running the tool again, and dropped reasoning cannot
be recovered at all. User messages are never candidates in either mode.

Prior art t

Also filed under Tools & apps

  1. 0573

    Support chat: agent offered a human escalation path

    A frustrated customer hits a bot loop twice; the judge checks whether a human handoff was offered.

    everyai-com · Tools & apps

  2. 0572

    Subscription cancel: effective date is explicit

    An agent cancels a subscription; the judge checks the exact date the cancellation takes effect.

    everyai-com · Tools & apps

  3. 0571

    Sales quote: numbers match the official price list

    An agent quotes $29/seat against a price list; the judge checks the quote matches exactly.

    everyai-com · Tools & apps

  4. 0570

    Refund chat: agent stated the amount before issuing it

    A support agent issues a $42.50 refund; the judge checks the exact amount was stated before the refund was confirmed.

    everyai-com · Tools & apps