@vibgrate/relevance
v2026.1005.1
Published
Vibgrate relevance kernel: query analysis over the compiled relevance pack. Proprietary distribution — the compiled WASM engine plus a minified wrapper; the relevance pack and the reference implementation are not included.
Readme
@vibgrate/relevance
The Vibgrate relevance kernel: deterministic query analysis over the compiled
relevance pack, consumed by the Vibgrate CLI's optional relevance-provider
seam (engine/relevance-provider.ts in @vibgrate/cli).
This package is a binary-only, proprietary distribution: it ships compiled
modules plus the embedded relevance pack — never the source or the pack
build tooling. Given a natural-language coding prompt it returns inferred
topics and weighted expansion terms with provenance ("direct debits" →
payments incl. GoCardless vocabulary, "locales" → i18n, "tailwind" → CSS), so
vg ask / vg code capsules reach the code a prompt means even when no
symbol names it. Analysis runs entirely locally (incl. air-gapped); prompts
never leave the machine.
The kernel source and the pack builder live in a private repository and are not part of this package. v1 is the taxonomy-as-expander stage; the keyword-mining/MMR and static-vector stages land behind the same interface (compiled to WASM) in later versions.
API
import { createRelevanceProvider } from "@vibgrate/relevance";
const kernel = createRelevanceProvider();
kernel.version();
// "[email protected]+pack.2026.08.5"
kernel.analyzeQuery("handle gocardless 429 responses");
// { version, topics: [{ id: "payments", score: 1 }],
// expansions: [{ term: "mandate", from: "gocardless", weight: 0.6 }, …] }
// Schema-5 (v1.4, the 2026-08 relocation): the module IS the relevance
// engine for vg ask / vg code capsule seeds. The host hands it the ask and
// a name-only symbol view of its code graph; the module returns the
// ordered, provenance-annotated seed list plus the plain-language concept
// map. Term roles, the concept lexicon, IDF weighting, typo repair,
// morphology and seed diversification all live here now.
kernel.rankSymbols("the checkout fails with \"sepa mandate missing\"", symbols, { limit: 16 });
// { version, hasContent: true,
// seeds: [{ id, score, why: "matched: quote→sepa, quote→mandate, …" }, …],
// conceptMap: ["- \"checkout\" in the ask implies …", …] }The host CLI auto-provisions this module (silently, on every run; declinable)
and loads it through its generic provider seam (default module path or
VIBGRATE_RELEVANCE_PATH), sanitizes every result at its own trust boundary,
and degrades to mechanical exact-name matching when the module is absent or
VIBGRATE_NO_KERNEL=1 is set.
Build (maintainers)
pnpm --filter @vibgrate/relevance build # tsup → dist/The embedded pack is regenerated from the content corpus with
node scripts/build-relevance-pack.mjs (monorepo root) — bump the pack
version there on any semantic change.
