@@ -337,40 +337,31 @@ export class ActualZvecStore implements IZvecStore {
337337/**
338338 * Create a zvec store with the given config.
339339 *
340- * When @zvec/zvec is available, creates a persisted ActualZvecStore.
341- * Otherwise falls back to an in-memory MemoryZvecStore.
340+ * Requires @zvec/zvec to be installed. Throws an error when it is not available.
342341 */
343342export async function createZvecStore (
344343 path : string ,
345344 config : ZvecStoreConfig ,
346- memoryFtsWeights ?: import ( './types' ) . FtsFieldWeight [ ] ,
347- rankConstant ?: number ,
348345) : Promise < IZvecStore > {
349- const z = loadZvecSync ( ) ;
350- if ( z ) {
351- return ActualZvecStore . create ( path , config ) ;
352- }
353- const { MemoryZvecStore } = await import ( './memory-store' ) ;
354- return new MemoryZvecStore ( memoryFtsWeights , rankConstant ) ;
346+ return ActualZvecStore . create ( path , config ) ;
355347}
356348
357349/**
358350 * Asynchronously open a zvec store.
351+ *
352+ * Requires @zvec/zvec to be installed.
359353 */
360354export async function openZvecStore (
361355 path : string ,
362356 options ?: ActualZvecStoreOptions
363357) : Promise < IZvecStore > {
364- // Both ActualZvecStore.open() and MemoryZvecStore are internally
365- // synchronous — this async wrapper is for API consistency only.
366358 return openZvecStoreSync ( path , options ) ;
367359}
368360
369361/**
370362 * Synchronously open a zvec store.
371363 *
372- * This avoids the async Promise wrapper so it can be used inside synchronous
373- * code paths (e.g. `retrieve()`).
364+ * Requires @zvec/zvec to be installed. Throws an error when it is not available.
374365 */
375366export function openZvecStoreSync (
376367 path : string ,
@@ -381,9 +372,8 @@ export function openZvecStoreSync(
381372 return ActualZvecStore . openSync ( path , options ) ;
382373 }
383374 throw new Error (
384- 'Cannot open zvec store: @zvec/zvec is not installed and MemoryZvecStore ' +
385- 'has no persistence. Install @zvec/zvec or use createZvecStore() to create ' +
386- 'a new MemoryZvecStore.'
375+ '@zvec/zvec is not installed. Install it with:\n' +
376+ ' pnpm add @zvec/zvec'
387377 ) ;
388378}
389379
0 commit comments