A stack of documents with a magnifying glass, next to a small knowledge graph, a robot icon, and a bar chart card

Our Expert Column

·

12 minutes

reading

Technical details of AI-based document audit: are graph- and agent-based search worth it?

Technical details of AI-based document audit: are graph- and agent-based search worth it?

Technical details of AI-based document audit: are graph- and agent-based search worth it?

We benchmarked hybrid, graph-based, and fine-tuned agentic RAG methods on real-world documents for AI-driven document auditing purposes. Are the extra cost and latency really worth it?

We benchmarked hybrid, graph-based, and fine-tuned agentic RAG methods on real-world documents for AI-driven document auditing purposes. Are the extra cost and latency really worth it?

We evaluated hybrid, graph-based, and trained agentic RAG methods on real-world documents for document verification (audit) purposes. The takeaway from our measurements is that the simplest, non-trivial solution is surprisingly hard to beat.

Imagine having to review a public procurement tender against the requirements of the call for tenders. Does it meet all the mandatory conditions? Does it contain every required clause? Companies fill out such checklists day in and day out based on lengthy, mixed collections of documents. Doing this manually is slow and expensive, which is why automation would deliver significant value.

With advancements in natural language processing (NLP) and generative artificial intelligence (GenAI), large language models (LLMs) and AI agents might seem like the most obvious solution for this. The catch, however, is that the quality of automation hinges on retrieval. Retrieval-Augmented Generation (RAG) works in two steps: first, it retrieves the relevant text passages, and then the model generates an answer from them. If the evidence does not make it into the context window, the system either hallucinates or fails to respond. Filling out a checklist is therefore primarily a retrieval problem.

That is why we evaluated how the most popular RAG approaches perform on real documents.

The problem: RAG is not evaluated on real documents

The three major families of retrieval techniques are each considered state-of-the-art within their respective literature. Hybrid search combines lexical (keyword-based) and semantic (meaning-based) matching. Graph-based search (Graph RAG) uses a knowledge graph constructed from the documents. Meanwhile, multi-step, agentic search—such as that performed by Claude or ChatGPT—executes sequential, interdependent retrieval steps.

However, these methods are mostly evaluated on Wikipedia-style question-answering datasets, where the text snippets are short and clean, and entity names (such as the name of a contracting company) are unambiguous. Real-world documents are different: they are long, consist of numbered articles and annexes, are riddled with cross-references ("see section 2.2.6"), contain complex tables, and answering a single question often requires piecing together information from multiple documents.

Benchmarks designed for contracts and financial reports mostly evaluate the comprehension of a single document. They do not test how a retrieval architecture handles an entire package of interrelated documents. Currently, there is no benchmark where the performance of the tested solutions is measured on real-world work documents and realistic data volumes. Therefore, we considered it essential to get an accurate, realistic picture of the quality of these solutions within real-world constraints.

The dataset: real EU documents, synthetic questions

We wanted a benchmark that closely mirrors production use, which is why we chose public procurement. A tender dossier is natural raw material for a checklist: it consists of interconnected documents (call for tenders, administrative and technical specifications, draft framework contract, annexes), and answering a single question often requires cross-referencing multiple documents.

We downloaded seven public tenders along with their full documentation from the European Commission's Funding & Tenders portal. This amounts to 62 PDFs and roughly a thousand pages, ranging from school trips and maritime safety equipment to EU cybersecurity. The system processes one tender at a time, just like a real audit, meaning the search is always restricted to the documents of the given tender.

The corresponding 97 questions and reference answers were generated by a synthetic data generation pipeline. The processing pipeline extracts the text, splits it into chunks of tokens (words or subwords), after which an LLM first gathers candidate questions and ultimately compiles the final questions by question type, along with their supporting evidence snippets.

Folyamatábra a kérdésgenerálásról: 7 pályázat 62 PDF-jéből szövegkinyerés, 512 tokenes darabolás 1101 chunkra, egy kisebb LLM chunkonként jelölt kérdéseket gyűjt, egy nagyobb LLM típusonként véglegesíti őket, végül szabályalapú nehézségi címke; az eredmény 97 kérdés.

We categorized the questions into five types, as not all questions present the same challenge for retrieval:

  1. Single-document retrieval (easy): the answer is located in a single place.

  2. Single-document reasoning (medium): multiple facts need to be linked together, but within a single document.

  3. Cross-document factual question (medium): the information is scattered across multiple documents.

  4. Implicit multi-hop question (hard): the answer is reached by following a cross-reference; no single text snippet contains the full answer.

  5. Unanswerable question (hard): sounds plausible, but the documents contain no answer. A good system must be able to state this as well. An example of the fourth type: "According to the document, the project and price are agreed upon according to the 'Planning and Deadlines' section. If a delay shifts the milestones, what does this mean for the date when the price is finalised?" Here, two sections must be linked together, and only jointly do they provide the answer.

