Rag And Retrieval medium
You plan to index 50M chunks using 1,536-dimensional fp32 embeddings and keep the vectors in RAM for HNSW search. Roughly how much memory do the raw vectors need, and what follows from that?
- A About 30 GB, so the full index fits comfortably in the RAM of one commodity node with headroom to spare.
- B About 77 GB, because each dimension is stored as a 1-byte value in the default vector storage format.
- C About 3 TB, because each vector also stores its full chunk text inline within the same memory block.
- D About 300 GB before index overhead, so reducing dimensions or quantizing vectors is worth evaluating.
Answer: D. About 300 GB before index overhead, so reducing dimensions or quantizing vectors is worth evaluating.
The raw size is 50M x 1,536 x 4 bytes, about **307 GB**, before HNSW graph overhead. That pushes you toward sharding, dimension reduction, or **int8 quantization**, which cuts memory about 4x at a small recall cost. The 77 GB figure assumes 1-byte values, which is only true after quantization. Keeping full fp32 is reasonable for small corpora or when every point of recall matters.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- You must index 100M chunks using a 3,072-dimension embedding in fp32, served from RAM via HNSW. The raw vectors alone take about 1.2 TB before graph overhead. You need to cut memory several-fold while losing at most a point or two of recall@10. Which approach fits?
- A multi-tenant SaaS app stores all tenants in one vector index with a tenant_id field. Queries fetch the top 20 chunks by similarity and then drop chunks from other tenants. Small tenants often get 0-2 results. Why does this happen, and what is the fix?
- Runbooks are split into fixed 300-token chunks with no overlap. When a procedure step starts near the end of one chunk and finishes in the next, answers come back incomplete. What is the lowest-cost fix?
- Your offline eval shows recall@5 of 92% on a labeled set, so the gold passage is in the context for nearly every question. Yet human graders mark 35% of answers wrong, and the wrong answers often ignore or contradict the gold passage. Where should the team invest next?
- Your product requires every RAG answer to include clickable source citations that users can verify. How should those citations be produced?
- A runbook RAG system uses fixed 500-token chunks with no overlap. Users who ask for a multi-step recovery procedure get answers that stop at step 4 of 9, and retrieval logs show the top hit ends mid-procedure. What is the most targeted fix?