PrepCity

RAG, long context or a cache?

Open the lab

By the last page, this is the design you will have built. Drag it, or Show all, to see every part.

Lesson · 7 pages · about 5 min

RAG, long context or a cache?

Models now read hundreds of thousands of tokens, so why retrieve at all? Send a few chunks, send everything, or send everything once and cache it: each choice trades cost, completeness and freshness. See all three on one small knowledge base.

Words you’ll learn

  • RAG
  • Chunk
  • Context window
  • Lost in the middle
  • Prompt caching
  • Cache-augmented generation
  • Cache
  • Long context
  • Self-Route

Page by page