Clean text,
from messy real documents.
Real-world documents aren't clean text — PDFs with multi-column layouts, scanned pages, embedded tables. Unstructured.io parses these into structured, usable text before they ever reach a RAG pipeline's embedding step, which is where most document-heavy RAG projects actually win or lose on retrieval quality.
Serving UK and EU clients: GDPR, EU AI Act, and data residency are covered on our Trust & Safety page.
The step before
embedding, not after.
Unstructured.io is a document ETL library purpose-built for RAG pipelines — it ingests messy real-world formats (PDF, DOCX, PPTX, HTML, scanned images) and outputs structured elements — titles, narrative text, tables, list items — with layout metadata preserved, rather than a flat blob of text. That element-level tagging is the detail that separates it from a generic text extractor: a downstream system can tell a table from a heading from a footnote, instead of receiving every character as equally meaningful prose.
It's an open-source Python library that can run entirely self-hosted for the basic parsing strategies, plus a hosted API for the higher-accuracy "hi-res" layout-detection models and heavier OCR workloads. That gives a real choice between self-hosting the core and offloading the compute-heavy parsing — similar in spirit to Whisper's hosted-versus-self-hosted split, but for document parsing instead of speech. For clients who can't send documents to a third-party API at all, the self-hosted path with the faster "fast" strategy is the only option, with a real accuracy tradeoff against the hosted hi-res models that we test and disclose rather than paper over.
The honest contrast is with a bare PDF text-extraction library: those give you raw characters with no structural awareness — a two-column page interleaves sentences, a table becomes a scrambled row of numbers, a footnote ends up mixed into the middle of a paragraph. Unstructured.io's layout-aware models classify document elements before extracting text, which is the difference that actually matters for retrieval quality. Against LlamaParse, an alternative in the same space — which leans more heavily on LLM-based re-rendering, tuned for very complex, nested, table-heavy PDFs — we default to Unstructured.io for its broader format coverage and maturity, and reach for LlamaParse when a particularly gnarly document set needs more than Unstructured.io's layout detection can deliver.
What matters practically: it handles the widest range of formats through one consistent pipeline, so a mixed corpus of PDFs, Word docs, PowerPoint, HTML, email, and scanned images doesn't need a different parser per file type — which is closer to what a real client's document set actually looks like than a single clean format. Most RAG projects that fail on document quality fail here, at ingestion, long before the vector database or the language model ever gets a chance to disappoint anyone.
Real client document sets come with their own quirks worth naming: PDFs exported from scanned fax archives with inconsistent resolution, forms with fillable fields that don't extract the same way as narrative text, spreadsheets pasted into slides as images rather than as tables. None of these are exotic edge cases in practice — they're closer to the norm the first time we actually look at a client's real archive rather than a cherry-picked sample.
It's also worth being honest about what parsing alone can't fix: a document that's genuinely ambiguous to a human reader — a table with merged cells and no clear header row, a diagram with labels pointing at overlapping elements — stays ambiguous after parsing too. Good extraction surfaces the structure that's actually there; it doesn't invent clarity a document never had in the first place, and we flag that distinction rather than letting a client assume a clean export means a clean document underneath it.
We validate parsing output against a sample of real documents before committing to a strategy at scale, the same way we'd validate retrieval before launch — spot-checking that tables came through intact and headers landed where they should, not just assuming a library that worked on someone else's PDFs will behave the same way on this client's.
Parsing that preserves
structure, not just text.
Getting the text out is easy. Preserving what it means, and chunking it sensibly afterward, is the actual work — and it's where the real engineering time on a document-heavy RAG project actually goes.
Tables, headers, and multi-column layouts parsed with their structure intact and tagged by element type, not flattened into a word soup that loses what a table versus a heading actually meant — the difference between a usable row of numbers and a row of numbers nobody can trust.
Chunking by title or section preserves semantic boundaries for well-structured documents, but fails on documents with poor heading structure, where a fixed-size or similarity-based strategy does better instead. We test against the actual document set rather than defaulting to one strategy everywhere because it worked on a previous client's files, since that's exactly the kind of assumption that quietly degrades retrieval later.
PDFs, Word documents, PowerPoint, HTML, email, and scanned images handled through one consistent pipeline, paired with OCR tooling like Tesseract for documents that are pure images of text with no extractable layer underneath — a common situation with older archives and faxed paperwork.
Output structured and tagged by element type so the embedding step downstream can weight or filter a table differently from narrative text, not treat every chunk the same regardless of what kind of content it actually holds — a distinction that compounds across a large corpus.
The preprocessing step
underneath RAG.
The preprocessing step underneath any RAG pipeline working with real documents, rarely the final deliverable on its own.
The full pipeline this document parsing feeds into, including chunking strategy, retrieval, and golden-set evaluation.
The broader document processing service this parsing step sits inside, beyond just feeding a RAG pipeline.
Unstructured.io as one tool in the broader stack we draw on, chosen for a given project's actual document mix.
Calculate extraction accuracy, review volume, latency, and cost for a document pipeline.
Before you
book a call.
The questions we get asked most about document parsing for RAG — answered straight, no sales pitch.
Why not just extract text with a basic PDF library?
Basic extraction often loses structure — a table becomes a jumble of numbers, a two-column layout interleaves unrelated sentences. Unstructured.io preserves that structure, which matters directly for retrieval quality downstream, since a chunk that garbles a table is a chunk that can't be retrieved usefully no matter how good the embedding model is.
Does this handle scanned documents?
It handles common formats including scanned images, often paired with OCR tooling like Tesseract for documents that are pure images of text with no selectable text layer at all — a scanned contract or an old fax, for instance.
How does this fit into a RAG build?
It's the preprocessing step before chunking and embedding — clean, structured text in, so the rest of the pipeline has something sensible to retrieve from, rather than a pile of correctly-generated embeddings pointing at garbled source text.
What's the difference between Unstructured.io and LlamaParse?
Both parse documents for RAG, but LlamaParse leans more heavily on LLM-based re-rendering, tuned for very complex, nested, table-heavy PDFs. We default to Unstructured.io for its broader format coverage and maturity, and reach for LlamaParse when Unstructured.io's layout detection isn't precise enough for a particularly gnarly document set — it's a tradeoff between breadth and precision on the hardest layouts, not a strict upgrade in either direction.
Does chunking strategy actually matter, or is one approach fine for everything?
It matters more than most teams expect. Chunking by title or section preserves semantic boundaries for well-structured documents, but fails on documents with poor or no heading structure, where a fixed-size or similarity-based strategy does better. We test the chunking strategy against the actual document set rather than defaulting to one approach everywhere, because the wrong choice shows up later as mysteriously bad retrieval rather than as an obvious error anyone notices immediately.
Tell us what
documents you're working with.
Book a 30-minute call — we'll tell you honestly whether your documents need this level of parsing, or whether something simpler works.