Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 13.2 — Design: Question Answering over Company Documents
RAG and Vector Search · Example 1 of 1

A capacity estimator for the design

Prices and the index overhead are examples and assumptions. Replace them with your provider's numbers and a measured overhead for your index.

A worked system-design answer for 'build question answering over our company documents': requirements, back-of-envelope numbers, ingestion, retrieval, answers, evaluation, security and scale, with the arithmetic done by hand.

Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.

Ready for more? This phase has 5 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

A store holds 1,000,000 chunks embedded at 768 dimensions as 32-bit floats. Print its raw vector size in gigabytes with three decimals.

02

The same vectors are stored as one byte per number (8-bit). Print both sizes, and the size as a percentage of the float version.

Explain it without notes

01

Walk through the arithmetic for 20,000 documents of 10 chunks each at 384 dimensions.

02

Why is access control part of the data model and not a final step?

03

What do you build first, and why before any clever retrieval?

04

Where does the money go in a RAG question, and what is the biggest lever?

A capacity estimator for the design
Sign in to run this example in your browser.

Expected output

chunks: 200000
vectors: 307.2 MB raw, 460.8 MB with index overhead
embedding the corpus once: 60000000 tokens, $1.20
load: 0.23 questions/s average, 1.16 at peak, about 4.6 in flight at peak
prompt: 1700 tokens in, 260 out
cost: $1.24 per 1000 questions, $24.80 a day, $744.00 a month
input share of the cost: 68.5%
with 3 sources: $0.94 per 1000 questions, 24.2% cheaper