feat: embedding dimension validation + migration system
Some checks failed
CI / Lint, Test & Build (push) Failing after 8m1s
CI / Deploy production (on server) (push) Has been cancelled

- Add /api/admin/embeddings/dimension (GET column dim, POST test model dim)
- Add /api/admin/embeddings/migrate (alter column, clear, re-index)
- Admin form warns on dimension mismatch after save, offers migrate button
- Remove hardcoded 1536 from validate endpoint and embedding service
- Add validateDimension() utility to EmbeddingService
- Fix health route: import prisma correctly, use router instead of missing registry
- i18n keys for dimension warning (EN/FR)
This commit is contained in:
Antigravity
2026-05-19 18:45:50 +00:00
parent 28f46860c1
commit 6a8d0eb0a5
10 changed files with 297 additions and 20 deletions

View File

@@ -1137,7 +1137,12 @@
"languageDetection": "Language detection",
"languageDetectionDesc": "Automatically detects the language of each note",
"autoLabeling": "Auto labeling",
"autoLabelingDesc": "Suggests and applies labels automatically"
"autoLabelingDesc": "Suggests and applies labels automatically",
"dimensionMismatch": "Embedding dimension mismatch detected",
"dimensionMismatchDetail": "Database column: vector({{dbDimension}}) — Model outputs: {{modelDimension}} dimensions",
"dimensionMismatchAction": "Embeddings will not work until you migrate the column. This will clear all existing embeddings and re-index them.",
"migrateButton": "Migrate & Re-index",
"migrating": "Migrating..."
},
"resend": {
"title": "Resend (Recommended)",