/** * `VectorStores` — manage hosted vector stores on the registered AI * provider (#B8 Phase 1). * * Today only OpenAI implements `createVectorStores()` on its provider * factory; calls against other providers throw a helpful error pointing * users at `similaritySearch()` over a local pgvector model. * * @example * ```ts * import { VectorStores } from '@gemstack/ai-sdk' * * const store = await VectorStores.create('Knowledge Base') * await store.add({ filePath: './report.pdf', attributes: { author: 'Alice' } }) * * const all = await VectorStores.list() * await VectorStores.delete(store.id) * ``` * * Provider override per-call via `opts.provider`. The default falls * back to the registered AI default (first entry in the registry, or * `AiRegistry.getDefault()`'s provider name). * * Phase 2 of B8 adds the `fileSearch({ stores })` agent tool that * consumes these stores. Phase 3 wires the local pgvector fallback. */ import type { VectorStoreCreateOptions, VectorStoreListOptions, VectorStoreInfo, VectorStoreFileInfo, VectorStoreAddOptions } from '../types.js'; /** * Wrapper around a single hosted vector store. Holds the provider name * + store id so per-store operations don't need to repeat them. */ export declare class VectorStore { readonly id: string; readonly name: string; readonly createdAt: number; readonly fileCount: number; readonly bytesUsed: number | undefined; readonly metadata: Record | undefined; /** Provider that owns this store (e.g. `'openai'`). */ readonly provider: string; constructor(info: VectorStoreInfo, provider: string); /** * Attach a file to this store. Either pass an existing provider * `fileId` or a local source (`filePath` or `fileBuffer`) — the * adapter uploads via the Files API first and reuses the returned id. * * Defaults to waiting until the file is fully indexed * (`status === 'completed'`). Pass `wait: false` for fire-and-forget. */ add(opts: VectorStoreAddOptions): Promise; /** Remove a file from this store. The file remains in the provider's * Files API (use `AI.files(provider).delete(id)` to fully delete). */ remove(fileId: string): Promise; /** List all files attached to this store. */ files(opts?: VectorStoreListOptions): Promise; /** Delete this store. Files attached to it stay in the provider's * Files API; call `AI.files(provider).delete(id)` to clean those up * separately. */ delete(): Promise; } /** * Static facade for hosted-vector-store CRUD across all providers * implementing `createVectorStores()`. */ export declare class VectorStores { /** * Create a new vector store on the registered (or specified) * provider. */ static create(name: string, opts?: Omit): Promise; /** * List vector stores on the registered (or specified) provider. * * `opts.limit` / `opts.after` / `opts.before` map directly to the * provider's pagination cursor — apps wanting a complete list need to * iterate manually. */ static list(opts?: VectorStoreListOptions & { provider?: string; }): Promise; /** * Fetch a vector store by id. Throws when not found (provider-specific * error surface — typically a 404). */ static get(id: string, opts?: { provider?: string; }): Promise; /** * Delete a vector store by id. Files attached to it stay in the * provider's Files API. */ static delete(id: string, opts?: { provider?: string; }): Promise; } //# sourceMappingURL=index.d.ts.map