AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
翻譯準備中
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Catches silent embedding-model swaps under a vector index before they corrupt similarity search -- provider-agnostic, zero dependencies.
翻譯準備中
取自儲存庫 README
正在載入完整 README。 以下為已儲存的摘錄。
Catches silent embedding-model swaps under a vector index before they corrupt similarity search — dimension checks plus canary-probe drift detection, provider-agnostic.檢視完整 README ↗
Catches silent embedding-model swaps under a vector index before they corrupt similarity search — dimension checks plus canary-probe drift detection, provider-agnostic.
When you change the embedding model behind a vector index — upgrade a version, switch providers, change chunking — vectors already in the index were produced by the old model, and new query vectors come from the new one. The two spaces are incompatible: similarity scores and rankings become meaningless, and nothing errors. This is a widely-felt, well-documented failure mode across the RAG/vector-database ecosystem, and today it's usually caught by hand-rolled, per-project scripts (or not caught at all until search quality visibly degrades). The general-purpose ML drift-monitoring platforms (Evidently, Alibi Detect) that do exist are heavyweight Python observability stacks meant for full model-monitoring infrastructure — there wasn't a small, embeddable, provider-agnostic library that just answers the specific question: is the embedding model that produced this vector still the one this index was built with?
embedguard never calls an embedding provider itself — you bring the vectors from whatever model/provider you already use, and it does the math and bookkeeping:
createFingerprint({ canaries, modelId? })Builds a small fingerprint from a handful of "canary" probe strings you've embedded with your current model: their dimension, and the embeddings themselves. Store this alongside your index's metadata.
checkDimension(fingerprint, embedding)The cheap, unambiguous check — does a vector even have the right number of dimensions. Catches an obviously different model immediately.
checkDrift(fingerprint, freshCanaries, { threshold? })The subtle, dangerous case dimension checking can't catch: a swap between models that happen to produce the same dimensionality (common within a provider's model family). Re-embed your fingerprint's exact canary probes with whatever model is currently configured, and this compares cosine similarity per probe — a real model swap shows up as a sharp similarity drop even when dimensions still match.
npm install embedguard
import { createFingerprint, checkDimension, checkDrift } from "embedguard";
// Once, when you build your index -- embed a handful of representative strings yourself:
const fingerprint = createFingerprint({
modelId: "text-embedding-3-small",
canaries: [
{ probe: "return policy", embedding: await embed("return policy") },
{ probe: "shipping times", embedding: await embed("shipping times") },
],
});
// Store `fingerprint` next to your index (a metadata row, a JSON file, whatever you already use).
// Later -- before trusting a batch of new vectors, or on a schedule:
const freshCanaries = await Promise.all(
fingerprint.canaries.map(async (c) => ({ probe: c.probe, embedding: await embed(c.probe) }))
);
const drift = checkDrift(fingerprint, freshCanaries);
if (!drift.ok) {
throw new Error(`embedding model drift detected: ${JSON.stringify(drift.probes)}`);
}
Run the annotated demo (simulates exactly this bug — a same-dimension model swap that dimension-checking alone would miss):
npx tsx examples/demo.ts
npm install
npm run typecheck
npm test
npm run build
MIT
This is one of 8 independent open-source infrastructure tools, each built against a real, researched gap:
Built by ArkNet Digital.