ReAct RAG: Reasoning and Acting with Retrieval
The ReAct loop applied to RAG: the model reasons, retrieves as an action, observes, repeats.
ReAct RAG applies the Yao et al. (2022; arXiv:2210.03629) ReAct loop to retrieval-augmented generation: the model emits a Thought, takes an Action (often a retriever or query-engine call), reads the Observation, and repeats until it finishes. Project pointers ship at react-lm.github.io. Among the named patterns under RAG architectures, ReAct owns Thought-Action-Observation with retrieval as a tool; CoT-sentence-as-query interleaving lives on IRCoT.
How does the ReAct Thought-Action-Observation loop work?
ReAct interleaves verbal reasoning with environment actions so the model can plan and gather information in the same trajectory (Yao et al., 2022, section 2; Google Research ReAct blog, 8 November 2022). A Thought is a free-form reasoning trace that updates the model working context without changing the external environment: it decomposes goals, extracts from prior observations, or decides what to do next. An Action is a domain-specific call. In the paper Wikipedia QA setup the actions are search[entity], lookup[string], and finish[answer] (Yao et al., 2022, section 3.1). An Observation is the environment or tool return that the next Thought must condition on.
For knowledge-intensive QA the paper uses dense Thought-Action-Observation steps. For long decision trajectories it allows sparse Thoughts where the model decides when reasoning is needed (Yao et al., 2022, section 2; Google Research blog). The Prompt Engineering Guide ReAct page restates the same synergy: reasoning targets what to retrieve next, and retrieved observations ground the next thought.
That interleaving is why ReAct differs from chain-of-thought alone. CoT can hallucinate mid-trace because it never leaves the model parametric store; Act-only can wander without a plan. ReAct keeps both channels in one prompt trajectory.
IBM Think Topics on ReAct agents emphasises the same operational reading: the agent must decide which tool to call, interpret the tool return, and revise the plan before the next Action. In a RAG deployment that tool is usually a query engine over your corpus, so the Observation channel is the only place new documents enter the trajectory after the first Thought.
How does ReAct use retrieval as an action in RAG?
ReAct becomes ReAct RAG when at least one Action is retrieval against your corpus. IBM Think Topics on ReAct agents describes agents that call tools, including knowledge bases, inside the same Thought-Action-Observation loop. LlamaIndex ReAct Agent with Query Engine Tools wraps indexes as tools the agent can call (docs as of the July 2026 corpus). LangChain create_react_agent with a retriever tool does the same for multi-hop questions over internal documents.
The Observation is then retrieved passages, not a fixed top-k prepended once as in Naive RAG. Each later Thought can decide whether another retrieve is needed, which tool to call, or whether to finish. That is retrieval-as-tool, not one-shot prepend.
Broader control-loop designs beyond this Thought-Action pattern sit on Agentic RAG. Stores that back the retriever tool can still be hybrid indexes: Weaviate, Qdrant, and Pinecone can serve each Action with BM25F-plus-vector fusion when the thought mixes entities and paraphrases; Weaviate hybrid search configuration as of September 2026 is documented on docs.weaviate.io.
What results did the ReAct paper publish?
Published PaLM-540B few-shot prompting results from the Google Research ReAct blog (and matching paper tables) use Wikipedia-API interaction on HotpotQA and FEVER, not a private vector-index SLA.
| Method | HotpotQA EM (6-shot) | FEVER Acc (3-shot) |
|---|---|---|
| Standard | 28.7 | 57.1 |
| Reason-only (CoT) | 29.4 | 56.3 |
| Act-only | 25.7 | 58.9 |
| ReAct | 27.4 | 60.9 |
| Best ReAct + CoT | 35.1 | 64.6 |
| Supervised SoTA | 67.5 (~140k samples) | 89.5 (~90k samples) |
On HotpotQA, ReAct alone at EM 27.4 sits below CoT 29.4; the best reported prompting combination switches between ReAct and CoT and reaches 35.1. On FEVER, ReAct Acc 60.9 beats CoT 56.3. The paper argues ReAct trajectories are more fact-grounded than CoT alone, which can hallucinate mid-trace (Yao et al., 2022, abstract and section 3.3; Prompting Guide error analysis).
On ALFWorld and WebShop, ReAct with one or two in-context examples outperforms imitation and reinforcement learning methods trained on roughly 10^3 to 10^5 instances by absolute success-rate gains of 34 and 10 percentage points respectively (Yao et al., 2022, abstract). Blog table: ALFWorld 2-shot ReAct 71 versus Act-only 45; WebShop 1-shot ReAct 40 versus Act-only 30.1. Those interactive environments are cited as headline deltas only; end-to-end RAG quality on a private corpus still needs your own eval at RAG benchmarks.
What does ReAct cost per iteration?
ReAct cost is structural: every Thought-Action cycle is another language-model generation, and every Action may be a retrieval or API call. Yao et al. (2022, section 3.2) stop and back off when ReAct has not finished within 7 steps on HotpotQA or 5 steps on FEVER.
LangChain agent examples commonly set max_iterations (the Towards Data Science walkthrough uses 5) so a stuck agent cannot loop forever. Trajectory context grows with each Observation, so long tool transcripts can crowd the generator window. Dollars per query on a private index are not published; measure latency and tool-call count on your stack.
Pipeline-level spend framing is at pipeline cost. Cap iterations before you celebrate multi-hop recall, or the agent will burn budget recovering from empty Observations. Bluetick Consultants Medium write-up on ReAct with RAG makes the same production point: each Action that hits the index adds retrieval latency on top of the Thought generation call, so p95 grows with both model time and tool time.
When should you use ReAct RAG, and when should you avoid it?
ReAct RAG earns its multi-step overhead when the next retrieval depends on intermediate reasoning. It is the wrong default when one retrieve-then-generate pass already returns the needed passages.
Use ReAct when tool choice is part of the answer: multi-hop questions over internal documents where one-shot RAG fails composition, which is the failure mode LangChain ReAct walkthroughs start from. Avoid ReAct for single-hop lookups. If Naive RAG already grounds the answer, the extra Thought and Action turns add latency without changing the evidence set.
Expect prompt and loop failure modes. The Prompting Guide summarises paper error analysis: CoT hallucinates facts; ReAct structural constraints can reduce reasoning flexibility; non-informative search results can derail recovery. The paper itself flags limited reasoning and acting coverage under pure prompting and explores fine-tuning smaller PaLM models on successful trajectories (Yao et al., 2022, section 1 contributions and section 3.2).
If the symptom is hop-miss versus composition-miss rather than needs an agent, start at multi-hop failure diagnosis. Teams that only need CoT sentences as retrieval queries without a general tool API should prefer IRCoT; teams that need calculators, browsers, and retrievers in one controller should stay on ReAct.
How does ReAct differ from IRCoT and agentic RAG?
ReAct is a general Thought-Action-Observation controller: Actions can be search, calculators, browsers, or retrievers. IRCoT is narrower: it interleaves CoT sentences as retrieval queries inside a retrieve-and-read loop (Trivedi et al., 2023). Agentic RAG is the broader family of retrieval control loops (planning, multiple tools, reflection); ReAct is one widely implemented pattern inside that family on Agentic RAG.
Multi-hop names the question type and iterative retrieve-and-compose problem; ReAct is one agent formulation of that problem on multi-hop RAG. Adaptive-RAG may route some queries into multi-step strategies that look agent-like, but the router itself is a complexity classifier, not a Thought-Action loop.
Choose the sibling that matches the trigger you need: CoT-as-query on IRCoT, general tools on ReAct, or a three-way complexity router on Adaptive-RAG. The Google Research blog comparison of Standard, CoT, Act-only, and ReAct is the cleanest published framing for that decision on knowledge-intensive tasks: if Act-only already fails because the model never plans, add Thoughts; if CoT already fails because facts are missing, add Actions that can fetch them.
How do you implement ReAct RAG?
Implementation is a handoff checklist: expose retrieval as a tool, prompt the Thought/Action/Observation format, and cap iterations so the loop terminates. Wrap the retriever as a tool with LlamaIndex query-engine tools or a LangChain retriever tool as the usual RAG Actions. Prompt Thought, Action, Action Input, Observation, then Final Answer, matching framework defaults or the paper Wikipedia action grammar.
Cap the loop with max_iterations or the paper step ceilings, and handle parse errors so a bad Action string cannot spin. Log every tool call so empty Observations are visible in traces. Hybrid retrieval behind the tool can sit on Weaviate without changing the agent prompt.
End-to-end wiring belongs at building a RAG pipeline; LangChain-specific stack notes at LangChain. The Prompting Guide LangChain notebook is an assembly example, not a production SLA.
Before shipping, measure three signals on a held-out set: tool-call count per successful answer, share of trajectories that hit max_iterations without a Final Answer, and answer faithfulness when Observations are empty. Those three numbers decide whether the agent budget is buying multi-hop recall or only longer traces.
ReAct RAG is Thought-Action-Observation with retrieval as an Action: reason, call the index, observe passages, and repeat until finish. Yao et al. (2022) and the Google Research blog show PaLM-540B prompting tables where best ReAct+CoT reaches HotpotQA EM 35.1 and FEVER Acc 64.6, with step caps at 7 and 5 on those tasks. Choose ReAct when the next retrieve must depend on intermediate reasoning and tool choice; choose Naive RAG when one retrieve already suffices; choose IRCoT when the only action you need is CoT-guided retrieval.
- Adaptive-RAG
- Advanced RAG
- Agentic RAG
- Agentic RAG patterns
- Cache-augmented generation CAG
- Corrective RAG
- FLARE
- GraphRAG
- Microsoft GraphRAG
- Hybrid RAG
- IRCoT
- LightRAG
- Long RAG
- Memory in RAG
- Modular RAG
- Multi-agent RAG
- Multi-hop multihop RAG
- Multimodal RAG
- Naive RAG
- RAPTOR
- ReAct RAG
- Self-RAG
- Speculative RAG