Fix sqlite-vec dimension changes for local profiles

This commit is contained in:
“BeeRad”
2026-05-02 10:46:02 +10:00
parent 782ace9a34
commit 9575815d83
4 changed files with 108 additions and 30 deletions
+5
View File
@@ -1,6 +1,7 @@
import { getSQLiteClient } from '@/services/database/sqlite-client';
import { NodeEmbedder } from '@/services/typescript/embed-nodes';
import { UniversalEmbedder } from '@/services/typescript/embed-universal';
import { getVectorBackendType } from '@/services/vectorBackend';
async function maybeRecreateQdrantCollections() {
if (process.env.VECTOR_BACKEND !== 'qdrant' || process.env.QDRANT_RECREATE_COLLECTIONS !== 'true') {
@@ -30,6 +31,10 @@ async function maybeRecreateQdrantCollections() {
async function main() {
const sqlite = getSQLiteClient();
await maybeRecreateQdrantCollections();
if (getVectorBackendType() === 'sqlite-vec') {
sqlite.recreateVectorTables();
console.log('[rebuild-embeddings] Recreated sqlite-vec tables for the active embedding dimensions.');
}
const nodeRows = sqlite.query<{ id: number; source?: string | null }>(`
SELECT id, source
FROM nodes