RAG Framework Selection Is Not What Determines Output Quality: These Three Things Are

    This article explains why the choice of RAG framework ranks outside the top three factors affecting answer quality, based on a controlled test that ran the same internal documents and fixed evaluation set across a custom retrieval pipeline and several mainstream open-source RAG frameworks. It presents a reusable evaluation process (fixed question set, two-part scoring criteria, per-question failure attribution), shares measured results from an 8-document, 653-chunk, 36-question test, and breaks down the four dimensions worth comparing when assessing a RAG pipeline: structure-aware chunking, hybrid retrieval, controllable reranking, and refusal plus citations. It also contrasts flexible assembly-style frameworks with out-of-the-box ones and recommends a two-phase strategy: validate with an out-of-the-box framework, then migrate to a per-stage controllable setup once real requirements are confirmed.

    Start With the Conclusion: The Framework Is Not the Determining Factor

    If you keep going back and forth on “which RAG framework should I pick,” look at a conclusion from a real test first: the framework you choose does not even make the top three factors affecting final output quality.

    I ran a controlled experiment: the same batch of internal enterprise documents was wired into a custom-built retrieval pipeline and into several mainstream open-source RAG frameworks, then run against the same fixed acceptance question set. Scores did differ, but when I attributed the differences question by question, nearly all of them traced back to three stages rather than the framework itself:

    1. How documents are chunked: whether the chunking strategy respects document structure;
    2. How retrieval is combined: whether vector recall and keyword recall are used together;
    3. Whether answers have a fallback: whether the system can cite sources and is willing to refuse.

    A framework is just the container that holds these three things. Swap the container as often as you like; if what is inside does not change, the results will not change.

    Why “Good Results” Needs a Definition First

    The most common mistake in RAG discussions is having no acceptance criteria. A demo that “looks impressive” is often not reproducible, because nobody has ever judged it strictly against a fixed question set. Below is the evaluation method I use in actual projects.

    A Reusable Evaluation Process

    Step 1: Build a fixed question set. Extract a fixed number of acceptance questions from real business questions (36 in my case), covering different difficulty types such as simple lookups, condition-constrained queries, and cross-document queries. Once the set is fixed, it is no longer changed.

    Step 2: Define the scoring criteria. Each question is not judged by “what the model said.” Two conditions must both hold for it to count as correct:

    • The answer itself is correct;
    • The cited source actually exists in the original documents.

    Step 3: Attribute failures question by question. Every wrong answer must be traceable to a specific failing stage, rather than being lumped together as “the model is not good enough.”

    What the Measured Data Shows

    Take an internal document retrieval case: 8 documents in the corpus, split into 653 chunks, 36 acceptance questions, with results of 24 correct, 6 partially correct, and 6 wrong. At first glance that is not a great score, but its value lies in being attributable: after analyzing the 6 wrong answers one by one, not a single one was caused by “insufficient LLM capability.” All of them were pipeline problems:

    • Some questions had their constraints cut apart by chunking. For example, a clause carried the precondition “applies only to scenario A,” but that precondition was split into a different chunk, so retrieval only pulled back the second half.
    • Some questions had recall miss the key passage. The correct information was in the corpus but ranked outside the recall results.
    • Some questions had reranking push the right passage down. The reranker’s understanding of this particular domain text was off, and it squeezed the correct content out of the candidate window.

    None of these three failure types can be solved by switching frameworks, because they are strategy problems, not engineering problems.

    Four Dimensions That Actually Matter When Evaluating a RAG Pipeline

    To systematically evaluate or optimize a RAG pipeline, work around the following four dimensions.

    1. Does Chunking Respect Document Structure

    The worst way to chunk is to blindly cut by a fixed character count. Tables split down the middle, heading hierarchy lost, clause numbers separated from clause text — all of these leave later stages handicapped from the start: information lost at the chunking stage cannot be recovered no matter how accurate retrieval is.

    A better approach is “structure-aware chunking”:

    • Split on heading levels, clause numbers, and paragraph boundaries first;
    • Keep tables intact where possible, or split by row while carrying the header row as context;
    • Attach the parent heading path to each chunk (for example, “Chapter 3 > Section 3.2 > Clause 5”), which both helps vector retrieval understand semantics and provides a readable source for the final citation.

    Illustrative structure-aware chunking logic:

    1. def chunk_by_structure(doc):
    2. sections = []
    3. current = {"level": 0, "heading": None, "content": []}
    4. for node in doc.walk(): # traverse the document tree
    5. if node.is_heading:
    6. sections.append(current)
    7. current = {"level": node.level, "heading": node, "content": []}
    8. else:
    9. current["content"].append(node)
    10. return merge_small_sections(sections) # merge oversized-small sections to avoid fragmentation

    2. Is Retrieval Hybrid

    Pure vector retrieval fails most often on real enterprise documents. The reason is straightforward: a large amount of critical information in enterprise documents consists of discrete, exact symbols — product model numbers, document IDs, names, amounts, dates. The vector semantic representation of such content is inherently unstable, and things that cannot be wrong by a single character are exactly what vectors handle worst.

    The standard practice for hybrid retrieval is to merge two recall paths:

    • Vector recall: handles semantic similarity, for queries that are phrased differently but mean the same thing;
    • Keyword retrieval: handles exact matching, for model number and ID queries;
    • The two result sets are normalized by score and then fused, complementing each other.

    To judge whether a pipeline is adequate, check whether it allows both recall paths to coexist and lets you tune the weight of each.

    3. Is There Reranking, and Can It Be Turned Off

    A reranker is not always beneficial. In some scenarios it is a lifesaver — when recall results contain a lot of semantically similar but irrelevant content, reranking can significantly improve precision in the top few positions. In others, it pushes the right answer further down — for example, when the reranker’s training distribution differs substantially from your domain documents, its judgment of “which passage actually answers the question” is systematically biased.

    So the evaluation criterion is: whether reranking exists, and whether you can control the switch and the threshold yourself. A reranker that can only be turned on, cannot be turned off, and cannot be tuned is a liability rather than a capability.

    4. Refusal Ability and Citations

    This is the most easily overlooked point and the one that most affects production usability. The core risk of enterprise knowledge Q&A is not “answering incorrectly” but “making things up that are not in the documents.”

    Acceptable behavior comes down to two things:

    • It can refuse: when the confidence of the retrieved content is insufficient, it clearly says “this cannot be answered based on the available material” instead of forcing out an answer;
    • It provides sources: every key conclusion comes with a clickable original passage for verification, so users can judge credibility themselves. Sources also act as a fallback mechanism — even if the generation stage goes off track, users can still correct it by tracing back.

    Positioning and Selection Advice for the Two Framework Categories

    Dropping brand names, RAG frameworks on the market fall into two categories, each with clear boundaries of applicability.

    Flexible assembly type: complete parts and high freedom; you can control every stage of the pipeline — chunking strategy, recall method, reranking switch, prompt templates — one by one. The cost is that you become the assembly engineer yourself: every default value has to be reviewed, or the framework will leave the pitfalls to you with its “most convenient default configuration.”

    Out-of-the-box type: UI, workflows, and the default pipeline are all ready-made, and you can get a demo running in half a day, which suits quickly validating whether a requirement is real. But once you start fine-tuning chunk granularity and recall details, you will keep running into conflicts with its preset design.

    My recommendation is a two-phase strategy:

    1. Validation phase: first use an out-of-the-box framework to get the flow working, measure a baseline score with the fixed question set, and know exactly which stages the problems are in — whether chunking lost information, recall missed it, or reranking ordered it wrong;
    2. Deep-dive phase: once the real requirement is confirmed and you are accountable for long-term results, migrate to a solution where every stage can be controlled, and optimize stage by stage according to the attribution results.

    Conclusion

    Choosing a RAG framework is an engineering decision, not a decision about a technical ceiling. Rather than spending time comparing parameter sheets on each framework’s marketing page, build an evaluation mechanism based on a fixed question set first, and let data tell you where the bottleneck is. Get these four things right — document chunking, hybrid retrieval, reranking control, and refusal with citations — and any framework will deliver an acceptable score. Get them wrong, and no framework will help.