← All questions
Retrieval & EmbeddingsMedium· Vector Search· Indexing· Memory Management

Given 10 million chunks at 768 dimensions, which vector...

A strong answer avoids recommending a specific algorithm in a vacuum. Instead, it asks for the RAM budget and the recall target. For 10 million 768-dimensional vectors, raw storage is 30.7 GB. HNSW at M=16 adds overhead but provides sub-millisecond latency. IVF-PQ at m=96 significantly reduces the footprint to roughly 1 GB, using nprobe as a dial to manage recall. The decision is a trade-off between these constraints, and the algorithm choice is secondary to meeting the system’s specific requirements.

Code playground (Python)