Home / Articles

Where RAG Pipelines Act Blindly: Mapping Failures to Agentic Patterns

Learn which agentic RAG pattern fits which failure, from query rewriting and corrective fallback to routing, answer grading, human review, supervisors and planning.

Publisher: REACTAPP.TOP9 min read2025 words

This article is published in English.

Sources: Your RAG Pipeline Doesn’t Need More Retrieval, It Needs Better Decisions

The standard retrieval-augmented generation recipe is a straight line: retrieve, generate, answer. It is fine for a demo, but production questions quickly expose its blind spots. The retriever returns irrelevant chunks, the user phrases the question in terms your documents never use, the answer is not in the index at all, or the model writes something the retrieved text does not actually support. Stuffing more documents into the prompt does not fix any of these, because the problem is not the amount of context but the absence of a decision about what to do next.

That decision-making layer is what people mean by agentic RAG. This guide treats it as a set of targeted responses to specific failure modes rather than a single architecture, so that you can look at your own pipeline, find the step where it currently acts blindly, and pick the smallest pattern that addresses it.

Why the one-shot pipeline breaks

A conventional RAG application runs a fixed sequence. It takes the question, runs a similarity search against a vector database, keeps the top results, hands them to an LLM and returns whatever comes back. The hidden assumption is that the search step succeeded.

When that assumption fails, nothing in the pipeline notices:

  • Poor documents are passed to the model anyway, and the model tries to answer from them.
  • A query whose vocabulary does not match the documents retrieves little of value.
  • If the knowledge base simply lacks the answer, the system has no alternative path.

The useful shift in perspective is to stop asking only how to make retrieval better and start asking what the system should do when retrieval is not good enough. Every pattern below is an answer to some version of that second question. If you want a broader comparison of retrieval architectures before going into the individual patterns, see RAG vs agentic RAG vs graph RAG.

Grading retrieval and rewriting the query

Take a question such as "How does LangGraph handle persistence?" Suppose the retriever returns five chunks and only one of them is relevant. A linear pipeline forwards all five and lets the model sort it out, which dilutes the useful evidence and invites confusion.

An agentic workflow inserts an evaluation step first. A grader, often a small LLM call with a yes/no rubric, judges whether the retrieved documents are relevant enough to answer the question. If they are not, the workflow does not simply search again with the same text. It generates an improved query, informed by what the first attempt returned, and retrieves once more. The resulting loop is:

  • retrieve
  • evaluate the results
  • rewrite the query if they fall short
  • retrieve again

The loop itself is not the valuable part. What matters is that the system can recognize its first attempt was inadequate. In practice you also need a stop condition, such as a maximum number of rewrites, so that a question the index cannot answer does not cycle forever.

Falling back when the index lacks the answer

Rewriting helps only if the information exists somewhere in your corpus. Often it does not. Imagine an assistant built on documentation collected a month ago, and a user asks about a feature announced yesterday. No amount of rephrasing will surface a document that was never indexed.

Corrective RAG addresses this case. After grading the retrieved documents, the workflow treats an insufficient result as a signal to correct course, for example by querying a different source such as web search. The linear flow of retrieve-then-generate becomes:

  • retrieve
  • grade the documents
  • correct, if the grade is poor
  • generate

"Correct" is deliberately broad. Depending on the application it might mean rewriting the query, consulting another source, or taking some other action. The defining feature is that a failed retrieval triggers a different path instead of a weak answer. Keep in mind that adding a web fallback changes your trust model: public web content is less curated than your own documentation, so you may want to label or filter answers that rely on it.

Routing each question to the right source

Another quiet assumption in basic RAG is that every question should hit the same retriever. Many real systems have several knowledge sources at once: internal company documentation, public product docs, one or more vector stores and live web search.

Those sources are not interchangeable. A question about an internal HR policy should not be answered from the open web. A question about a library version released last week should not depend solely on a vector store built before that release.

Adaptive RAG adds a routing decision at the start. Before retrieving anything, the system classifies the question and decides which source is best placed to answer it, then evaluates the context that comes back from that source. The retrieval path is chosen per question rather than fixed for all of them. A router can be as simple as a classification prompt or a set of rules; it does not need to be sophisticated to remove a whole class of wrong-source answers.

Checking the answer, not just the documents

A subtler failure is easy to miss: excellent retrieval does not guarantee a good answer. The model can receive exactly the right passages and still produce a response that goes beyond them or drifts away from the question.

The remedy is to grade the output as well. After generation, an agentic workflow can ask:

  • Is every claim in the answer grounded in the retrieved context?
  • Does the answer address what the user actually asked?
  • Has the model added information that the context does not support?

