Fix sqlite-vec dimension changes for local profiles
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user