Home/Guides/When your RAG finds nothing relevant, s…
Guide · 5 min read

When your RAG finds nothing relevant, should it stay silent or fall back to the model?

Treating retrieval as an unconditional prefix to generation is the bug. Make generation conditional on a relevance decision.

Quick answer

Put a relevance gate between retrieval and generation. If retrieved chunks clear the threshold, generate from them. If nothing is relevant, route to an LLM-only (parametric) answer instead of returning empty or hallucinating from unrelated chunks. The fix is making generation conditional on a relevance decision.

A RAG pipeline that errors or returns nothing when the vector store has no relevant documents fails silently on exactly the questions where the user most needs a graceful answer — the out-of-domain ones.

Three failure modes show up:

The root cause

The bug is architectural: treating retrieval as an unconditional prefix to generation. Retrieve, then generate, always — even when retrieval found nothing worth generating from.

The relevance gate

Make generation conditional. Add a relevance check between retrieval and generation and a conditional branch on its result. Relevant context routes to grounded generation. Irrelevant or absent context routes to an LLM-only generation step that answers from the model's parametric knowledge — ideally flagged as a general answer rather than a sourced one.

This is the single-store, non-agentic version of the fallback problem. If your retrieval lives behind an agent that selects among multiple tools, the failure is ambiguous and the gate belongs at the agent's decision layer instead — see the agentic fallback pattern.

Frequently asked questions

Won't falling back to the model reintroduce hallucination?
Only if you hide it. A parametric fallback should be labeled as a general (non-sourced) answer so the user knows it wasn't grounded in your documents. The alternative — returning nothing, or answering from irrelevant chunks — is worse.
Where do I put the relevance check?
Between retrieval and generation, as a gate. Score whether the retrieved chunks actually address the query, then branch: relevant → grounded generation, not relevant → LLM-only fallback or a clean no-answer.
When should I use the agentic fallback instead?
When retrieval runs behind an agent that picks among multiple retriever tools. There the failure is ambiguous and the fallback must live at the agent's decision layer — see agentic-rag-fallback. This skill is for a single store.

Related skill

RAG

RAG Relevance Fallback

Designs a conditional fallback branch in a single-store RAG pipeline so that when retrieved documents are irrelevant or…

Turn this guide into a skill your agent can run

Stop re-explaining the same workflow. Loreto packages it as a Claude Code skill from any source.