跳到内容

技术

ReAct(推理 + 行动)

ReAct (Reason + Act)

让模型交替写推理(Thought)与调用工具(Action)的 agent 模式,能根据工具结果继续推理。

登入以收藏
ReAct 是 Google 2022 年论文提出的提示模式,把 chain-of-thought 推理和工具使用结合起来。模型先写 Thought(思考),选择 Action(工具调用),收到 Observation(工具结果),然后继续循环——Thought、Action、Observation、Thought、Action、Observation——直到得到答案。 它重要的原因是:纯粹的 CoT 推理没办法查资料。ReAct 让模型可以在推理过程中查 Wikipedia、上网搜索、执行代码、查数据库、调用任何工具。这是现代 LLM agent 的基础:模型想清楚要什么,去拿,再继续想。 简单例子:「首都是万象的国家人口多少?」模型想「先要知道哪个国家首都是万象」,调用搜索工具拿到「老挝」,再想「现在要查老挝人口」,再搜索拿到「750 万」,最后给答案。 大多数 agent 框架(LangChain、LlamaIndex、AutoGPT、Anthropic 的 tool use)底层都是某种 ReAct 变体。现代 function calling API 等于把 ReAct 变成原生功能,Thought/Action 格式换成结构化的 tool call。延伸阅读:tool use、function calling、agent、chain-of-thought。

最后更新: 2026-04-29

We use cookies

Anonymous analytics help us improve the site. You can opt out anytime. Learn more