A confession to start: I once believed a better model could fix a messy knowledge base. I spent evenings comparing model sizes, rewriting prompts, adjusting temperature settings like a chef seasoning a broth that was spoiled before it reached the stove.
It took a single afternoon of looking at raw, parsed text to change my mind. What the system was actually reading — underneath all that fluent answering — was word salad from old scanned contracts, five unmarked versions of the same policy, and a pricing sheet that anyone in the company could summon with a question. The model was doing honest work with dishonest material.
If any of this sounds familiar, the RAG data engineering foundation page describes the treatment side of this story. This piece stays with the diagnosis.
We fall in love with the wrong end of the pipeline
There's a reason we obsess over models. They're visible, quotable, benchmarked. You can argue about them at lunch. Nobody brings "parsing quality" to a lunch conversation.
But the work a retrieval system does sits almost entirely upstream of the model. Something has to read a PDF and decide where the paragraphs begin. Something has to decide whether a scanned page is a contract or a collage. That something is unglamorous, and when it fails, nothing downstream announces the failure. The pipeline just keeps moving, and six months later someone asks why the knowledge base keeps answering with last year's discontinued policy.
The scale makes this worse every quarter. IDC estimated that global data reached roughly 149 to 180 zettabytes in 2024, headed toward 394 zettabytes by 2028, with unstructured material — documents, scans, images — making up 80 to 90 percent of it. Enterprises look at that mountain and see an asset waiting to be questioned. What they rarely see is that the mountain is full of duplicates, drafts and dead versions, all dressed identically.
And we are a species that duplicates by default. One knowledge-management study found 65 percent of employees spend at least an hour a week recreating information that already exists — 5.68 hours on average — and in half the cases they later discover the document was sitting there the whole time. Every act of recreation mints another version with no memory of its siblings. Feed that into an index and the machine learns none of our habits for deciding what counts as final.
Five versions of the truth
Let me make the version chaos concrete, because abstraction lets us off the hook.
In the company I poked through, the travel reimbursement policy existed as: the official final (scanned), a working draft someone edited during the update process, an approved revision that never got renamed, a copy pasted into a slide deck, and a chat export someone archived "just in case." Five artifacts, one truth, zero signals distinguishing them. The knowledge base, asked about reimbursement limits, retrieved the working draft — which contained a number a manager had typed as a placeholder during negotiations. The placeholder was never approved. It was, however, beautifully phrased.
Employees didn't know any of this. They just knew the answers felt off, and after two or three bad experiences they stopped asking. That's the true cost curve of a dirty corpus: it isn't the errors themselves, it's the quiet abandonment that follows them. You don't get loud failures from a knowledge base. You get a slow erosion of use, and then a renewal invoice for a system nobody opens.
The fix, incidentally, is not a heroic re-indexing weekend. Snapshot the index, remediate by batches in order of importance, compare against an evaluation set before each swap-in, and keep rollback available so a bad batch costs minutes instead of trust. Boring, schedulable, reversible — the properties that make a cleanup actually finish.
What "clean" actually means
I've come to think of document intake the way cooks think of mise en place. Before anything touches heat, everything gets washed, measured, trimmed. For documents entering a knowledge base, the prep list is surprisingly concrete.
Parsing first. Can the file be read at all? A stamped contract with handwritten notes is the stress test; if the seal, the scrawl and the clauses merge into one undifferentiated stream, every downstream answer inherits the confusion. Tables lose their grids. Reading order scrambles. Nothing screams — it just quietly lies.
Redaction next. The uncomfortable question: if the whole company could query this file tomorrow, what would we regret? Phone numbers, account details, internal pricing. Mature systems detect and mask whole categories automatically — the public specification from UglyPear Data, for one, mentions 13 categories — but the deeper principle is cultural: decide what may never enter, and enforce it with code, not memoranda.
Compression, which sounds cosmetic and isn't. Most of a document's bulk lives in embedded images and redundant formatting. Stripped properly, files shrink 60 to 80 percent while the text survives intact, and everything downstream — intake speed, retrieval latency, the token cost of every single query — gets cheaper as a result.
Chunking, the art of the cut. Too fine and answers lose their context; too coarse and retrieval blurs. The elegant middle path the industry converged on retrieves a small passage but hands the model the entire parent section — precision in finding, generosity in reading.
And then the two nobody budgets for: permissions and lifecycle. People leave. Policies expire. Documents age out. A knowledge base without lifecycle management is a compost heap with a search bar.
The part that changed how I work
Here is the habit I now consider non-negotiable, and it took me embarrassingly long to adopt: the intake process must be observable.
I used to run cleanup batches the way people run dishwashers — load it, walk away, hope. Two thousand files, hours of processing, no idea what was happening inside. When we finally moved to a pipeline where progress was visible, failures traced to specific files, and mistakes could be rolled back rather than apologized for, the character of the work changed. Problems surfaced in minutes, not quarters. Remediation stopped being archaeology.
Research on workplace attention explains why automation of vigilance matters: after an interruption, it takes a person about 23 minutes to regain deep focus, and the average worker now switches between 35 applications in a day. Asking a human to eyeball hundreds of incoming documents is not a quality-control strategy; it is a way of converting one kind of unreadable backlog into another.
The companion habit is evaluation. Keep a small set of questions whose right answers you know. After every change to intake or configuration, run them. Watch the curve. None of this is sophisticated. All of it is the difference between managing a number and defending a feeling.
The order of operations
If I could send one message back to my prompt-tuning self, it would be about sequence. Fix the input first. Then the rules. Then the observability. The model discussion, if it's still needed, comes last — and in my experience, by the time you get there, it often isn't.
Because the model was never really the problem. It was the most willing participant in the mess: endlessly patient, unfailingly fluent, ready to compose elegant sentences out of whatever fragments it received. The documents, meanwhile, were never ready at all. Nobody had asked them to be.
Try it now
- RAG data engineering foundation: https://www.uglypear.com/en/
- All products and solutions: https://www.uglypear.com/en/products/
- Technical blog and more field notes: https://www.uglypear.com/en/blog/
FAQ
Q: Should we delete the old index and start over if quality is bad?
A: Usually not. Incremental remediation — snapshot, batch re-processing, evaluation-gated swap-in, rollback available — preserves what users still trust and keeps integrations intact. A rebuild also resets every habit your team just learned.
Q: Whose job is document quality, anyway?
A: Treat it as shared between the document owners and whoever operates the pipeline. Owners know which versions are authoritative; the pipeline enforces parsing, redaction and permission rules uniformly. Quality collapses when either side assumes the other is checking.
Q: How often should the golden set be re-run?
A: After every meaningful change to intake logic, configuration or content batches, plus a scheduled pass on a fixed cadence (monthly works for most teams). The trend line matters more than any single result.
Q: Does this apply to small teams, or only enterprises?
A: The stages are the same; the scale is not. A five-person team can hold parsing quality and versions in one person's head for a while — until the folder passes a few thousand files, at which point the same disciplines start paying for themselves.