/** * @module @nhtio/adk/batteries/vector/s3vectors * * AWS S3 Vectors vector-store adapter. A vector BUCKET is provisioned out-of-band (the adapter * does NOT create the bucket); a logical collection = an **index** inside that bucket. The SDK is * command-based: create/delete/list indexes, PutVectors/QueryVectors/GetVectors/DeleteVectors. * * Scoring rule: QueryVectors returns `distance`. For cosine, distance = 1 - cosineSim; identical * vectors → 0. For euclidean, distance = L2 distance. Scores are derived from the returned * distance and normalized to [0,1]. * * Metadata is NATIVE JSON (object). Store the document text under the reserved metadata key * `__document`; keep user metadata flat alongside. On read, pull `__document` out into * `match.document` and return the rest as `match.metadata`. * * Filtering: S3 Vectors supports a native filter (Mongo-ish), but for guaranteed cross-adapter * parity, **over-fetch and JS-filter** with `evaluateFilter`. When `plan.filter` is set, request * a larger `topK` (e.g. 500) without a native filter, then JS-filter, then slice. * * Eventual consistency: settle-poll after writes/deletes so the conformance suite — which writes * then immediately reads — passes deterministically. */ import { BaseVectorStore } from "../contract"; import type { SearchPlan, UpsertPlan, DeletePlan, CollectionSpec } from "../plan"; import type { VectorMatch, VectorStoreCapabilities, BaseVectorStoreOptions } from "../types"; export interface S3VectorsVectorStoreOptions extends BaseVectorStoreOptions { /** Connection and authentication parameters for the backend. */ connection: { bucket: string; region?: string; credentials?: { accessKeyId: string; secretAccessKey: string; sessionToken?: string; }; indexPrefix?: string; }; } export declare class S3VectorsVectorStore extends BaseVectorStore { #private; readonly capabilities: VectorStoreCapabilities; /** Static availability probe: whether this adapter's runtime driver can load in the current environment. */ static isAvailable(): boolean; isAvailable(): boolean; connect(): Promise; close(): Promise; createCollection(spec: CollectionSpec, ifNotExists: boolean): Promise; dropCollection(collection: string, ifExists: boolean): Promise; hasCollection(collection: string): Promise; renameCollection(_from: string, _to: string): Promise; executeUpsert(plan: UpsertPlan): Promise; executeSearch(plan: SearchPlan): Promise; executeDelete(plan: DeletePlan): Promise; }