Adapting retrieval to your data wins over one-size-fits-all solutions.
This article is based on a probe conducted by Genie, Emumba’s dedicated GenAI R&D group.
When organizations build GenAI systems over their own data, a common question arises: why build a custom retrieval-augmented generation pipeline when managed RAG services already exist?
Managed services reduce setup time and hide much of the underlying retrieval infrastructure. A custom pipeline requires more engineering, but it also provides control over how documents are parsed, divided into chunks, searched, ranked, and passed to the language model.
The important question is whether that additional control produces a meaningful improvement in answer quality.
In this Genie probe, we compared a customized RAG pipeline with a managed RAG service for a demanding technical-documentation use case.
The question
We set out to answer:
For technical documentation, what accuracy gain can a custom RAG pipeline provide compared with a managed RAG system?
The evaluation used:
285 highly technical product PDFs
138 evaluation queries
The documents contained dense technical terminology and complex, varied layouts. They also included closely related products, different versions, overlapping specifications, tables, diagrams, and details that depended on section headings or surrounding context.
This creates several retrieval challenges. A search result may mention the correct technical term but refer to the wrong product or version. Two passages may appear to contradict one another even though they describe different operating conditions or regional standards. Poor PDF parsing can also separate values from their headings, disrupt reading order, or remove the context needed to interpret a specification correctly.
For this type of data, retrieving a semantically similar passage is not always enough. The system must retrieve the passage that matches the exact product, entity, and context in the question.
How we customized the RAG pipeline
We customized three major stages of the pipeline.
|
Data preprocessing and ingestion | Layout- and section-aware parsing and chunking to preserve reading order, document structure, and surrounding context |
Retrieval | Hybrid lexical retrieval using BM25 combined with vector search |
Post-retrieval processing | Reranking and filtering based on product and entity mentions in the query |
Layout- and section-aware processing
Technical PDFs cannot always be treated as a continuous block of plain text. Headings, tables, footnotes, and section boundaries may determine how a value should be interpreted.
The custom pipeline therefore preserved the document’s section structure and reading order during parsing and chunking. Where sections had to be divided into smaller chunks, metadata could be used to restore the wider section context after retrieval.
This allowed the answer-generation model to see complete, coherent information rather than isolated fragments.
Hybrid retrieval
Vector search is useful for finding semantically related content, particularly when a question and a document use different wording. However, technical queries often contain exact product names, model numbers, standards, and domain-specific terms that should not be treated as approximate matches.
We combined vector search with BM25 lexical retrieval. The vector component captured semantic similarity, while BM25 helped preserve exact keyword and entity matches.
Product- and entity-aware post-processing
Technical documentation often contains nearly identical passages for related products or software versions. These passages may all receive high similarity scores even though only one applies to the query.
The custom pipeline used product- and entity-aware filtering and reranking after retrieval. This reduced irrelevant results and moved passages associated with the correct product or entity higher in the final context supplied to the language model.
The comparison
We compared the custom pipeline with the Gemini File Search API.
To keep the comparison consistent, both solutions used:
The same source documents
The same evaluation queries
The same answer-generation model: Gemini 2.5 Flash
For Gemini File Search, we used its default chunk size and chunk overlap, which were the available retrieval tuning controls used in this comparison.
Using the same answer-generation model was an important control. The choice of LLM can affect final-answer accuracy because the model must interpret the query, reason over the retrieved evidence, resolve relevant details, and formulate the answer. By using Gemini 2.5 Flash in both setups, we could compare the retrieval pipelines without differences in the generation model affecting one system more than the other.
We evaluated final-answer accuracy using an LLM-as-a-judge.
|
Custom RAG pipeline | 75% |
Gemini File Search API | 51% |
The custom pipeline achieved a 24-percentage-point improvement in accuracy.
What the 24-point gap tells us
RAG accuracy is not determined by the answer-generation model alone. It depends on the complete path between the source document and the final answer.
The LLM still plays an important role. It must reason over the retrieved evidence and the user’s query before producing an answer. A different generation model could therefore produce different absolute accuracy results. However, because the same model was used for both systems in this experiment, the comparison isolates the effect of the different retrieval approaches more clearly.
If parsing loses a section heading, retrieval selects the wrong product variant, or ranking places the correct passage outside the final context window, even a strong language model may produce an incomplete or incorrect answer. The model cannot reason over evidence that was not retrieved or was presented without the context required to interpret it.
In this experiment, adapting the parsing, chunking, retrieval, filtering, and ranking stages to the characteristics of the data made a material difference.
A managed service abstracts much of this process. That abstraction is one of its main benefits, but it can also limit the ability to diagnose and optimize failures for a particular dataset.
These results should not be interpreted as a claim that every custom RAG pipeline will outperform every managed service. The comparison applies to this technical corpus, evaluation set, answer-generation model, and managed-service configuration. It does, however, demonstrate that the ability to customize retrieval can become important when documents are complex and the required accuracy is high.
Managed or custom RAG?
Managed RAG solutions provide generality and ease of use. They can be a good choice when the data is relatively straightforward, rapid implementation is the main priority, or the default retrieval quality already meets the application’s requirements.
Custom RAG pipelines provide greater adaptability. They are more suitable when:
Documents have complex layouts or inconsistent structures
Exact technical terms, product names, or identifiers are important
The corpus contains similar products, multiple versions, or overlapping information
Retrieval errors must be inspected and addressed systematically
The required accuracy cannot be achieved through the managed service’s available controls
The decision is therefore not based only on whether a managed RAG service is available. It should be based on the nature of the data, the accuracy target, and the level of control needed to reach it.
For this technical-documentation use case, the 24-percentage-point accuracy gap showed that a customized solution was not simply an implementation preference. It materially improved the quality of the system’s answers.