Vízszintes oszlopdiagram a 97 kérdés megoszlásáról típus szerint: egydokumentumos keresés 23, egydokumentumos következtetés 20, dokumentumok közötti ténykérdés 20, implicit többugrásos 18, megválaszolhatatlan 16.

We have published the dataset openly on HuggingFace so that others can use it too: eu-tenders-with-questions-for-agentic-checklist-filling.

The six contenders

We implemented one example from each of the three families and compared them against two classical baselines. In research, baselines serve to establish ground-truth reference values against which more complex solutions are compared.

Method

Family

In short

BM25

Baseline (syntactic)

Classical keyword-based search based on vocabulary overlap

Dense search

Baseline (semantic)

multilingual-e5-large embeddings in a vector index

Hybrid (DBSF)

Hybrid

BM25 and dense search (bge-m3), with score distribution-based fusion of the two lists

Hybrid + cross-encoder

Hybrid

Union of the two candidate lists, reranked with a cross-encoder reranker

KG2RAG

Graph

A graph constructed from triples extracted using an LLM, expanding results along the graph

EfficientRAG

Agentic

Multi-step retrieval using two small, fine-tuned neural networks with a Transformer model (DeBERTa-v3)

Semantic Search relies on Vector Search between embeddings, whereas BM25 relies on exact word matching. The core challenge in hybrid search is that the scores from the two methods operate on different scales, meaning they must be normalized before fusion. DBSF (Distribution-Based Score Fusion) normalizes the scores of each list using its own mean and standard deviation, then sums them up, eliminating the need to tune fusion weights. The cross-encoder reranker reads the query and the text snippet together, making it more accurate, but it runs individually on every candidate.

KG2RAG starts by retrieving related text snippets (anchors), then expands the set across common entities in the graph, and finally organizes them into evidence chains and scores them using a cross-encoder. The graph is constructed by an LLM using a few-shot prompt from entity-relation-entity triples extracted from text chunks.

EfficientRAG replaces the LLM calls of iterative retrieval with two small models. One (Labeler) labels relevant passages and decides whether the evidence gathered so far is sufficient. The other (Filter) formulates the search query for the next step based on the original question and the evidence accumulated up to that point.

Három folyamatábra egymás mellett. Hibrid: BM25 és sűrű keresés, DBSF-fúzió, opcionális cross-encoder újrarendezés. Tudásgráf: anchor chunkok hibrid kereséssel, bővítés a gráf mentén, bizonyítékláncok, cross-encoder rangsor. Ágensalapú: keresés, Labeler és Filter körökben, amíg elég a bizonyíték.

Two things should be made clear, as both methods are adaptations of the published papers rather than exact replicas. In KG2RAG, the anchors are provided by hybrid search instead of the original dense search: the graph can only reach entities present in the anchor, and in this corpus, BM25 proved stronger than any standalone embedding, meaning a weak initial step would have degraded the entire system. Meanwhile, the authors of EfficientRAG did not release their trained models, so we had to train our own. This was done on just 200 synthetic chains—roughly 450 times less data than used in the original paper. We also experimented with training on the pretraining data from the original paper followed by fine-tuning, but this approach yielded significantly worse results than training solely on our own data.

How did we measure?

Each method returned 20 text snippets at the end of the retrieval phase. We computed retrieval metrics on these, primarily nDCG, which rewards placing relevant snippets as high up the list as possible. The top 10 snippets were provided to a checklist-filling LLM agent, which had to formulate an answer based on them or declare that the documents contained no answer. This serves as a guardrail against hallucination. The answers were evaluated by an LLM judge for correctness, faithfulness, and abstention. We also recorded latency and cost.

Since we only have 97 questions, differences were examined using paired bootstrap confidence intervals. This post only considers differences to be real if their confidence interval does not contain zero. In practice, any variance below roughly 0.03 nDCG is considered noise.

Results

The strength of hybrid search

The first surprise is that out of the six methods, four are practically tied in retrieval quality: BM25, hybrid search, the cross-encoder variant, and KG2RAG. On paper, graph-based KG2RAG achieved the highest nDCG, followed by hybrid search, but the difference between the two is well within the noise margin.

