import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);

// src/intelligence/embeddings.ts
async function generateEmbedding(backend, text) {
  const raw = await backend.embed(text);
  return {
    embedding: normalize(raw.embedding),
    model: raw.model,
    dimensions: raw.dimensions
  };
}
function normalize(vec) {
  const magnitude = Math.sqrt(vec.reduce((sum, v) => sum + v * v, 0));
  if (magnitude === 0) return vec;
  return vec.map((v) => v / magnitude);
}

export {
  generateEmbedding
};
//# sourceMappingURL=chunk-RGVBGTD6.js.map