feat(db): extraction des embeddings + mode WAL + config DB provider-agnostic

- Ajout de la table de relation 1-1 NoteEmbedding pour alléger Model Note
- Refactor complet des actions IA sémantique et Memory Echo pour utiliser la jointure
- Migration propre des 85 embeddings locaux existants
- Ajout PRAGMA journal_mode=WAL pour la concurrence au sein de lib/prisma
- Ajout npm run db:switch pour configuration auto SQLite / PostgreSQL
- Fix du compilateur Turbopack et Next-PWA
This commit is contained in:
Sepehr Ramezani
2026-04-17 22:05:19 +02:00
parent a57c277168
commit 3ef5915062
10 changed files with 180 additions and 36 deletions

View File

@@ -29,7 +29,7 @@ export async function GET() {
select: {
id: true,
title: true,
embedding: true
noteEmbedding: true
}
})
@@ -45,7 +45,7 @@ export async function GET() {
for (const note of allNotes) {
// Check if embedding is missing
if (!note.embedding) {
if (!note.noteEmbedding?.embedding) {
missingCount++
invalidNotes.push({
id: note.id,
@@ -57,8 +57,8 @@ export async function GET() {
// Validate embedding
try {
if (!note.embedding) continue
const embedding = JSON.parse(note.embedding) as number[]
if (!note.noteEmbedding?.embedding) continue
const embedding = JSON.parse(note.noteEmbedding.embedding) as number[]
const validation = validateEmbedding(embedding)
if (!validation.valid) {