为什么单次 RAG 不够?
多步 search 怎么拆 query,什么时候停?

英文问法Why isn't single-shot RAG enough? · How does the agent decide when to stop searching? · Design an agentic search experience.

考过recruiter 邮件写的实习内容 "Agentic workflow" · Agentic Search 评测组 JD 写 "deep search systems for Personal Question Answering"(200670397)· Walmart Labs MLE onsite 原题 Design an Agentic Search Experience(PracHub,编辑版)· 这个组是否这样问是推断

先弄清楚:每个概念是什么

Single-shot RAG
检索一次就回答。
Multi-hop question
答案要串起多条数据,后一次 search 的 query 依赖前一次的结果。Apple 官方的例子:先从 message 里找到亲戚想一起做家传菜,再去 email 里找那份菜谱。
Query decomposition
把一个问题拆成几个子问题,逐个检索。
Stop condition
什么时候不再搜。没有它,agent 要么搜不停,要么没搜够就答。
Budget
步数、token、latency 的上限。步数的上限是超参数,按任务的跳数定。Search-R1 的 action 上限是 4,每次取 top-3 passage。

30 秒回答

Single-shot retrieval fails on multi-hop questions, where the second query depends on the first result. So the model runs a loop: decompose the question, search, read the results, and decide whether it needs another query. It stops when the answer is supported by evidence, when new searches return nothing new, or when it hits a step or latency budget. Without evidence, it says what it searched and abstains instead of guessing. Simple lookups should skip the loop and take the cheap single-shot path.

什么时候停

Stop condition信号停下之后
证据够了每个子问题都有 evidence,verifier 查过答案里的 claim生成 grounded 回答
没有新信息连续几次 search 返回重复或空结果说明查过什么,然后 abstain
Budget 用完步数、token 或 latency 到上限用已有 evidence 回答并说明不完整,或退回普通 search 结果
需要澄清有歧义,比如两个 Tim只问会改变结果的问题

Workflow 还是 agent:路径固定的用代码串起来(workflow),便宜又稳定。路径要由模型决定的才用 agent。

必答点

追问

子问题一次拆完,还是边搜边拆?

子问题互相独立时一次拆完(plan-then-execute),省模型调用。后一跳依赖前一跳的结果时只能边搜边拆(ReAct 风格)。

多一步的代价是什么?

latency 和 token 随步数线性涨,错误还会累积。每一步有 90% 做对,4 步全对的概率是 \(0.9^4 \approx 66\%\)。

用户中途放宽了一个条件,怎么办?

维护一份结构化的 constraint state,条件一变就更新并重新检索(见 hard constraint 与 preference)。

检索到的内容里有一句写给 assistant 的指令,怎么办?

检索内容是数据,不是指令,不让它触发 tool。有副作用的操作要用户确认(见 RAG 的 prompt injection)。

来源Apple Newsroom 2026-09(family recipe 例子)· PracHub:Design an Agentic Search Experience(追问含“用户中途放宽条件”和“记录里含有给 assistant 的指令”)· Search-R1 Appendix B.2