Back to articles

Choose and evaluate a RAG pipeline one stage at a time

Compare retrieval and generation separately before selecting a RAG stack. Build a small question set, inspect the evidence each answer uses, and track quality, access, latency and cost together.

By Mangandi editorial

Published

Retrieval-augmented generation, or RAG, combines retrieved information with a model's generation process. The original RAG paper studied a system that joined a generative model with an external document index. That research provides a foundation for the approach, not a guarantee that any particular collection of tools will answer your questions correctly. [1]

Choose a use case before choosing a stack

Write down who will ask questions, which documents may supply answers, how current those documents must be, and what a satisfactory answer looks like. A support assistant answering from versioned product manuals has different requirements from a research assistant comparing papers. Start with the documents and questions you actually need to support.

Mangandi suggests making a small evaluation set before tuning the pipeline. Include ordinary questions, exact product or code identifiers, questions whose answers span documents, and questions the collection cannot answer. Add cases involving obsolete or conflicting information. Where documents have different access rules, include checks that each user receives only information they are allowed to access.

Inspect the evidence path

Check that the required source exists in the collection and that parsing preserved the relevant text, tables and identifiers. Keep each passage traceable to its document and revision. Inspect how splitting documents affects meaning: a passage may need its heading, surrounding explanation or table labels to be useful.

Next, inspect retrieval without judging the generated answer. Did the search return a passage containing the required evidence? Was an outdated document ranked above the current one? Were useful passages lost before generation? These observations help locate the next change instead of treating every disappointing answer as a reason to replace the language model.

Compare simple retrieval choices

Keep a lexical search baseline alongside any embedding-based approach you try. The BEIR study compared retrieval methods across diverse datasets and found a strong role for the BM25 baseline in its experiments. Its results support testing across tasks; they do not establish a current universal winner for your collection. [2]

A reranker is a separate option to test. Sentence Transformers documents a two-stage pattern: retrieve candidate passages, then score those candidates against the query with a cross-encoder. That extra stage has its own processing cost and can only rank the candidates it receives. Measure whether it improves your selected cases enough to justify the added work. [3]

Evaluate generation separately

For each answer, inspect whether its material claims are supported by the retrieved passages, whether it addresses the question, and whether its citations point to the relevant evidence. Also check its behaviour when evidence is missing or contradictory. An answer that correctly declines to invent missing information can be more useful than a fluent unsupported response.

The Ragas paper distinguishes retrieval context quality, faithful use of that context and generation quality as separate evaluation concerns. Automated measures can help organise repeated checks, but Mangandi recommends inspecting a sample of their judgements against the actual documents before using a score as an acceptance rule. [4]

Change one part and keep a decision record

Compare changes using the same questions and document snapshot. Record parser and chunking settings, retrieval and model versions, retrieved passages, final answers, access checks, latency and paid usage. Keep failures visible. Use the record to decide whether a change improved the failure you intended to address and whether it introduced a new cost or weakness.

This is a proposed selection and evaluation workflow. It includes no Mangandi benchmark results and does not rank current products. Sources checked 8 November 2026.

Sources

  1. Lewis et al. — Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (arxiv.org; opens in a new tab)
  2. Thakur et al. — BEIR retrieval benchmark (arxiv.org; opens in a new tab)
  3. Sentence Transformers — Retrieve & Re-Rank (www.sbert.net; opens in a new tab)
  4. Es et al. — Ragas evaluation framework (arxiv.org; opens in a new tab)