vector.Store interface (and vector.Statter), so nothing else changes: remember writes and query reads the same four indexes (entities, edges, chunks, summaries) per dataset.
Code: internal/db/vector/s3vectors.go (the wrapper vector.S3Vectors), wired in internal/db/db.go.
Configuration
A value in the TOML file overrides the environment variable. Credentials are not in the config: they come from the standard AWS chain (
AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY, ~/.aws, an IAM role). The identity needs s3vectors:CreateIndex, DeleteIndex, PutVectors, QueryVectors, DeleteVectors, ListVectors and GetVectors on the bucket. gligabao does not create the bucket.
embedding_dimensions is the dimension every index is created with; it cannot change afterwards (an index has a fixed dimension), so changing it needs new indexes (a new prefix).
How datasets are laid out
S3 Vectors has no directories: a vector bucket holds indexes, each with a fixed dimension and distance metric. To get the subdirectory structure, a gligabao vector dataset (see vectors.md) is one index of the bucket, named- The prefix is the directory of a deployment: several gligabao deployments (prod, staging, a project) can share one bucket, each with its own prefix, and never see each other’s vectors.
- The dataset is the subdirectory: vectors of different datasets live in different indexes, so they never mix and a query only searches the index it names (no metadata filter needed for isolation).
- Index names are 3-63 characters of
a-z,0-9,-and.. The name is lower-cased and other characters become-; if the name had to be altered (or is too long) an 8-hex-digit hash of the original dataset name is appended, so two datasets never share an index. The names gligabao generates (dataset-<id>-<index>) are used as they are. The empty dataset isdefault.vector.S3VectorsIndexName(prefix, dataset)gives the name.
Behaviour
Metadata (
kind, entity_id, name, …) is stored as filterable S3 metadata (up to 2 KB per vector); it is returned with every match. S3 Vectors is eventually consistent for writes only in the sense of AWS’s own guarantees: gligabao does nothing special.
The wrapper takes the AWS client through the small interface vector.S3VectorsAPI, so tests (s3vectors_test.go) use a fake and need no AWS account.
Limits
- The store is write-through to AWS: there is no local copy, and no
vector.Exporter(thedbexportarchive does not include S3 vectors, as with Pinecone). - One metric (cosine) and one data type (
float32). - Requests are billed by AWS per
PutVectors/QueryVectorscall and by stored data;Stats(listing) is the one to avoid calling in a loop on big datasets.