GLOSSARY
Retrieval-Augmented Generation (RAG)
By Sygnet Research. Written by Sygnet, sourced, checked before publication.
Retrieval-Augmented Generation (RAG) is a technique that lets a language model answer questions using information pulled from an external knowledge source, rather than relying only on what it learned during training. A retrieval step finds the most relevant passages for a given query, and the model then generates its answer grounded in that retrieved text. In document-heavy businesses, the "knowledge source" is usually a pile of PDFs, scans, and contracts, and this is where most RAG systems quietly fail.
How it works
A RAG pipeline has three stages, and each one depends on the stage before it. First, documents are broken into chunks and converted into vector embeddings, stored in a searchable index. Second, when a user asks a question, the system embeds the query and retrieves the chunks that are semantically closest to it. Third, the language model reads those chunks alongside the question and writes an answer, ideally with citations back to the source.
The stage people underestimate is the very first one: getting clean text out of the original documents. If a contract clause was extracted with a table collapsed into gibberish, or a scanned invoice was read with digits swapped, the embedding for that chunk will be built from bad text. Retrieval might still find the right document, but the model will reason over corrupted content. No amount of clever prompting fixes that afterward.
This is why document parsing sits upstream of everything else in RAG. Plain OCR handles clean, typed text reasonably well but struggles with layout, tables, and handwriting. More capable systems use ICR for handwritten fields or a VLM that reads a page the way a person does, keeping structure and context intact. The quality of that first conversion step sets a ceiling on how good the final answer can ever be.
Why it matters for document processing
Most RAG failures blamed on the language model are actually parsing failures. A misread total on an invoice, a mangled clause in a lease, a table where rows and columns got scrambled: these errors enter the index silently and never get flagged, because the retrieval step still "succeeds" in the sense of finding the document. The model then generates a confident, wrong answer built on bad input.
This matters most in regulated or high-stakes workflows: contract analysis, insurance claims, and KYC onboarding all involve documents with dense structure, mixed formats, and legal or financial consequences for getting details wrong. Before investing in retrieval tuning, chunking strategy, or a bigger model, it is worth auditing what actually goes into the index. Comparing OCR versus VLM approaches for your document types is often the highest-leverage fix available, cheaper than retraining or re-architecting the retrieval layer, and it addresses the root cause rather than a symptom.
Related terms
- OCR vs VLM
- Vision-Language Model (VLM)
- Intelligent Document Processing (IDP)
- Contract analysis
- Build vs buy IDP
FAQ
Does better parsing really change RAG output, or is it mostly a retrieval problem?
Both matter, but parsing comes first. If a chunk's text is wrong, retrieval can still rank it as relevant, and the model will generate an answer from corrupted content. Fixing retrieval logic without fixing extraction quality just means the system finds the wrong information faster and states it more confidently.
Can OCR alone support a reliable RAG system for contracts or invoices?
For clean, typed, well-scanned pages, often yes. For dense tables, handwriting, stamps, or inconsistent layouts, plain OCR tends to introduce errors that propagate silently into the index. A VLM or a combined LAD/RAD approach usually handles these cases with fewer downstream corrections.
NEXT STEP
See it on your own documents
One email when we publish something worth your time.