Do you need RAG at all? Work out the cost first
RAG adds a pipeline and a second place for things to go wrong. If your documents fit in one request, sending all of them can be simpler. Here is how to decide with real numbers.
The 60-second version
- RAG adds ingestion, an index and a reranker, and gives you two places for answers to go wrong.
- If all your documents fit comfortably in one request, you can send them every time and let prompt caching make the repeat cheap.
- In the book’s worked example, 40,000 tokens of policy cost ₹1.40 a question cached, ₹14 after the cache expires, and RAG about ₹0.42.
- Decide on size, how often documents change, who may see what, and answer quality tested on your own questions.
RAG is a whole pipeline. You cut documents into chunks, embed and index them, search, rerank, and only then ask the model. That gives you two places for things to go wrong: the right text may never reach the model, or the model may misuse it. So before building it, ask whether you need it at all.
If all your documents fit comfortably in one request, you can simply send all of them every time, and let prompt caching make the repeated text cheap. Anthropic suggests considering this for anything under about 200,000 tokens, which is roughly 500 pages.
RAG is usually cheaper per question. Sending everything is simpler, and it never misses a chunk.
Work it out
Ship Real AI works this through for its example shop. Suppose all its policies come to 40,000 tokens. Cached, at the book’s example price of ₹35 per million tokens, they cost ₹1.40 a question.
The cache expires, though, when no request arrives for a few minutes, and the first request after that pays the full example price of ₹350 per million: ₹14 for that one question. RAG, by comparison, sends about 1,200 tokens of policy at the full price, about ₹0.42 a question, plus the cost of the reranker.
Your prices and token counts will differ. The method won’t: count the tokens, apply your provider’s cached and uncached prices, and remember the cache misses when traffic is quiet.
Four questions decide it
Size. A few hundred pages can be sent whole. Thousands cannot.
Change. Documents that change every day keep breaking the cache.
Access. If some customers or staff may see only some documents, filtering chunks by who is asking is how you enforce it, and that needs retrieval.
Quality. Answers get worse as inputs grow, so a long prompt is not automatically a better one. Test both approaches on your own questions before you decide.
What to do this week
Count the tokens in the documents your assistant answers from. If they fit in one request, run your test questions twice, once with everything sent and cached and once through your RAG pipeline, and compare accuracy and the cost per question. Build the pipeline only if it wins on the questions your users actually ask.
Worked example from Ship Real AI, Module 7, section 7.7. Prices are the book’s example prices.