What if the LLM simply does not know your information?
Imagine asking a general LLM: “According to our company's current HR manual, how many casual-leave days do I get?” The policy may be private, recently changed, or absent from the model's training data.
Fine-tuning is not the natural first solution when the problem is missing current evidence. A simpler idea is: find the relevant approved information first, give it to the LLM with the question, then generate the answer.
That pattern is called Retrieval-Augmented Generation (RAG).
End-to-End 2D RAG Architecture with Validation Gates & Fallbacks
Real production RAG gates context sufficiency before passing documents to the generator.
Two phases make the system work
Offline preparation versus online answering
A complete beginner example
Question
The employee asks: “How many casual-leave days do I get?”
Retrieve
The search layer finds a current HR-policy chunk that says eligible employees receive 12 casual-leave days per year.
Assemble context
The application sends the user's question plus that policy passage to the LLM.
Generate
The LLM answers: “The current HR policy states 12 casual-leave days per year.”
Validate and show source
The application checks that the cited source ID really came from retrieval and presents the answer with traceable evidence.
Follow a source all the way into a citation
The previous example asked about the annual leave allowance. Here is a separate carry-forward question: how many unused days may an India employee carry into the next year? Similar words alone are not enough to choose the source.
CH-17 is the relevant India policy and supports five days. CH-42 discusses a different allowance, while CH-08 belongs to the wrong region. Only the accepted passage and its source ID should support the final claim. If that passage is unavailable, the application no longer has evidence for the number.
RAG evidence trace: a citation must remain connected to accepted evidence
RAG has several failure boundaries
Where a RAG answer can fail
What should happen when the evidence is missing?
If no approved source contains enough evidence, the safer behavior is often to abstain, ask for clarification, or escalate according to the application's policy—not invent a plausible answer.
Why the next lesson matters
The RAG idea is simple: retrieve relevant evidence. But how can retrieval find a passage even when the user's wording is different from the document?
Semantic Search with Embeddings →Summary / Key Takeaways
- RAG retrieves external evidence and supplies it to an LLM before generation.
- RAG is useful for current, private, or domain information that should not rely only on model parameters.
- Indexing prepares source documents before user questions; online retrieval and generation happen per request.
- Retrieval, context assembly, generation, and citation validation are separate failure boundaries.
- Citations should map to actually retrieved source metadata.
- When approved evidence is insufficient, a controlled abstention or escalation is safer than unsupported generation.