memory-vector-store
Version:
A lightweight memory-based vector store with persistent storage support for both Node.js and browser environments. Efficiently store, retrieve, and search vector embeddings with minimal dependencies.
2 lines (1 loc) • 454 B
JavaScript
import{a as i,b as a}from"./chunk-4SH6UCRM.js";var o=class{save(r,e){localStorage.setItem(r,JSON.stringify(e))}load(r){let e=localStorage.getItem(r);return e?JSON.parse(e):[]}exists(r){return localStorage.getItem(r)!==null}};function c(t,r){let e={autoSave:!0,debug:!1,maxFileSizeMB:3,storagePath:"memory-vector-store",...r};return e.maxFileSizeMB=Math.max(Math.min(e.maxFileSizeMB,3),.1),new a(t,new o,e)}export{c as browserMemoryVectorStore,i as doc};