Home/Guides/What's the smallest RAG pipeline that a…
Guide · 5 min read

What's the smallest RAG pipeline that actually works — and why is it exactly one LLM call?

The Query-Retrieve-Augment-Generate flow, the single-LLM-call invariant, and why grounding is a prompt-template discipline, not a bigger model.

Quick answer

Retrieve the most relevant chunks from a vector database, inject them into a grounding prompt template, and make exactly one LLM call to generate the answer. The discipline is in the augmentation step — the retrieved context must be injected as grounding, not appended as an afterthought.

A base model knows nothing about your private documents, your internal catalog, or anything that postdates its training cutoff. Ask it anyway and you get one of three failures: it hallucinates a plausible answer, it leans on stale parametric memory, or you try to stuff the whole corpus into the prompt and blow the context window.

The fix is not a bigger model or a bigger prompt. It is a disciplined four-stage flow with exactly one LLM call.

Query → Retrieve → Augment → Generate

Query. Take the user's question as-is.

Retrieve. Embed the query and pull the top-k most similar chunks from your vector database. This is the only place new knowledge enters the system.

Augment. This is the step everyone underestimates. The retrieved chunks must be injected into a grounding prompt template — a structured prompt that tells the model to answer only from the provided context and to say so when the context is insufficient. Appending the chunks to the end of a freeform prompt is not augmentation; it is hoping.

Generate. One LLM call produces the answer from the grounded prompt. One call — not a chain, not an agent loop.

Why the single-call invariant matters

The single-LLM-call invariant is what makes traditional RAG cheap, fast, and debuggable. Every answer traces to one prompt you can inspect: the template plus the retrieved context. When an answer is wrong, you look at exactly two things — did retrieval surface the right chunks, and did the template force the model to use them? Multi-hop and agentic pipelines have their place, but most "we need RAG over our docs" problems are solved by getting this one-call flow right first.

If answers still drift after this, the problem is almost never the model. It is that retrieval is not being injected into a real grounding template — so fix the augmentation step before you reach for anything fancier.

Frequently asked questions

Why exactly one LLM call?
Because it keeps the pipeline cheap, fast, and debuggable — every answer traces to a single inspectable prompt (template + retrieved context). Save multi-call agentic flows for genuinely multi-hop questions.
My RAG answers keep drifting from the source. What's wrong?
Almost always the augmentation step. The retrieved chunks are being appended to a freeform prompt instead of injected into a grounding template that instructs the model to answer only from the provided context. Fix the template before changing models.
When should I move beyond this single-call pipeline?
When questions require multi-hop reasoning, cross-document synthesis, or routing across multiple stores. For those, see rag-query-routing and the agentic patterns rather than the QRAG single-call build.

Related skill

RAG

RAG Pipeline Vector DB

Designs a traditional RAG pipeline organized around the Query-Retrieve-Augment-Generate (QRAG) flow and its single-LLM-…

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.