Skip to main content
Amazon S3 Vectors is an S3 bucket type for vectors. gligabao can use it as its vector store, as an alternative to the local chromem store and Pinecone. It implements the same 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 is default. vector.S3VectorsIndexName(prefix, dataset) gives the name.
The limit of indexes per bucket (10,000 by default in AWS) is the limit of datasets x 4 indexes per bucket and prefix.

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 (the dbexport archive does not include S3 vectors, as with Pinecone).
  • One metric (cosine) and one data type (float32).
  • Requests are billed by AWS per PutVectors / QueryVectors call and by stored data; Stats (listing) is the one to avoid calling in a loop on big datasets.