If the answer fails, the workflow can revise it or regenerate it. That gives you two separate checks that are worth keeping distinct: whether the right information was retrieved, and whether that information was used correctly. Separating them also makes debugging far easier, because a failure can be attributed to the retrieval stage or the generation stage instead of just "the bot was wrong." The article on evaluating RAG by failure stage expands on that idea.

Pausing for a human decision

Some outcomes should not be decided automatically. Typical triggers for human review include:

  • evidence that is ambiguous or contradictory
  • answers that require formal approval before they are used
  • low confidence from the system's own graders
  • a draft response that clearly needs editing

Human-in-the-loop RAG places a checkpoint in the workflow where someone can sign off on the result, turn it down or edit it before execution continues. This is not a retreat from automation. The system still handles the routine cases on its own and escalates only the ones that genuinely need judgment, which is usually a far better use of reviewers' time than checking everything or nothing. Graph-based orchestration frameworks such as LangGraph are well suited to this because they can persist the workflow state at the checkpoint and resume once the person has responded.

Splitting work across specialized agents

As workflows grow, one agent carrying every responsibility becomes hard to reason about and hard to prompt well. Some problems decompose naturally into distinct roles: retrieval, research, evaluation and so on.

A multi-agent supervisor setup gives one agent the job of coordination. The supervisor decides which specialist should take the next step, and the specialists each handle a narrow task. The point is not to add agents for their own sake; each extra agent adds latency, cost and another prompt to maintain. It pays off when the problem genuinely involves several steps or specialties and a single agent's instructions have become an unmanageable list of special cases.

Running independent retrieval in parallel

Not every step has to wait for the previous one. If an answer needs information from several independent sources, querying them one after another, source A, then B, then C, then answering, wastes time.

The parallel fan-out pattern issues those lookups at the same time: the question fans out to A, B and C concurrently, and their results are merged before the answer is produced. Independent retrieval or processing tasks run side by side and are combined at the end. This can make complex workflows both faster and easier to structure, since each branch is self-contained. The trade-off is that the combining step must handle overlapping or conflicting results, and it has to decide what to do if one branch fails or times out.

Planning before executing

Some questions cannot be answered by a single lookup at all. They need several searches, intermediate transformations or reasoning stages whose order matters.

Plan-and-execute RAG handles this by separating thinking about the work from doing it. The flow becomes:

  • receive the question
  • produce a plan
  • execute the planned steps
  • evaluate the results
  • answer

The planner determines what needs to happen; execution handles the individual steps. This is most useful for multi-part questions, such as comparisons across several documents, where diving straight into tool calls tends to produce shallow or incomplete answers. A plan also gives you something to inspect when a run goes wrong, which is harder with an agent that improvises every step.

What actually makes a RAG system agentic

Calling an LLM, or labeling something an agent, does not by itself make a system agentic. The distinguishing property is that the system can assess its situation and choose its next step. A fixed pipeline assumes one retrieval followed by an answer. An agentic one can ask itself a series of questions:

  • Is retrieval needed for this question at all?
  • Was what came back actually useful?
  • Should it search again with a different query?
  • Would another source be a better fit?
  • Is the answer supported by the evidence?
  • Does a human need to weigh in?
  • Should a different, specialized agent take over?
  • Would planning the work first produce a better result?

Each question corresponds to one of the patterns above, which is why it helps to think of agentic RAG as a toolbox of decision points rather than one monolithic design. These patterns map onto graph orchestration naturally: grading and routing become conditional edges, loops become cycles with a counter in state, human review becomes an interrupt, and fan-out becomes parallel branches that join.

Match the pattern to the failure

No application needs all of these patterns, and each one adds latency, cost and moving parts. Choose based on the failure you actually observe:

  • If retrieval quality is the main issue, query rewriting with a relevance grader may be enough.
  • If the knowledge base has gaps, add a fallback source.
  • If you serve several knowledge sources, add routing.
  • If some decisions need oversight, add a human checkpoint.
  • If the workflow involves distinct specialist tasks or independent lookups, consider a supervisor or a parallel fan-out.
  • If questions require multiple dependent steps, add planning.

Wrapping up

The question that leads to useful improvements is not how to make a RAG system more agentic. It is where the system is currently acting blindly: forwarding documents nobody checked, searching the wrong source, trusting an ungrounded answer or pushing through a decision a person should make. Instrument the pipeline so you can see which of those failures happen most often, add the smallest decision point that catches the most common one, and measure again before adding the next.