karat-filter

September 20, 2026 · View on GitHub

Don't feed the model every scrap from the dredge. Retrieve, judge the karat, then load the crucible.

@ormus/karat-filter is Jev Pattern 5 with speculative fan-out: filter RAG / search hits with lightweight relevance+confidence judgments before they burn context. Fan out query variants, merge, dedupe, keep the purest ore.

Echoes retrieve-then-judge patterns from TypeSafe and Vercel Jev writeups, and the free master-Jev teaching vibe: context is precious metal — assay before you spend it.

Install

npm i @ormus/karat-filter

Quick pour

import { filterHits, speculativeFanOut } from '@ormus/karat-filter';

filterHits(hits, { query: 'confidence gates', topK: 5 });

await speculativeFanOut('jev routing', retrieveFn, { variants: 3, topK: 4 });

Liquid Gold siblings

RepoRole
aurum-gatePattern 2 gates
quicksilver-judgeRaven pre-filter
gold-assayVibium assay
molten-cascadePattern 4 cascade
karat-filterYou are here — Pattern 5 + fan-out
liquid-goldIndex

Scripts

npm test
npm run build

License

MIT © 2026 Ormus Solutions