RAG vs CAG vs MAG
Three ways to give an AI the knowledge it needs: RAG retrieves external context for each question; CAG pre-loads the knowledge into a cache once; MAG (memory-augmented generation) lets the AI both read and write a memory, so it remembers things across conversations.
Everyday analogy
RAG is the open-book exam. CAG is the chef with every ingredient prepped. MAG is a personal assistant with a notebook: they look things up in it and also write down what they learn about you.
Example
A travel assistant uses RAG to search hotel listings, CAG for its fixed booking rules, and MAG to remember that you prefer window seats and vegetarian meals.
RAG
Retrieve external context at question time.
Best for large, changing document collections.
CAG
Pre-load the knowledge into the model's cache.
Best for small, stable knowledge; very fast.
MAG
Read and write a memory store.
Best for personal assistants and agents that learn over time.
Try it yourself
About 10 minPick the right approach
- Write three scenarios: a small fixed price list, a huge legal library, a personal assistant that remembers you.
- Match each to RAG, CAG or MAG.
- Write one sentence explaining each choice.
What you should see: Each approach fits a different size and type of knowledge.
Use any free AI chatbot (ChatGPT, Claude, Gemini or Copilot). Never paste private or confidential information.