Skip to content

Dimensions & storage

Important

Embedding dimensions cannot be changed after initial sync without re-embedding all emails. See Migration.

Automatic quantization for high dimensions

pgvector’s HNSW index has practical limits around ~2000 dims for 32-bit vectors (8KB block size). For dimensions > 2000, Gmail Secretary can store embeddings as halfvec (16-bit quantization).

DimensionsVector typeIndex opsNotes
≤ 2000vector (32-bit)vector_ip_opsStandard precision
> 2000halfvec (16-bit)halfvec_ip_opsQuantized, small recall tradeoff

Dimension selection guide

DimensionsStorage (25k emails)Best for
768~60 MBStorage-constrained or simple queries
1536~120 MBBalanced / general purpose
3072~240 MBBest nuance for business email

When to use each

768

  • Personal mail, simple queries
  • Faster index builds
  • Storage constrained

1536

  • General purpose balance
  • Mixed personal + work mail

3072 (recommended)

  • Business email, nuanced search
  • More future-proof
  • Higher storage

Released under the MIT License.