CAG: Cache-Augmented Generation

CAG loads all the knowledge into the AI's memory (context window) once, in advance, and keeps it ready (cached). There is no search step for each question, so answers are fast.

Everyday analogy

A chef who preps every ingredient on the counter before service. With RAG the chef runs to the store for each order; with CAG everything is already within reach.

Example

A product FAQ bot with a 20-page manual: the whole manual is preloaded once, and every customer question is answered instantly from it.

🔎RAG• Search for each question• Only relevant pieces sent• Scales to huge libraries📦CAG• Load all knowledge once• Kept ready (cached)• Fast for small, stable knowledgeVS
RAG fetches per question; CAG pre-loads everything when the knowledge is small enough.

RAG

  • Searches for relevant pages each time
  • Works with huge, changing libraries of documents
  • A little slower; depends on search quality

CAG

  • Preloads everything once and reuses it
  • Best for small, stable knowledge (fits in memory)
  • Very fast; no search step to go wrong

Try it yourself

About 10 min

Try cache-style knowledge

  1. Paste a short product guide into an AI chatbot once.
  2. Ask 5 different questions in the same chat without pasting it again.
  3. Notice it answers from the guide already in its memory.

What you should see: Loading the knowledge once and reusing it is the idea behind CAG.

Use any free AI chatbot (ChatGPT, Claude, Gemini or Copilot). Never paste private or confidential information.

Build it for real · guided projectBuild a document Q&A assistant (RAG, no code)About 60 min · No coding needed · step by step
Test what you learned

Take a quick quiz, or look up any word in the glossary.