Only three findings can be stated reliably:

  • Dense search alone is weaker than BM25. Procurement texts are full of exact identifiers, article numbers, defined terms, and figures. Lexical search locates these precisely, whereas embeddings can easily conflate them.

  • Hybrid search (DBSF) is the only method that is reliably better than (or at least equal to, in all cases) BM25, although the gain is modest. The two signals complement each other, and the fusion requires no trained component.

  • The trained EfficientRAG is reliably weaker than BM25.

Két konfidenciaintervallum-diagram a BM25-höz mért különbségekről keresési minőségben (nDCG@20) és válaszhelyességben. Csak a Hybrid DBSF jobb, az EfficientRAG és a dense keresés gyengébb megbízhatóan; a többi intervallum átfedi a nullát.

The graph does not find more evidence

The promise of KG2RAG is that it discovers text snippets along the graph that standard retrieval misses. According to our data, the graph primarily re-ranks results: its recall is identical to that of the hybrid method, meaning it did not retrieve any additional relevant text snippets. Taking a second hop in the graph did not yield more either; a single hop was sufficient.

The trained EfficientRAG is fast, but weak in this form

The goal of EfficientRAG is to provide the quality of LLM-based iterative retrieval cheaply and quickly. Speed is not an issue: it runs in around 1.5 seconds per query and requires no API calls at runtime. However, its quality falls reliably behind that of BM25. In addition, it returns fewer text snippets because it terminates as soon as it deems the evidence sufficient, leading to structurally lower coverage.

An important distinction is that while the speed and cost advantages are architectural, the quality deficit is linked to the very limited amount of training data. Therefore, this does not imply that trained small models are poor in general, only that this specific implementation with this amount of data is not competitive.

Answer quality is flatter

Ultimately, it is not the retrieval ranking that matters, but whether the completed checklist is correct and well-founded. Here, the landscape is flatter: the cross-encoder hybrid, BM25, and DBSF-hybrid are nominally the best, with the graph-based method nominally slightly weaker; however, compared to BM25, none of these differences are statistically reliable, except for the trained EfficientRAG, which is weaker.

Faithfulness is high across all methods: the generator rarely strays beyond the provided text snippets. When the evidence is present in the context, hallucination is rare in this narrow task. The critical question is whether the evidence makes it into the context in the first place.

Oszlopdiagram a válaszminőségről módszerenként: átlagos helyesség BM25 0,856, dense 0,799, Hybrid DBSF 0,851, Hybrid + cross-encoder 0,866, KG2RAG 0,814, EfficientRAG 0,763, mellette a teljesen helyes válaszok aránya.

Retrieval places an upper bound on answer quality

Beyond comparing individual methods, there is a broader takeaway. When all necessary text snippets made it into the top 10 passed to the generator, the average correctness of the answers was roughly 0.90. When only some were included, it hovered around 0.78, and when none were present, it fell to around 0.68. The last figure also indicates that the generator can often answer from partial or adjacent context, but overall quality unequivocally depends on retrieval.

Oszlopdiagram: az átlagos válaszhelyesség 0,91, ha minden szükséges részlet bekerült a kontextusba, 0,78, ha csak néhány, és 0,68, ha egy sem.

Where is the graph strong, and where is it not?

Breaking results down by question type provides more nuance:

  • KG2RAG is strongest on single-document reasoning, where multiple facts within a single document linked via shared entities need to be pieced together. Here, its recall is noticeably higher than that of BM25.

  • It is weakest on cross-document questions: here, its answer correctness is lower than that of BM25. A likely reason is that the graph originates from the entities in the anchors, whereas answering the question requires snippets across multiple documents that are not connected by any single anchor.

  • Retrieval quality deteriorates across all methods when moving from simple lookup questions toward multi-hop queries.

Hőtérkép a hat módszer keresési minőségéről és válaszhelyességéről kérdéstípusonként; a KG2RAG az egydokumentumos következtetésnél a legerősebb (0,91), a dokumentumok közötti kérdéseken a leggyengébb.

Cost: this is where the race is decided

While differences in quality are minor, differences in cost span orders of magnitude:

  • Hybrid search responds within a few tens of milliseconds, incurs no per-query API costs, and only requires a one-time indexing step.

  • KG2RAG requires a one-time graph construction step using an LLM. On our corpus of 1,101 text chunks, this cost roughly $0.27 and took about an hour. Afterwards, response times are a few seconds per query, and the graph must be rebuilt whenever new documents are added.

  • The trained EfficientRAG runs in about 1.5 seconds per query and incurs no runtime API costs. Generating the training data cost less than a dollar in API fees, but model training adds to this overhead. On our dataset, the cost–quality Pareto frontier (the set of methods for which no alternative is simultaneously faster and better) consists of BM25 and hybrid search. For large document collections and high query volumes, this becomes a critical question of scalability and return on investment.

