import { VectorStore } from "./vector-store.contract.mjs"; import { CacheDriver } from "@warlock.js/cache"; //#region ../ai/src/rag/store/cache-vector-store.d.ts /** * Adapt any `@warlock.js/cache` `CacheDriver` to the {@link VectorStore} * narrowing the RAG pipeline depends on. The cache driver IS the vector * store — exactly as `SemanticMemory` and `semanticCache` already use it: * * - `upsert` → `driver.set(key, value, { vector, tags })` * - `query` → `driver.similar(vector, { topK, threshold, tags })` * - `removeNamespace` → `driver.removeNamespace(namespace)` * * Drivers without similarity support throw `CacheUnsupportedError` from * `set({ vector })` / `similar()`; the error surfaces unchanged so the * caller sees the cache layer's own message (pointing at the `pg` / * `redis` drivers for production-scale similarity). * * @example * const store = cacheVectorStore(new MemoryCacheDriver()); * await store.upsert("ai.rag.docs.guide.0", { text: "…" }, vector); * const hits = await store.query(queryVector, { topK: 5, threshold: 0.5 }); */ declare function cacheVectorStore(driver: CacheDriver): VectorStore; //#endregion export { cacheVectorStore }; //# sourceMappingURL=cache-vector-store.d.mts.map