Skip to content

Commit c71fc11

Browse files
committed
chore: add throw logic for sqlite-vec native load failures (#9710)
1 parent f63e98c commit c71fc11

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

ai/mcp/server/memory-core/services/SQLiteVectorManager.mjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ class SQLiteVectorManager extends Base {
5151
let dbPath = typeof aiConfig.sqlitePath === 'string' ? aiConfig.sqlitePath : path.resolve(process.cwd(), 'chroma-neo-memory-core/graph/knowledge-graph.sqlite');
5252
await fs.ensureDir(path.dirname(dbPath));
5353

54-
console.error("DEBUG SQLITE INIT. DBPATH=", dbPath);
55-
5654
// Dynamic imports for native modules
5755
const Database = (await import('better-sqlite3')).default;
5856
const sqliteVec = await import('sqlite-vec');
@@ -63,7 +61,11 @@ class SQLiteVectorManager extends Base {
6361
this.db.pragma('journal_mode = WAL');
6462

6563
// Load the sqlite-vec extension
66-
sqliteVec.load(this.db);
64+
try {
65+
sqliteVec.load(this.db);
66+
} catch (e) {
67+
throw new Error(`Failed to load sqlite-vec native extension from path [${extPath}]. Ensure binary compatibility for your architecture.`, { cause: e });
68+
}
6769

6870
// System tables
6971
this.db.exec(`

0 commit comments

Comments
 (0)