Brief IA
›

Agentic RAG or Naive RAG: Choosing Based on Cost and Complexity

Models & LLM·Tom Levy·

Agentic RAG or Naive RAG: Choosing Based on Cost and Complexity

Agentic RAG or Naive RAG: Choosing Based on Cost and Complexity
Key Takeaways
1The choice between standard RAG and agentic RAG is based on a cost/capacity trade-off (latency and tokens versus reasoning power).
2Four key mechanisms enable agentic retrieval: routing, decomposition, self-reflection, and tool calls.
3The linear pipeline fails on multi-step or multi-source queries and does not correct a missed retrieval.
Why it matters : this changes the architecture to adopt based on the complexity of queries and cost and speed constraints.

Two retrieval architectures compete in language model-based applications: a linear pipeline, which is fast and cost-effective, and an agentic loop, which is more expensive but suited for complex queries. The choice depends on an explicit trade-off between capacity and cost, as well as the mechanisms employed to plan, decompose, evaluate, and tool the retrieval.

Balancing Costs and Capacities Before Deciding

The decision between linear retrieval and agentic retrieval relies on a compromise between cost and capacity. A standard pipeline involves a single integration of the query and a call to the model, resulting in low latency, predictable costs, and ease of debugging. In contrast, an agentic system multiplies reasoning steps, adding latency and token costs. A query that may require three iterations of retrieval and two tool calls will be significantly more expensive than a single pass. This economic reality explains why standard RAG remains an excellent and economical choice for many applications, especially when speed is crucial and queries are well-defined and unidimensional.

Four Levers to Make Retrieval Agentic

Four distinct mechanisms transform a pipeline into an agentic system. First, query routing: the model selects, from a predefined registry, the appropriate source or tool before the search, avoiding the need to force every request through the same mechanism. A financial analysis might go through a structured SQL database, a policy question through semantic search in unstructured documents, and a news request through live web search. Next is query decomposition, which segments a complex question into independent sub-questions: first determining the buyer of a service, then querying the regulatory obligations of that buyer in a given area. Each intermediate answer feeds into the next, creating a sequential chain that naive pipelines do not achieve. The third lever is self-reflection: the system evaluates whether the retrieved pieces answer the question; if there is insufficiency, contradiction, or irrelevance, it rewrites the query and restarts the retrieval. This loop continues until a confidence threshold or iteration limit is reached, a safeguard that prevents cost and latency from spiraling out of control. Finally, the use of tools and function calls expands the realm of possibilities: a calculator for arithmetic, live search APIs, SQL executors, or domain-specific internal APIs. The model selects the appropriate tool for each sub-task and can combine retrieved text, calculations, structured queries, and real-time data in a single response. The nature of the available tools then conditions what the system can address.

Le brief IA que lisent les pros

Le brief IA que les pros lisent chaque soir

Les 7 actus IA du jour, décryptées en 5 min. Gratuit.

Inclus dès l'inscription : notre sélection des meilleurs guides & comparatifs IA.

Choisissez votre rythme

Gratuit · Pas de spam · Désabonnement en 1 clic

How the Agentic Loop Changes the Role of the LLM

In an agentic system, the model is no longer a simple generator receiving a fixed context. It becomes the reasoning engine that orchestrates retrieval in a loop of planning, executing, evaluating, and repeating. It decides what to retrieve, where to search, whether the results are satisfactory, and what actions to take if they are not. While a classic pipeline exposes the model to a single context, agenticity introduces reflection on the retrieval itself, including the decision to stop when the information is deemed sufficient. Retrieval ceases to be a preprocessing step and becomes a dynamic, self-correcting, and iterative process.

Why Linear Pipelines Fail on Complex Queries

Linearity is the structural weakness of standard pipelines. A single retrieval pass can succeed or fail without any internal mechanism to recover if the query is poorly formulated, if the information is scattered, or if the answer requires multiple reasoning steps. The pipeline cannot recognize a retrieval failure or attempt an alternative approach. When the closest results turn out to be irrelevant, the model can either ignore an unsuitable context at the risk of hallucinating or indicate that it lacks information. In a high-stakes enterprise context, these outcomes are unacceptable. For a composite query, a single search across the entire formulation often fails to connect pieces of information, and the naive pipeline does not know how to break them into sequential sub-questions.

Standard RAG, Its Mechanics, and Its Comfort Zones

Standard RAG operates according to the triptych retrieve, read, generate. The query is translated into a vector via an embedding model, a similarity search selects the k closest pieces, and then these elements are integrated into the context window of the language model that produces the response. During ingestion, the data is segmented, transformed into dense embeddings, and then stored in a nearest neighbor search database; at inference time, the query is vectorized using the same embedding method, and the corresponding passages are extracted. This process has been used to design question-answering tools for businesses, internal knowledge management assistants, and document summarization solutions based on controlled sources. This operation remains relevant and cost-effective when the posed question is basic and the database is well-organized, but it quickly reaches its limits if multiple steps need to be chained, if sources need to be cross-referenced, or if a dispersed synthesis is required. It has been adopted, among other uses, to mitigate language model hallucinations by anchoring generation in verified external content.

Brief IA — L'actualité IA en français

L'essentiel de l'actualité de l'intelligence artificielle, décrypté et expliqué chaque jour.