migrate article embeddings to support multi-model architecture and enhance data integrity

This commit is contained in:
ImBenji
2026-04-18 17:19:55 +01:00
parent 88f465e71f
commit 4616998064
3 changed files with 67 additions and 20 deletions
+6 -2
View File
@@ -29,8 +29,11 @@ async function statusRoutes(fastify) {
);
const embeddingModelRows = db.prepare(`
SELECT model, COUNT(*) AS article_count
FROM article_embedding_store
SELECT
model,
COUNT(*) AS article_count,
(SELECT LENGTH(embedding) FROM article_embedding_store s2 WHERE s2.model = s.model LIMIT 1) AS sample_bytes
FROM article_embedding_store s
GROUP BY model
ORDER BY article_count DESC
`).all();
@@ -45,6 +48,7 @@ async function statusRoutes(fastify) {
embeddingModels: embeddingModelRows.map((row) => ({
model: row.model,
articles: row.article_count,
dimensions: row.sample_bytes ? row.sample_bytes / 4 : null,
})),
};
});