Book a free call

RAG Best Practices: How to Keep Answers Accurate

The practices that keep a RAG system accurate: clean source documents, retrieval checks, guardrails, regular testing and fresh content.

Hertiv engineering teamReviewed by a senior engineer
6 min read
RAG Best Practices: How to Keep Answers Accurate
On this page

Short answer

RAG best practices start with clean, current source documents and a retrieval layer you test separately from the model. Check what the retriever returns before you judge the answers, add guardrails for what the model may say, and test on real questions on a schedule. The teams that keep RAG accurate treat it as an operating system, not a one-off build.

What are RAG best practices?

RAG best practices are the working habits that keep a retrieval-augmented generation system accurate after launch. RAG is a pattern where a language model answers from documents it retrieves first, so the answer is only as good as the documents and the retrieval step.

The practices below cover the whole lifecycle: data, retrieval, generation, testing and operations. Each one is a habit you can check in a weekly review, and none of them needs a new tool or a model change to start.

The central habit is to treat retrieval and generation as two separate parts. When an answer is wrong, the cause is usually one of the two: the retriever found the wrong passage, or the model used the right passage badly. Testing them separately tells you which one to fix.

Practice What it fixes
Clean source documentsStale and conflicting answers
Retrieval checksWrong passages reaching the model
GuardrailsInvented facts in answers
Regular testingRegressions going unnoticed
Freshness and monitoringOutdated content staying live

Keep the source documents clean and current

Clean source documents are the first practice, because retrieval follows document quality. Remove duplicates, retire outdated pages and fix the titles, so the retriever does not surface five versions of the same policy. If your help centre has conflicting answers, the model will surface all of them.

Give every document a clear owner and a review date. Ownership matters because documents rot: a policy that was right last year may be wrong now, and nobody notices until a customer quotes the old answer. A simple rule helps: no document goes into the RAG index without an owner and a date.

Structure helps retrieval too. Short pages with clear headings are easier to retrieve than one long page that covers ten topics. Split long documents into focused pages, and write the heading as the question the page answers.

Check what the retriever returns before you judge answers

The second practice is to check retrieval before you blame the model. When an answer is wrong, open the retrieved passages first. If the right passage is missing, the fix is in the data or the search, not in the prompt. If the right passage is present and the answer is still wrong, the fix is in the prompt or the guardrails.

Log the retrieved passages with every answer, at least in a sample. Logs let you debug failures and spot patterns, such as one document that keeps winning the ranking even when it is wrong. Without logs, every failure looks like a model problem.

Test retrieval on its own with a set of real questions and the passages that should answer them. This is the cheapest test in RAG: it needs no model calls, and it tells you whether the search layer works before you spend time tuning prompts.

Put guardrails on what the model may say

Guardrails are the third practice. Tell the model what to do when the retrieved passages do not answer the question: say it does not know, and offer a human handoff. A model that admits a gap is safer than one that fills it with a plausible invention.

Set rules for the risky cases. Prices, dates, legal commitments and account changes should come from the retrieved text, not from the model's memory. If the passage does not contain the fact, the answer should not contain it either. Citation rules help here: require the answer to cite its source, and check the citation in review.

Keep a human in the loop for high-stakes answers. Support teams can review drafts before they reach customers, and the review itself is a source of labelled examples for testing. Advanced RAG techniques covers retrieval methods, while this article covers the operating habits around them.

Test on real questions, on a schedule

The fourth practice is regular testing on real questions. Build a test set of real user questions with known good answers, and run it on a schedule, not once. A test set that runs weekly catches regressions from document changes, prompt edits and model updates.

Run the test in five steps:

  1. Collect real questions from logs, tickets and support chats.
  2. Write the expected answer for each, with the source passage it should use.
  3. Run the system and score retrieval and generation separately.
  4. Review failures by hand and sort them into data, retrieval or generation causes.
  5. Fix the largest failure group first, then re-run the test.

