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! :)
RAG is officially cooked.
Researchers proved you can stuff 1 billion triple knowledge graph directly into an LLM using only 20GB of VRAM.
no vector DB, no Pinecone bill, no chunking nightmares.
Researchers introduced AtlasKV, and it makes the entire RAG pipeline look ancient.
Instead of bolting an external search engine onto an LLM, AtlasKV integrates billion-scale knowledge graphs directly into the model's inherent attention mechanism.
Using two new methods (KG2KV and HiKVP), it translates knowledge graph triples straight into the AI's internal memory with sub-linear time and memory complexity.
And the numbers are ridiculous:
• 1 billion knowledge triples integrated at scale
• Runs on less than 20GB of GPU VRAM
• Zero external retrievers
• Zero bloated context windows
• Zero retraining required when you add new knowledge
It maintains strong grounding and generalization without paying the latency tax of searching and reading massive prompts.
We spent years building clunky, fragile retrieval pipelines just to help AI look things up.
Pi Agent 也���以变成 Claude Code了🔥
项目叫 One Code,作者做了一件挺有意思的事情:保留 Pi 的核心架构,通过几十个 Extension,把 Claude Code 的常用功能重新实现了一遍
包括 Plan Mode、Auto Mode、Subagent、Git Worktree、权限管理,甚至�� Claude Code 原来的 CLAUDE.md、Skills、Hooks 和 MCP 配置都能直接读取
也就是说,如果你已经用了很久 Claude Code,很多之前配置好的东西都可以继续用,不需要从头再折腾一遍
但我觉得最有价值的还不是这些功能,而是作者把 Claude Code 的工作流和底层模型分开了
你完全可以保留 Claude Code 的使用习惯,但是不一定非要使用 Claude 模型
比如主 Agent 用 GPT 处理复杂任务,Subagent 换成 DeepSeek,甚至让系统根据任务自动选择子 Agent 的模型
整个项目不需要 Fork Pi,也不需要修改 Pi 的核心代码,靠 Extension 就完成了这一套改造
如果已经安装 Pi,只需要一条命令:
pi install npm:one-code-extension
当然,它还不是百分之百的 Claude Code,部分云端能力和系统级沙箱没有实现
以前一直觉得 Pi 的优势是足够精简、自由度高,现在看来更有意思的是,它真的可以被开发者改造成完全不同的 Agent
你甚至可以用 Pi 造出自己想要的 Claude Code,而且模型、工具和工作流都由自己决定
GitHub:https://t.co/QwJ2VAVU0B
I'm sharing with you one of the best papers I've read on Harness Engineering
it pulls apart Claude Code (Fable 5.2), Codex, Gemini CLI and more, and boils all of them down to one line:
agent = model + harness
what you take away:
> what a harness is, in plain terms
> how today's coding agents are built under the hood
> the patterns they all share
> the direction the entire field is moving
> a checklist for building your own
the model collects the applause
the harness decides whether the agent actually works
then read the article below ↓