migrate article embeddings to support multi-model architecture and enhance data integrity
This commit is contained in:
@@ -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,
|
||||
})),
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user