HNSW & Token Tuning
Embedding Dimensions: 1536d vs 1024d vs 768d Byte Cost
Compare memory density, HNSW throughput, and Matryoshka dimension truncation when choosing embeddings for long-term conversational facts.
768d Cuts RAM 50% vs 1536d · 3072d Doubles Cost w/ <1% Gain
Why Short Atomic Facts Need Fewer Dimensions
Unlike 2,000-token legal PDFs, Mem0 memories are concise 15-40 word atomic statements ("Prefers dark mode", "Allergic to peanuts"). Truncating text-embedding-3-small to 768 dimensions via Matryoshka API parameters cuts vector RAM 50% with near-identical Top-8 recall.
Avoiding 3072d Over-Provisioning
Using 3072d embeddings doubles both RAM and NVMe bandwidth for negligible retrieval improvement on short conversational facts.
Measured Thresholds & Vector Stack Parameters
| Dimension Size | fp32 Bytes / Vector | int8 Bytes / Vector (w/ Graph) |
|---|---|---|
| 768d (Nomic / Matryoshka) | 3,072 bytes | 1,088 bytes (~1.01 GB / 1M) |
| 1024d (BGE-M3 / Cohere) | 4,096 bytes | 1,344 bytes (~1.25 GB / 1M) |
| 1536d (text-embedding-3-small) | 6,144 bytes | 1,856 bytes (~1.73 GB / 1M) |