Skip to content

Commit 062f1d8

Browse files
author
福晋
committed
chore: remove memory store
1 parent 375d536 commit 062f1d8

12 files changed

Lines changed: 29 additions & 603 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ await ctx.close();
213213
- **Public API**: `Context`, `QueryOptions`, `QueryResult`, `Document`, `Loader`, `MarkdownLoader`, `JsonLoader`, `TextLoader`, `pathToId`
214214
- **Reranking**: `KeywordReranker`, `createReranker`, `Reranker`, `RerankCandidate`, `RerankResult`, `RerankOptions`
215215
- **Query Expansion**: `SynonymExpander`, `NoopExpander`, `QueryExpander`, `QueryExpansionOptions`
216-
- **Advanced API**: `Embedder`, `TransformersEmbedder`, `EmbedderManager`, `IZvecStore`, `MemoryZvecStore`, `ActualZvecStore`, `DocumentRegistry`, `Store`
216+
- **Advanced API**: `Embedder`, `TransformersEmbedder`, `EmbedderManager`, `IZvecStore`, `ActualZvecStore`, `DocumentRegistry`, `Store`
217217

218218

219219
## License

‎src/index.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export type { EmbedderInfo, EmbedderKind } from './embedder';
4444
// Zvec store — custom vector storage backends
4545
export {
4646
IZvecStore,
47-
MemoryZvecStore,
4847
ActualZvecStore,
4948
createZvecStore,
5049
openZvecStore,
@@ -58,7 +57,6 @@ export type {
5857
ZvecQueryResult,
5958
ZvecSearchParams,
6059
ZvecHybridParams,
61-
FtsFieldWeight,
6260
ZvecFieldSchema,
6361
ZvecStoreConfig,
6462
ActualZvecStoreOptions,

‎src/storage/actual-store.ts‎

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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
*/
343342
export 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
*/
360354
export 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
*/
375366
export 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

‎src/storage/memory-store.ts‎

Lines changed: 0 additions & 265 deletions
This file was deleted.

0 commit comments

Comments
 (0)