Skip to content

Commit 96101b1

Browse files
ashu17706claude
andcommitted
Fix: Load sqlite-vec extension in database connection
Enable vector search and embeddings support by loading the sqlite-vec extension when creating database connections in Smriti. This was blocking smriti embed command from working. Changes: - Import sqlite-vec package in src/db.ts - Load extension in getDb() function via sqliteVec.load(_db) - Enables vectors_vec virtual table support - Unlocks hybrid search and semantic recall capabilities Related: QMD Architecture Deep Dive learning session stored in Smriti Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent cdfd8b5 commit 96101b1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/db.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
import { Database } from "bun:sqlite";
9+
import * as sqliteVec from "sqlite-vec";
910
import { QMD_DB_PATH } from "./config";
1011
import { initializeMemoryTables } from "./qmd";
1112

@@ -21,6 +22,8 @@ export function getDb(path?: string): Database {
2122
_db = new Database(path || QMD_DB_PATH);
2223
_db.exec("PRAGMA journal_mode = WAL");
2324
_db.exec("PRAGMA foreign_keys = ON");
25+
// Load sqlite-vec extension for vector search support
26+
sqliteVec.load(_db);
2427
return _db;
2528
}
2629

0 commit comments

Comments
 (0)