---
title: "Discussion on \"RAG vs CAG: The Future of Dynamic Knowledge in LLMs\" | Hashnode"
description: "Discussion on \"RAG vs CAG: The Future of Dynamic Knowledge in LLMs\". Discover the differences between RAG and CAG, how they work, and why modern LLMs are beginning to adopt cache-based approaches."
url: "https://hashnode.com/posts/rag-vs-cag-the-future-of-dynamic-knowledge-in-llms/6a4faaad929e331e4ea37bfe"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [RAG vs CAG: The Future of Dynamic Knowledge in LLMs](https://buildwithchiru.hashnode.dev/rag-vs-cag-the-future-of-dynamic-knowledge-in-llms?utm_source=hashnode&utm_medium=feed)

Discover the differences between RAG and CAG, how they work, and why modern LLMs are beginning to adopt cache-based approaches.

Jul 9 · 4 min read · buildwithchiru.hashnode.dev  
Read the article

-   [#ai](https://hashnode.com/tag/ai)
-   [#llm](https://hashnode.com/tag/llm)
-   [#rag](https://hashnode.com/tag/rag)
-   [#generative-ai](https://hashnode.com/tag/generative-ai)
-   [#ai-engineering](https://hashnode.com/tag/ai-engineering)
-   [#cag](https://hashnode.com/tag/cag)

## Written by

[Chiranjeevi R](https://hashnode.com/@chiranjeevi7777)

@chiranjeevi7777 · Bengaluru, India

  
[View profile](https://hashnode.com/@chiranjeevi7777)

Building AI, One Project at a Time. Sharing Everything I Learn.

Hi, I'm Chiranjeevi — an AI Engineer passionate about building intelligent software that solves real-world problems. I believe the best way to learn is by building, so this blog is where I document everything I explore—from Python fundamentals and machine learning to GenAI, agentic AI, backend development, and production-ready systems. You'll find: 🤖 AI &amp; Machine Learning projects 🧠 GenAI, LLMs &amp; AI Agents 🐍 Python tutorials and best practices ⚡ Backend engineering and APIs 🛠️ Open-source projects and developer tools 📚 Lessons learned while building real applications My goal isn't just to write about technology—it's to share practical insights, mistakes, and solutions that help other developers build better software. If you're passionate about AI, love building projects, or enjoy learning in public, you're in the right place. Build. Learn. Share. Repeat.

## Responses 2

Markdown supported · ⌘↵ to post

[Rajesh Killadi](https://hashnode.com/@rajesh_killadi)

[Jul 10](https://hashnode.com/posts/rag-vs-cag-the-future-of-dynamic-knowledge-in-llms/6a4faaad929e331e4ea37bfe/comment/6a505e2c1525c3e7b17555b7)

I feel like you should've also talked about the new problems CAG brings in. I think it needs way more working memory to hold that cache compared to a RAG setup, since you're basically keeping everything loaded instead of just pulling small chunks when needed.

[Chiranjeevi R](https://hashnode.com/@chiranjeevi7777)

[Jul 10](https://hashnode.com/posts/rag-vs-cag-the-future-of-dynamic-knowledge-in-llms/6a4faaad929e331e4ea37bfe/comment/6a505e2c1525c3e7b17555b7#reply-6a50fce9a95c30283379278c)

That's a good point, and I agree. CAG definitely introduces its own trade-offs, especially around memory usage and context limits since the relevant knowledge needs to stay loaded in the model's context.

From what I've learned, CAG works best in scenarios where the knowledge base is relatively static or changes infrequently—for example, company policies, product documentation, or internal manuals. In those cases, loading the information once and reusing it can be simpler than maintaining a full RAG pipeline.

For larger or frequently changing datasets, RAG is still the better choice because it retrieves only the relevant chunks instead of keeping everything in memory.

I appreciate you pointing this out—I'll update the article to include the trade-offs of CAG so readers get a more balanced comparison.
