HaiKIT splits tool results: 67-token digests for the model, full data stays in the browser

Head_Inspector2200 · reddit · 2026-10-30

A developer open-sourced HaiKIT (MIT, TypeScript), a pattern for keeping bulky tool results out of LLM context. Every tool result splits into a required model-facing digest (47 flight rows compressed to 67 tokens, with cheapest/fastest precomputed plus a handle) and a UI channel streaming full rows to the browser. The model can query the handle via queryui, but only through cap functions so filters can't refill context; an 'elicit' mechanism suspends turns until user clicks supply the result; the browser can only send {handle, action, value}, forming an injection boundary. Adapters for Claude and OpenAI Responses API, plus a Postgres store with fenced turn leases.

Original post →

More from coding & agent

coding & agent channel →