shipwithjev

Catalog / Agents & browsers

0198GitHub

pi-jev-context-curator

A context curator for the Pi agent, built on Jev.

Shashank-H/pi-jev-context-curatorREADME ↗
# pi-jev-context-curator

A [pi](https://pi.dev) extension that curates the context sent to the LLM before each call — using **TypeSafe AI's Jev model** to decide which context is actually needed.

## What it does

Before every LLM call, pi fires the `context` event with the full message list. This extension:

1. Groups messages into **units** — an assistant tool-call message plus its tool results stay together as one atomic unit, so curation never orphans a tool result.
2. Checks each unit against the **judgment checkpoint**: every unit Jev has already judged is recorded by content fingerprint, so past decisions are reused and the same data is never sent to Jev twice.
3. Sends only the **new units** (those after the checkpoint) to Jev's `/v1/systemone` endpoint with **one yes/no (`noul`) question per unit**: *"Is this unit likely essential to completing a future response?"* The prompt prefers minimal retention and all questions evaluate in parallel in a single pass.
4. Units Jev rejects are **permanently discarded** from what the model sees — the removal is re-applied on every subsequent `context` event (pi itself only lets extensions transform the per-call payload, not edit the stored session).
5. Every newly removed unit is also written as a durable, session-scoped pi entry. It appears in the transcript as a collapsed `[jev removed]` record and can be expanded to inspect the removed text; this record is display-only and is not sent back to the LLM.

Jev is a good fit here: it returns calibrated probabilities in ~70–500ms, costs $42/B input tokens with free outputs, and is purpose-built for this kind of structured semantic judgment.

Because each unit is judged once, the per-turn Jev cost stays tiny (usually 1–3 new units) no matter how long the session gets.

## Safe

Also filed under Agents & browsers

  1. 0295

    Flight search with Browser Use

    Breaking: Browser Use + Jev = Ultrafast ⚡ Findings flights took 7s and cost only $0.0039 🤯 > new action space every step > DOM state space > small LLM fallback to type (this video is at 1x speed btw) Built a tiny open source browser agent. try it below ↓

    @gregpr07 · Agents & browsers · ~$0.004 · ~7 s

  2. 0500

    Jev: AI Decisions as a Typed Function Call | StackToHeap

    # Jev: AI Decisions as a Typed Function Call What I learned using TypeSafe's Jev for code review, and why its more surprising uses are browser control and generative UI.…

    stacktoheap.com · Agents & browsers

  3. 0319

    x-scanner

    Chrome extension that labels every post you scroll past on X with six typed questions per post, and counts what it costs in the corner.

    oso95 · Agents & browsers

  4. 0318

    Vibe Check for X

    Chrome extension that scores draft posts and reply context before posting; optional media descriptions come from a separate vision model.

    RafalWilinski · Agents & browsers