Szórásdiagram a medián keresési késleltetés (logaritmikus skála) és az nDCG@20 összefüggéséről; a Pareto-frontot a BM25, a Hybrid DBSF és a KG2RAG alkotja, a jelölő mérete az egyszeri költséggel arányos.

Takeaways

1. Start with hybrid search. Score fusion combining BM25 and semantic search (vector database, embeddings) is the solution that could not be reliably beaten in this evaluation. Implementing it is a classic low-hanging fruit that provides a solid baseline at low cost. The fusion method matters less than ensuring both signals are present. Moreover, it is transparent: it is always clear which search component yielded a given result, which is an advantage for Explainable AI.

2. Build the graph on top of a strong first step, not instead of it. The effectiveness of KG2RAG is bounded by the initial anchor retrieval step. A knowledge graph can only build upon what the first step has already surfaced. A graph can be worthwhile when questions require connecting multiple facts within a single document and the construction cost can be amortized, such as with a stable, frequently queried corpus. Where new documents arrive continuously, frequent graph rebuilding tilts the cost-benefit balance negatively.

3. Do not choose a method based solely on its research paper. In its paper, EfficientRAG promises LLM-grade retrieval at a fraction of the cost. On our data, using our training set, this did not pan out. Fast latency and cheap operation are genuine advantages, but quality must be validated on your own documents before committing to an agentic or trained approach. Adding an intermediate routing layer that delegates easy questions to a hybrid pipeline and complex questions to agentic search could be a viable compromise, though we did not test this.

4. Measure at the answer level, with confidence intervals. Retrieval metrics are excellent diagnostic tools, but the system must ultimately be chosen based on final checklist quality. Small differences can easily mislead: variations below 0.03 nDCG represent noise at this sample size. It is best to track KPIs end-to-end on your own documents and supplement synthetic questions with real questions written by subject-matter experts. This is one of the cornerstones of sound LLMOps practice.

The decision framework is summarized in the table below.

Scenario

Recommendation

Why

New system, sub-second latency required

Hybrid (BM25 + semantic search, DBSF)

Fast, no per-query API costs, was not reliably outperformed

Clean, digital documents, multi-fact reasoning questions, stable document corpus

Hybrid, supplemented with KG2RAG if necessary

The graph excels at reasoning, but the gain is not statistically reliable and comes with a one-time build cost

High query volume, stable domain, training data available

Trained Labeler and Filter, only after evaluation on in-domain data

Fast and free at runtime, but proved weaker than BM25 in our setup

Reranker or any trained component

Benchmark on your own sample

The cross-encoder was nominally the best in answer quality, but did not reliably outperform BM25 in retrieval

What to watch out for: study limitations

We also want to be upfront about what we do not know. The benchmark comprises 97 questions, which is a small sample; therefore, "equivalent" results indicate an absence of detected differences rather than proof of equivalence. Both the questions and reference answers were LLM-generated and only spot-checked. Such questions tend to mirror the vocabulary of the source text, meaning real-world system performance in production could be lower. The generator model and the evaluating judge were the same LLM, and the runs were single evaluations without calibration against human ground-truth labels.

Conclusion

Retrieval quality is the primary bottleneck in RAG-based checklist automation (audit workflows, document verification), and it must be benchmarked on real documents. On our EU public procurement benchmark, a carefully designed hybrid search proved to be the best starting point: it is fast, inexpensive, and was not surpassed in performance even by significantly more complex architectures. A graph approach may pay off when applied selectively to appropriate question types, while trained agentic retrieval should only be adopted following rigorous evaluation on your own data. It is also advisable to supplement the system with human oversight (human-in-the-loop), particularly in compliance verification where responsible AI considerations come into play.

Our DocAudit product was built specifically for AI-powered document verification and processing, and we applied these very insights throughout its development.

If you are building an AI agent or a RAG-based document processing system and would like to benchmark which architecture makes sense on your own data, get in touch with us.

Tamás Kiss

Senior AI Engineer

Tamás leads the technical delivery of end-to-end AI projects—from planning and implementation through to developer and client-side coordination—while supporting knowledge transfer through hands-on AI training sessions.

Related solutions

All AI Solutions

More articles

All articles

Let's discuss what this means for you.

You speak directly to the experts, not to a call centre.

At the first consultation, we will review your situation and tell you what the best first step is.

Free initial consultation with no obligation. We will respond within one business day. This is how we start working together · Privacy Policy

Sütibeállítások

Kategóriánként döntheted el, mihez járulsz hozzá. A szükséges sütik nélkül az oldal nem működne, ezért ezek mindig aktívak.

Adatkezelési tájékoztató