Skip to content

Architecture

Why these design choices?

DesignChoiceWhy
ProviderGemini (default)Strong quality/cost ratio, 3072 dims, generous free tier
Dimensions3072Captures nuance in business email and jargon
NormalizationL2-normalize vectorsEnables faster inner product search
IndexHNSW with vector_ip_ops / halfvec_ip_opsInner product is efficient for normalized vectors
Vector typehalfvec for dims > 2000Allows HNSW indexing up to ~4000 dims
SearchMetadata-augmentedHard filters prevent “vector drift”

The strongest pattern is hard filters first, then semantic scoring.

  • Hard filters (metadata): sender, date, folder, has_attachments, unread, etc.
  • Semantic ranker: inner product / cosine-equivalent on normalized vectors

Released under the MIT License.