I could read the buyer’s name on the scanned invoice. My document extractor scored 0/9 on it. I tested it on sample files in our own open-source demo, and the local API configuration had no optical character recognition (OCR) step to turn that image into text. Document-extractor evaluation
The Hugging Face configuration ran the same base model, Qwen2.5-1.5B-Instruct (the local API run used a 4-bit Q4_K_M build), with a Florence-2 OCR step, and scored 8/9 on the scan. I like the remaining error because you can see exactly what went wrong. The buyer’s name picked up an extra comma.
That test gives me somewhere concrete to start when a retrieval-augmented generation (RAG) prototype gives a bad answer. Find the passage a person would use, then follow it through the system until it disappears or the answer departs from it. Whether I’d pay for document processing, a search change or a different reader depends on where that happens.
The short answer
A RAG prototype that works in a demo usually fails in production at a specific stage, not “in the model”. Either the answer never made it into the index, retrieval did not put it in front of the model, or the model had it and did not use it properly. Barnett et al. (CAIN 2024) name seven such failure points across those stages and note that a RAG system can only be fully validated during operation, on real questions. Retrieval also does not remove false answers: in a Stanford study, three commercial legal research tools built on RAG hallucinated on 17% to 33% of responses, against 43% for GPT-4 without retrieval (Magesh et al., 2024). In our own open-source document extractor, the same base model scored 0/9 fields on a scanned invoice when the pipeline could not read the image, and 8/9 once a text-recognition step was added. So before paying for a bigger model, trace one failed question stage by stage, measure each stage on 30–50 real questions, and price the fix for the stage that actually broke.
What this note covers: where each failure point shows up and how to check it in an afternoon (Figure 1); why demo sets miss these faults; what our measured configurations show about “is it the model?” (Figure 2); what the Stanford data says about hallucination with retrieval (Figure 3); a one-week triage checklist; red flags in a repair quote; and how our health check works (Figure 4).
Evidence used: two peer-reviewed or preprint studies, cited inline and listed under Sources, and measurements from Modelshifts’ own open-source demos on sample files (12 November 2026). No client results are reported.
Where does a RAG prototype actually break?
Imagine asking an internal assistant, “Does a renewal need approval if the terms haven’t changed?” Say the handbook has a general approval rule and a paragraph that makes an exception for renewals. A confident answer quoting the general rule could come from several quite different faults.
For an afternoon’s diagnosis, I’d keep the wording of that question fixed. I’d also keep the same user’s access, the document revision and the configuration that produced the answer. Changing the question until the demo works makes the original miss harder to explain.
Barnett and colleagues documented seven failure points in their experience building RAG systems. I group them by what I can open and inspect while the failed answer is still on screen. Barnett et al., CAIN 2024
Did the content ever make it in? (FP1)
Missing content. The assistant says the handbook has nothing on renewals. Open the approved source and find the exception by eye, then search for a distinctive phrase in the extracted text and in the indexed chunks for that revision. A filename in an upload list doesn’t show which pages were readable; open the extracted text.
If the page is a scan and its extracted text is blank, route it through OCR and inspect the result before rebuilding the affected chunks. If the approved source itself lacks the answer, somebody with authority over the handbook needs to supply it. Until then, the assistant should be able to say what information is missing.
Did retrieval deliver the passage to the reader? (FP2–FP3)
Missed the top-ranked documents (FP2). The user gets a convincing quotation from the general approvals page. Read the ordered search results for the failed question and look for the labelled exception before any results are shortened or combined. If it’s in the index but below the selection cutoff, try a search that preserves the exact policy term alongside the semantic search, then compare the ranks on the same questions.
Not in context (FP3). The search preview highlights the right exception and the assistant still gives the blanket rule. Compare the returned chunk IDs and text with the exact context sent to the reader. Deduplication may have discarded a near-identical chunk whose final sentence changes the answer.
For that fault I’d change how passages are assembled. Keep the exception with the rule it qualifies, then replay the question at the same context budget. Simply fetching more text can still drop the same exception.
Was the answer in context, and what did the reader do with it? (FP4–FP7)
Not extracted (FP4). The renewal clause is visible in the reader’s input, yet the assistant says it can’t find an answer. Give the reader that clause on its own and ask it to quote the words that decide the question. If it can do that, restore the surrounding passages and try a shorter context or an explicit instruction to select supporting text before answering.
Wrong format (FP5). A person sees a correct approval decision, but the form that requested it stays empty. Run the actual response through the form’s parser and inspect the rejected field. If the contract calls for a decision and a citation in separate fields, enforce that schema and return a validation error the application can handle.
Incorrect specificity (FP6). Someone asking about an unchanged renewal receives a department-wide summary. Underline the qualifiers in the question and find where the answer accounts for each. Ask for a decision at the same scope as the request, and have the reader ask for clarification if a deciding detail, such as whether the terms changed, is absent.
Incomplete (FP7). The answer gets the renewal decision right and omits a documentation requirement in the same passage. Write down the parts a handbook owner would need to act, then mark which ones appear in the reply. Give the reader those required parts as an output contract and send partial replies for review with the missing part identified.
Why can a good demo set miss all of this?
A set built by opening a handbook and turning its headings into questions gives the search engine the exact terms used in the document. It also tends to supply an answer for everything. A person at work might use an old name for a policy, paste half a question from an email or ask about something the handbook has never covered.
Barnett et al. write that “validation of a RAG system is only feasible during operation”. I’d keep the evaluation open after handover for that reason.
A pre-release test can catch a broken parser today. The question that reveals an ambiguous renewal clause may arrive later. Barnett et al.
I’d keep a “bad scanner day” folder. Put an image-only page beside its readable original, keep a table with its heading stranded on the previous page, and save an authorised example of a real question whose wording fooled search. For each entry, keep the source revision, the expected passage and the answer or abstention a person would accept.
Keep ordinary questions in the set too. A chunking change that reunites the table and its heading may make short, simple definitions harder to retrieve. Running both kinds of question gives you a way to see what the proposed repair costs elsewhere.
Is it the model?
On our document extractor the local API configuration got 52/61 fields right across the sample PDFs. The Hugging Face configuration with OCR got 60/61. The scan accounts for the difference in the totals on these sample files, measured on 12 November 2026. Document-extractor results
I also tested our open-source table-qa demo on a sample workbook. The same base 1.5B coder model scored 4/7 on the Hugging Face backend and 6/7 on the local API backend (a Q4_K_M build). The misses were different questions. On Hugging Face, generated code tried to read a units column that didn’t exist on the sales sheet. Table-qa evaluation
The local API configuration returned East where the expected top region was North, a question Hugging Face got right. I’d want both the generated column lookup and the expected region in a repair brief. One lets me test whether the code can execute against the sheet, and the other catches code that runs cleanly and returns the wrong business answer.
I don’t know whether a different model would help with your questions. I’d try a model comparison once I could hand each candidate the same sufficient passage and score the answer that came back. The demo results tell me where to put a probe, and give me no basis for predicting your score.
Doesn’t RAG stop hallucinations?
Stanford researchers tested three commercial legal research tools built on RAG. On their legal questions, the tools hallucinated on 17% to 33% of responses, compared with 43% for GPT-4 without retrieval. The accurate shares for Tools A, B and C were 65%, 42% and 20%, respectively, compared with 49% for GPT-4. Magesh et al.
Look at what happens between those labels. Tools A and C both hallucinated on 17% of responses, but the incomplete share was 18% for A and 63% for C. In the study, “incomplete” means a refusal or an answer without proper supporting authority, and “hallucinated” includes falsely claiming a real source supports a statement. A buyer counting only hallucinations would miss a large difference in how often someone got a correct, grounded answer on that set.
In the handbook example, I’d score an answer that invents a renewal exception separately from one that quotes the real exception and leaves out a condition. Those failures ask different things of the person checking the work. Measuring those rates for the handbook would take a test on its own questions.
How would I triage a failing RAG prototype in a week?
- Build a passage-level retrieval eval. Ask the person who uses the answer for a sample of real questions. Have them mark the source revision and passages that support each decision, including acceptable alternative sources. Keep questions with no authorised answer in a separate group with an expected abstention.
- Measure recall@k on the answerable set. Set k to the configured cutoff for ranked results. For each question, divide the number of required passages present in those results by the number required, then average across questions. Count interchangeable copies once and repeat the check on the assembled context to see what was dropped.
- Check faithfulness and citations. Read each material claim beside the cited passage as it appeared on that run. Ask whether the words support the claim, whether the question was fully answered and whether the receiving app can use the format. Save the exact sentence that failed review.
- Exercise the abstain path. Replay a question against an empty eligible result set and inspect what the user sees. I’d want a plain statement that the available documents don’t settle it, plus a way to reach the person who can. Also try irrelevant results because a nonempty search can still contain no usable evidence.
- Leave a trace someone can replay. Give the request an ID and link the source revision, extraction status, candidate ranks, selected text, reader configuration, output and reviewer decision. Keep document access controls on the trace. Record stage timings and costs so someone can locate an expensive retry after the question has left the screen.
- Price an accepted answer. Add the cost of retrieval, generation, retries and review for the sample, and divide by the number of answers accepted under the agreed rubric. Keep abstentions visible separately. If nothing was accepted, report the spend and the empty denominator, then rerun the same set after the proposed change.
At the end of the week I’d want a sentence you could put on a purchase order. For the illustrative handbook problem, that might be “Keep the renewal exception attached to its parent clause and demonstrate that the cited decision survives the application parser.” A supplier can quote for that and the owner can tell when the work is done.
Which red flags would make me pause a repair quote?
- The proposed fix is a bigger model and nobody can show what text the current reader received for the failed question.
- The retriever’s score counts a whole file as a hit even when the decisive clause never reaches the reader.
- The acceptance report gives credit for a clickable citation without opening it and checking the claim beside it.
- The estimate prices a successful call and leaves the retries and manual corrections off the worksheet.
For a project stalled over ownership or rollout, I’d use the pilot-to-production note.
For a buying decision that depends on a supplier’s performance on your own data, I’d use the vendor-evaluation guide.
What else comes up in a RAG health check?
Can I start with a screenshot of a bad reply? Use it to recover the question and response, then look up the document version in the run history. If the original context wasn’t saved, label the next run as a reproduction so the reviewer knows what evidence survives.
What if two approved documents disagree? Keep both passages and ask the document owner which one governs the question. Record that decision with the test and let the assistant flag the conflict until there’s an authoritative answer.
When would you rebuild the index? I’d try it on the affected files when a change to extraction or chunk boundaries produces better source text. Keep the old index available long enough to compare the same questions, including ones that used to work.
How do we approach it at Modelshifts?
Our AI project health check is US$900 as an introductory rate for the first three clients, and US$2,500 standard thereafter. It takes 5–8 business days. We measure each stage on 30–50 of your real questions, with access to the repo or a working demo, and deliver a written report with the failed examples and a ranked fix list. If the evidence says the project should stop, we say so in writing; in that case you pay the health-check fee in full and nothing more. If a repair is worth it, the health-check fee is 100% credited toward a follow-on US$6,500 Fix Sprint measured on the same questions.
You can bring a question that went wrong and the document you expected it to find. Book a health check
Trace the passage before you price the fix.
Sources
All sources accessed 29 November 2026 (SGT). Every number in this note maps to one of these.
- S1. Scott Barnett, Stefanus Kurniawan, Srikanth Thudumu, Zach Brannelly, Mohamed Abdelrazek (Applied Artificial Intelligence Institute, Deakin University). “Seven Failure Points When Engineering a Retrieval Augmented Generation System.” CAIN 2024; arXiv:2401.05856, 11 January 2024. https://arxiv.org/abs/2401.05856 . Supports: the seven failure points (FP1–FP7), “validation of a RAG system is only feasible during operation”, BioASQ case study with 15,000 documents and 1,000 questions.
- S2. Varun Magesh, Faiz Surani, Matthew Dahl, Mirac Suzgun, Christopher D. Manning, Daniel E. Ho (Stanford RegLab / HAI). “Hallucination-Free? Assessing the Reliability of Leading AI Legal Research Tools.” arXiv:2405.20362, 2024. https://arxiv.org/abs/2405.20362 . Supports: preregistered set of over 200 legal queries; Figure 4 shares of accurate / incomplete / hallucinated responses (Tool A 65/18/17, Tool B 42/25/33, Tool C 20/63/17, GPT-4 without retrieval 49/8/43). Products are anonymised here as Tools A–C.
- M1. Modelshifts, document-extractor (open source, MIT), measured 12 November 2026 on seven sample PDFs, 61 fields. https://modelshifts.com/work/document-extractor/ . Supports: 0/9 vs 8/9 on the scanned invoice; 52/61 vs 60/61 overall; configurations (local API, Qwen2.5-1.5B-Instruct Q4_K_M, no OCR; Hugging Face, Qwen2.5-1.5B-Instruct with Florence-2 OCR).
- M2. Modelshifts, table-qa (open source), measured 12 November 2026 on seven questions over a sample sales workbook and its CSV export. https://modelshifts.com/work/table-qa/ . Supports: 4/7 (Hugging Face) vs 6/7 (local API, Q4_K_M); the absent units column; East returned where North was expected.
- Related Modelshifts notes: Why AI pilots stall before production (organisational causes) and How to evaluate an AI vendor on your own data.