What Is RAG? Check Retrieval before Trusting AI Answers

You give an AI the manual, yet its answer omits an exception. Some systems retrieve selected passages instead of sending every page to the model. RAG can help bring in information, but you still need to check what it found and how it interpreted it.

Documents pass from a library through selection into an answer, with gaps representing potentially missing context

RAG retrieves evidence to support answer generation

Retrieval-Augmented Generation, or RAG, retrieves information to support an answer at query time rather than relying only on the model’s learned weights. The RAG paper by Lewis and colleagues is a foundational reference, but deployed systems may retrieve and organize information differently.

Think of an assistant looking up a customer question in a set of manuals. They might open an outdated edition or read only half a paragraph. Fluent writing cannot reliably restore an exception they never saw.

RAG is not model retraining, and attaching a file does not necessarily invoke RAG. One system may place the whole file in context; another retrieves passages; another reads page images. Follow the actual data path rather than a “chat with PDF” label.

How RAG retrieves text from files and passes it to the model

The question enters the Retrieve stage to select documents. Then the document and questions are entered into Prompt and LLM before creating the Answer.
LangChain diagram separating document selection in Retrieve from Answer generation through Prompt and LLM. Missing evidence may result from failure before answering. This is neither an accuracy test nor a diagram from the original Lewis research. Source: LangChain Docs Used according to MIT Resized proportionally and converted to WebP without text changes
  1. Prepare content: Extract the document data and keep its filename, version, date, and access permissions.
  2. Split content: Make searchable chunks without separating essential headings or exceptions.
  3. Index it: Support keyword search, embeddings, or both.
  4. Retrieve on a question: Select relevant chunks, possibly filtering by version and permissions before reranking.
  5. Generate an answer: Give the selected passages to the model along with scope and citation instructions.
  6. Check the result: See whether the retrieved evidence really supports each claim.

Embeddings represent information as numbers to help find related material; they do not certify a document as true. Exact keywords may help with product codes, while semantic search may help when the question uses different wording from the manual. Either approach can fail.

Anthropic’s contextual retrieval article describes how chunking can lose context and how keyword and semantic search can be combined. We use those ideas to frame checks, not to claim its reported results hold for Thai-language tasks.

Hypothetical example: the condition is in a different section from the answer

Suppose a shop manual says “Items can be returned within 7 days of receipt,” followed by “Except items made to a customer’s measurements.” When someone asks “Can I return a made-to-measure shirt?”, the system needs both passages. This is hypothetical, not a KrobClick return policy or a statement of legal rights.

What to observeLayers to checkWhat to fix or test
Retrieves only the sentence saying returns are accepted within 7 daysData preparation and retrievalWere notes imported, and can they be associated with the same topic?
Retrieves all conditions and exceptions but claims returns are allowed in every casegenerating answersInstructions and the ability to interpret exceptions from evidence
Answers from an old manual with different conditionsVersion and metadataFilter the effective version and remove old copies from the response set.
Answers correctly but accesses a document the questioner is not authorized to viewPermission controlsEnforce access permissions before including data in answers

A larger model may interpret an exception better, but it cannot retrieve a document that was never ingested or fix misconfigured access controls. Inspect both the answer and retrieved passages to locate the failure.

Thai questions must be tested with words that people actually use.

A manual might say “cancel an order” while a customer asks “I changed my mind; how do I stop it?” Test both phrasings. For codes, figures, or model names that differ by a single character, check exact matches too; semantic similarity is not enough.

Include answerable questions, exceptions, missing answers, and conflicting documents. Decide what evidence should appear before running the test so a persuasive answer does not tempt you to change the standard afterward.

With a small test set, report its size and individual failures. Do not call a pass rate on handpicked questions overall task accuracy. Recheck after changing the model, chunking method, or document collection.

Evaluate searches and answers separately.

A simple log can record “question / expected document / retrieved document / answer / error / reviewer.” If the system hides its retrieved results, note that limitation rather than diagnosing the cause from the final answer alone.

Use RAG for data needs, not because it is fashionable

RAG may be worth considering for changing collections, traceable citations, or multiple permission levels. For a single short file, placing it directly in context may be simpler. Retrieval adds maintenance for indexes, versions, permissions, and evaluation.

Before choosing RAG, locate the authoritative information and decide how to verify the system used it. That will point toward retrieval, document organization, or answer review. A longer prompt alone may miss the underlying problem.

Read moreAI Context, Memory, and Chat History: What Is the Difference?Stored history, saved memory, and the context a model sees for the current response need separate checks.

Sources

Sources reviewed October 14, 2026, Thailand time. Thai examples and prompts are KrobClick proposals, not product tests. Features and settings vary by version/account. Check originals and outputs before real use.