RAG vs. CAG, clearly explained!
RAG is great, but it has a major problem:
every query hits the vector DB. even for static information that hasn't changed in months.
this is expensive, slow, and unnecessary.
Cache-Augmented Generation (CAG) fixes this by letting the model keep static information in its key-value (KV) memory, which is what the model builds internally for every token it reads.
in fact, you can combine RAG and CAG for the best of both worlds.
here's how it works:
RAG + CAG splits your knowledge into two layers.
↳ static data (policies, documentation) gets cached once in the model's KV memory
↳ dynamic data (recent updates, live documents) gets fetched via retrieval
you get faster inference, lower costs, and less repeated work.
the trick is being selective about what you cache.
only cache static, high-value knowledge that rarely changes. cache everything and you'll hit context limits. separating "cold" (cacheable) and "hot" (retrievable) data keeps this system reliable.
you can start today. OpenAI and Anthropic already support prompt caching in their APIs.
one thing to know before you scale it.
prompt caching matches on an exact prefix, byte for byte. your cached layer only gets reused when it sits at the very front of the context in the same order every time.
↳ reorder two cached policy documents and both turn into a miss
↳ cache document A alone and document B alone, then query both, and the second one misses because the model computed its cached state without ever seeing the first
in production this looks like a small fraction of your cached blocks serving almost all the hits. the rest just sits there.
the way out comes from how attention behaves. tokens attend mostly to their own local neighborhood, and only a few reach across document boundaries. CacheBlend recomputes those few and reuses everything else from the separately cached documents.
multi-document queries run two to four times faster, quality holds, and order stops mattering.
it ships in LMCache, which is fully open source.
repo: https://t.co/TXlaLLu04a
(don't forget to star 🌟)
below, i have quoted my article on KV cache management. it covers where prefix caching stops working and how a proper caching layer fixes it.
give it a read.
cheers! :)
The entire RAG industry is about to get cooked.
Researchers built a new RAG approach that:
- needs no vector DB.
- doesn't embed your data.
- does zero chunking.
- runs no similarity search.
It's called PageIndex. Instead of chopping your docs into chunks and dumping them into Pinecone, it builds a tree index and lets the LLM reason through it like a human reading a book.
hit 98.7% on FinanceBench. beat every vector RAG on the leaderboard.
no embeddings. no chunking. no vector DB.
100% open source.
Hey Its Friday
* OpenCode Hacked
* php screwed the internet
* node said hold my beer
* ruby said hold my beer
* curl said hold my beer and eMudhra held that beer
* Railway said hold my beer
* OpenCode again
helluva week and I only mentioned literally 1/2 of what I know about
@kombaiselects Kombai all the way for frontend. I dont even remember working with human designers anymore. But having Dribble for aome inspiration still helps.
@Kombaico Working with human designers feels like a long time ago. Frontend especially is completely AI nowadays. Been using Kombai for so long and no complaints so far. Love it for anything frontend.
AI app builders do a lot more than just send a prompt to a model.
In this tutorial, @shricodev shows you how to build a Lovable-style app builder with Next.js, cloud sandboxes, and AI agents.
You'll learn about sandboxing, self-correcting agent loops, live previews, Git versioning, and publishing along the way.
https://t.co/i9BWWjBJ8X
this only works in opencode. yes. really. only in opencode. it's entirely the harness. we do harness engineering. it's very good. it's not the model. it's opencode. yes
Sometimes you might want to run AI models locally without bloating your computer or taking up too much space.
And you can do this using Azure + Docker to set up a virtual machine that runs the models inside a container.
Here, @shricodev walks you through the process step by step.
https://t.co/0QbJ580WJE