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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user