Google与Anthropic共识:RAG应转为Agent可调用的独立服务
Google and Anthropic agree on one thing about retrieval.
深入剖析了当前主流AI厂商在RAG架构上的演进路径,指出了传统模式的缺陷并给出了具体的工程优化方向,对做Agent开发的同学极具参考价值。
Google and Anthropic agree on one thing about retrieval.
Google 和 Anthropic 在检索方面有一项共识。
They both moved it out of the app and turned it into a standalone service that agents invoke.
它们都将其从应用中移除,并将其转变为代理(agent)调用的独立服务。
- Anthropic's MCP exposes retrieval as a tool that an agent invokes. - Google ships it similarly, with its RAG Engine sitting under the Gemini agent platform next to MCP servers.
- Anthropic 的 MCP 将检索暴露为代理可调用的工具。 - Google 也采用类似方式发布其 RAG Engine,它位于 Gemini 代理平台下,与 MCP 服务器并列。
They did this because the old naive RAG setup was built as a one-time pipeline inside a single app, and it caused problems in two places:
它们之所以这样做,是因为旧的朴素 RAG 设置是作为单个应用内的单次管道构建的,并在两个地方引发了问题:
- The first is stale embeddings. They reflect the source at indexing time, so the index drifts from the source when a doc or a row changes, and stays wrong until the pipeline is rerun.
- The second is coupled infrastructure. The retrieval logic sits inside one app, so another app duplicates the connectors, chunking, and embedding instead of reusing them.
- 第一个问题是嵌入过时。它们反映的是索引时刻的数据源状态,因此当文档或数据行发生变化时,索引会与源数据产生偏差,直到重新运行管道才会修正。
- 第二个问题是基础设施耦合。检索逻辑位于一个应用内部,导致另一个应用不得不重复实现连接器、分块和嵌入功能,而不是复用它们。
Both failure modes are resolved by separating ingestion from query and running ingestion as a standing layer.
通过将数据摄入与查询分离,并将数据摄入作为常驻层运行,可以解决这两种故障模式。
Ingestion runs continuously with content-hash sync, so only changed data is re-embedded, and the layer sits behind one API, so a chatbot and an agent hit the same index.
数据摄入通过内容哈希同步持续运行,因此只有发生变化的数据会被重新嵌入;该层位于单一 API 之后,因此聊天机器人和代理都能访问同一个索引。
The agent then calls that layer as a tool inside a loop. It reasons, runs a search, reads the result, and issues a refined query, instead of retrieving once at the start.
随后,代理在循环中将这一层作为工具调用。它会进行推理、执行搜索、读取结果并发出优化后的查询,而不是一开始在检索后就停止。
The diagram below depicts all three stages, covering naive RAG, the standing layer, and the agent consuming it.
下图描绘了所有三个阶段:朴素 RAG、常驻层以及消费该层的代理。
This helps, but it didn't solve all problems yet because across all three stages, the unit of retrieval is the same, i.e., a chunk of text.
这有所帮助,但尚未解决所有问题,因为在所有三个阶段中,检索的基本单元都是相同的,即文本块(chunk)。
And inherently, a chunk has no idea of a semantic boundary, version, or source info. The splitter cuts documents mostly on token count, so a single chunk can end mid-table or mid-argument.
本质上,文本块并不了解语义边界、版本或来源信息。分割器主要基于 token 数量对文档进行切割,因此单个文本块可能截断在表格中间或论证过程中间。
Because of that, it can pull the top half of a table without the rows, or a conclusion without the reasoning that supports it.
因此,它可能会提取表格的上半部分而缺少行数据,或者提取结论却缺少支持它的推理过程。
Moving to a structured unit, embedding a question with its validated answer, addresses this.
转向结构化单元,并对带有已验证答案的问题进行嵌入,可以解决这一问题。
That said, every app and agent now reaches the same index, so that index has to stay fast and cheap as it grows.
话虽如此,现在每个应用和代理都会访问同一个索引,因此随着规模增长,该索引必须保持快速且低成本。
I showed how to make it 32x more memory-efficient in the article below, with code you can run.
我在下面的文章中展示了如何使其内存效率提高 32 倍,并提供了可运行的代码。
Read it below.
请阅读下文。
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力