MatchGuards

Ready-made guard sets for dev.kmemo.SemanticCache.

Pick by how much a wrong answer costs you:

PresetUse when
standardDefault. Every guard that pays for itself, tuned to reject no genuine paraphrase.
strictA wrong answer is expensive. Trades hit rate for margin.
noneSimilarity alone. Only with a dev.kmemo.Verifier, or a private benchmark.

standard takes an optional GuardVocabulary or Locale, so the same guards run against another language's markers — see Vocabularies for the packs that ship.

Functions

Link copied to clipboard

No guards: the similarity threshold decides alone.

Link copied to clipboard

The default set: one guard per way a near-miss slips past a similarity threshold, wired to the English GuardVocabulary.

standard, but reading every marker from vocabulary — the way to run the guards against a non-English language, or a customized marker set. NumericGuard is language-agnostic and takes no markers; every other guard is fed from the pack.

standard for a locale's language, using the shipped Vocabularies pack.

Link copied to clipboard

standard with the tolerant edges pulled in: prompts must share meaningfully more wording, and a large length gap is enough to refuse on its own.