shipwithjev

Catalog / Tools & apps

0303GitHub

pi-fast-jev-compaction

Pi extension that prunes stale tool history and leaves summary compaction to Pi when pruning is insufficient.

joelhooks/pi-fast-jev-compactionREADME ↗
# `@joelhooks/pi-fast-jev-compaction`

A stock [Pi](https://github.com/badlogic/pi-mono) 0.85.1 extension that keeps conversation text verbatim while pruning stale tool history with [TypeSafe Jev](https://docs.typesafe.ai/docs/system-one/overview).

This is deliberately **layer 1 only**. It does not summarize, rewrite, or create memory. When pruning cannot free enough context, Pi's built-in summary compaction takes over.

## What it does

- Sends a compact representation of tool calls and surrounding conversation to TypeSafe's `/v1/systemone` endpoint.
- Asks two `noul` questions per eligible tool call: keep the call and keep its result.
- Keeps the first message and recent messages pinned.
- Applies three monotonic decisions:
  - `keep`: preserve the pair.
  - `drop_result`: preserve the tool call and a deterministic head of its result.
  - `drop_call`: remove the call and its matching result.
- Stores decisions as append-only `fast-jev-decisions` custom session entries.
- Rebuilds the ledger from the current session branch after startup, reload, resume, fork, or tree navigation.
- Filters only the context sent to the model. It never rewrites the JSONL session file.

User text, assistant text, thinking blocks, images outside pruned tool results, custom messages, and relative message order remain unchanged.

## Install

```bash
pi install git:github.com/joelhooks/pi-fast-jev-compaction
```

For one run without installing:

```bash
pi -e git:github.com/joelhooks/pi-fast-jev-compaction
```

The package targets Node 24.18 and Pi 0.85.1.

## API key

Set the runtime environment variable before starting Pi:

```bash
export TYPESAFE_API_KEY='...'
```

Or configure a command that prints the key to stdout:

```json
{
  "fastJevCompaction": {
    "apiKeyCommand": "your-key-helpe

Also filed under Tools & apps

  1. 0616

    Jevstiller: distill Jev calls into a local model

    A self-hosted proxy that trains a local model on Jev's answers. It served 72% of Banking77 locally at 15 ms, with a 2% audit and a bound on disagreement.

    tomerglick57 · Tools & apps · 15 ms local

  2. 0611

    Scruple: code checks for what linters miss

    Semantic-aware linting with System One models: rules you can state in a sentence, checked against your code by Jev.

    @nalexpeae · Tools & apps

  3. 0606

    Algolia-style Postgres search with a Jev reranker

    Typo tolerance, typeahead, barcodes and facet counts in plain Postgres SQL, plus an optional Jev step that asks one question per top-10 result.

    @alex_forman1 · Tools & apps

  4. 0604

    Virtual Closet: outfits from closet videos

    built a virtual closet & outfit generator from raw closet videos. classification + semantic search thanks to jev 🥰. clueless closet dreams finally coming to life

    @maitreemervana · Tools & apps