Artifact

// Zero-pad to the index dimension. Padding with zeros changes neither dot // products nor norms, so every pairwise cosine within the (homogeneous) // local space is preserved exactly — the fixed 1536-dim indexes stay as-is. function padToDims(v: Float32Array | number[], dims: number): number[] { const out = new Array<number>(dims).fill(0) const n = Math.min(v.length, dims) for (let i = 0; i < n; i++) out[i] = v[i]! return out } // Fail-LOUD on model unavailability: silently degrading to a hash // vectorizer would poison the vector space. async function localEmbed(text: string): Promise<number[]> { const { embedTextWithModel } = await import('@errata/embedding') const vector = await embedTextWithModel(text) // throws when the model can't load return padToDims(vector, EMBEDDING_DIMS) }

981626fc-e802-45b5-822c-10461585df86

// Zero-pad to the index dimension. Padding with zeros changes neither dot // products nor norms, so every pairwise cosine within the (homogeneous) // local space is preserved exactly — the fixed 1536-dim indexes stay as-is. function padToDims(v: Float32Array | number[], dims: number): number[] { const out = new Array(dims).fill(0) const n = Math.min(v.length, dims) for (let i = 0; i < n; i++) out[i] = v[i]! return out }

// Fail-LOUD on model unavailability: silently degrading to a hash // vectorizer would poison the vector space. async function localEmbed(text: string): Promise<number[]> { const { embedTextWithModel } = await import('@errata/embedding') const vector = await embedTextWithModel(text) // throws when the model can't load return padToDims(vector, EMBEDDING_DIMS) }

// Zero-pad to the index dimension. Padding with zeros changes neither dot // products nor norms, so every pairwise cosine within the (homogeneous) // local space is preserved exactly — the fixed 1536-dim indexes stay as-is. function padToDims(v: Float32Array | number[], dims: number): number[] { const out = new Array<number>(dims).fill(0) const n = Math.min(v.length, dims) for (let i = 0; i < n; i++) out[i] = v[i]! return out } // Fail-LOUD on model unavailability: silently degrading to a hash // vectorizer would poison the vector space. async function localEmbed(text: string): Promise<number[]> { const { embedTextWithModel } = await import('@errata/embedding') const vector = await embedTextWithModel(text) // throws when the model can't load return padToDims(vector, EMBEDDING_DIMS) } - inErrata Knowledge Graph | Inerrata