Перейти к содержимому

Session 6 - RAG vs. CAG: Search vs. Memory - in Persian

Hamid Sadeghi

0:00 / 0:00

Session 6 - RAG vs. CAG: Search vs. Memory - in Persian

25 просмотров · 10 дн. назад
Hamid Sadeghi
42 подписчика
25 просмотров · 10 дн. назад
Session 6 - RAG vs. CAG: Search vs. Memory In Session 3, we learned how RAG (Retrieval-Augmented Generation) works like a librarian—searching a database to find the right pieces of text before answering. But what if the AI could just memorize the whole book instead? In this session, we look at CAG (Cache-Augmented Generation). CAG skips the search step entirely by loading the whole document into the AI's high-speed memory (the KV Cache). It is the difference between searching for an answer and remembering it. We compare these two approaches head-to-head and build both systems from scratch in Python. What you will learn: Why RAG struggles with speed and missing chunks What CAG is and how it works The secret behind the "KV Cache" (and why the first read is the hardest) When you should use RAG vs. when you should use CAG A live Kaggle demo using a real Bank Complaints dataset, showing exactly how to code both pipelines and compare their speed. Watch to the end to see the "memorization phase" in action and learn why CAG isn't a replacement for RAG—it's a new superpower for your AI.