Measure both parts. Retrieval accuracy is the share of questions where the right passage was found. Answer accuracy is the share where the final answer was right. If retrieval is weak, tuning the prompt will not help.

Keep answers fresh and watch for failures

The fifth practice is freshness and monitoring. Documents change, and the index must change with them. Rebuild or update the index when source documents change, and remove retired documents promptly. A stale index is the most common cause of wrong answers in a system that used to work.

Watch the failure signals every week: questions with no good passage, answers users mark unhelpful, and topics where the model invents facts. Each signal points at a fix: a missing document, a bad chunk or a guardrail gap. Treat the signals as a work list, not as noise.

Track cost as well as quality. Retrieval calls, model calls and index rebuilds all cost money, and a system that retrieves ten passages for every question costs more than one that retrieves three good ones. A smaller, better index is usually cheaper than a large, noisy one.

Example (hypothetical): a support team that keeps RAG accurate

Example (hypothetical): a support team runs RAG over a help centre with 400 articles. Each week it receives 200 questions. At first, 140 answers are correct and 60 are wrong, because 25 questions have no article at all and 35 retrieve the wrong passage.

The team applies the practices in order. It writes the 25 missing articles, which fixes 25 questions. It splits the long troubleshooting page into five focused pages, which fixes 20 of the 35 retrieval failures. It adds a rule that the model must say it does not know when no passage answers the question, which stops 10 invented answers.

After six weeks, 185 of 200 answers are correct, and the team spends about 2 hours a week on the test set instead of 8 hours firefighting bad answers.

The arithmetic shows the point: most of the gain came from the documents and the retrieval checks, not from the model. The team changed no model settings in the whole six weeks.

What are the common mistakes?

Most RAG failures come from operating habits, not from model choice. Teams build the system, ship it and stop maintaining it, and then wonder why answers drift.

  • Indexing documents nobody owns, so stale content stays live
  • Judging answers without checking what the retriever returned
  • Letting the model answer when no passage supports the answer
  • Testing once at launch and never again
  • Keeping retired documents in the index
  • Measuring usage instead of retrieval and answer accuracy
  • Retrieving too many passages and paying for noise

If you are building RAG from scratch, how to implement RAG covers the build steps.

For a full build with these practices in place, RAG development services cover the work end to end.

Key takeaways

  • Test retrieval and generation separately, because each fails for different reasons.
  • Clean, owned, dated documents matter more than model tuning.
  • Guardrails should stop the model answering when no passage supports the answer.
  • Run a real-question test set on a schedule, and fix the largest failure group first.
  • Keep the index fresh and watch failure signals weekly.

Frequently asked questions

What is the most important RAG best practice?

Keep the source documents clean, owned and current. Retrieval follows document quality, and most wrong answers trace back to stale, duplicated or missing documents, so document hygiene beats model tuning in practice.

How do I know if retrieval or the model is at fault?

Open the retrieved passages for the failing question. If the right passage is missing, fix the data or the search. If it is present and the answer is still wrong, fix the prompt or the guardrails, not the retrieval.

How often should I test a RAG system?

Run a test set of real questions at least weekly. Testing on a schedule catches regressions from document changes, prompt edits and model updates, and it gives you a baseline to compare every change against.

Should the model ever say it does not know?

Yes. When no retrieved passage answers the question, the model should say so and offer a human handoff. An honest gap is safer than an invented answer, and the gap itself tells you which document is missing.

How many passages should RAG retrieve?

As few as answer the question well, usually three to five. Retrieving ten passages costs more and adds noise, which can make answers worse, so start small and add passages only when the test set shows a gap.

What metrics matter for RAG?

Retrieval accuracy, answer accuracy and the rate of invented answers. Measure retrieval and generation separately so you know which part to fix, and track them on a fixed test set so changes are comparable over time.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: AI and agent systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Building RAG and want the operating habits right from the start? Talk to Hertiv.

A senior engineer replies within one business day. Or see our RAG Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to contact@hertiv.com.

Prefer email? Write to contact@hertiv.com
Estimate costBook a call