UGLYPEAR AI completes its business upgrade: High-Performance Document Compression × RAG Data Engineering PlatformLearn about the New Business →

Before You Swap the Model, Check What You Fed It: A Health Check for Documents Entering Your Knowledge Base

A team we know spent a quarter tuning prompts and testing three different models. The answers from their internal knowledge base stayed mediocre. The turning point came when someone finally opened the index and looked at what the system was actually reading: a batch of scanned contracts that parsed into word salad, five versions of the same policy with no version markers, and a pricing sheet any employee could query. Nothing about that pile could be fixed by a better model.

This scene repeats itself across companies more often than anyone admits. The model sits at the very end of the pipeline; whatever quality problem exists has usually been baked in long before the first token was generated. UglyPear Data builds a RAG data engineering foundation, and the single most common finding from that work is blunt: the documents were never fit to enter the index in the first place.

Before discussing tooling, try a quick self-assessment. When you last asked your knowledge base a question, did you get a usable answer, or a paragraph that merely sounded like one? If the answer was wrong, could you trace which file and which section it came from? Do you know who loaded that file, when, and whether anyone checked it? If two of these three questions leave you shrugging, the rest of this piece is for you.

The pile grows, the answers drift

The scale of the problem is easy to underestimate. IDC estimates global data volume reached roughly 149 to 180 zettabytes in 2024 and will climb to 394 zettabytes by 2028, with unstructured content — documents, images, scans, recordings — making up 80 to 90 percent of it. That unstructured mass is exactly what enterprises dream of turning into a question-answering asset.

What happens when it just gets dumped in? Research on knowledge management offers a hint: 65 percent of employees spend at least an hour a week recreating information that already exists, averaging 5.68 hours, and in half of those cases they later discover the document was there all along. A company where the same fact lives in five unmarked versions — final, draft, half-revised, another draft — will produce a knowledge base that cites whichever version it happens to retrieve. Nobody will be satisfied with that.

A retrieval system does not magically convert files into knowledge. A scanned contract that parses into garbage is noise wearing the costume of content. A contract loaded without sensitive-data handling turns the knowledge base into one enormous disclosure surface, where anyone who can type a question can read what they should not. A two-hundred-page report sliced into a hundred disconnected fragments gives the model a shredded context and then blames it for rambling.

What a document should pass through before entering the index

The intake pipeline we describe publicly consists of six stages and eight capabilities: extraction, cleaning, redaction, compression, chunking, and permission with lifecycle management. Each stage answers one specific question.

Extraction answers whether the file can be read at all. PDFs, Office documents, OFD files, scans, engineering drawings — parsing quality sets the ceiling for everything downstream. Complex layouts lose table structures and reading order; sliced content comes out misaligned. Scanned files are the worst offenders: a stamped contract with handwritten notes can end up with seals, margin scribbles and body text fused into one undifferentiated stream, and once the order is wrong, every citation downstream is wrong too.

Cleaning answers how much filler is inside. Headers, footers, repeated template paragraphs and stray characters waste the retrieval system's attention and muddy the semantic space.

Redaction answers who is allowed to see what. Phone numbers, ID numbers, bank accounts, internal pricing — loaded raw, they expose the whole company to anyone with query access. Our public specification covers detection and redaction across 13 categories of AI-sensitive information, drawing a line between what the system may say and what it must not.

Compression asks whether the file deserves the space it occupies. Most of the bulk comes from embedded images and redundant formatting; treated properly, file size typically drops by 60 to 80 percent, which directly affects intake speed, retrieval latency, and the token cost of feeding context to a large model.

Chunking answers whether a passage the model reads is complete. Cut too fine, the answer loses context; cut too coarse, retrieval turns blurry. A parent-child approach retrieves a small passage but hands the model the whole surrounding section, which covers both ends.

Permissions and lifecycle answer what happens when things expire or people leave. A knowledge base is not a one-time project; staff turn over, policies change, documents age. Without lifecycle management, six months later you own an answer dump nobody trusts.

The contrast between approaches is easier to see side by side.

Approach Parsing quality Sensitive data Size and cost Failure tracing Rollback Fits
Dump files as-is Depends on format luck; scans often garble None; anyone can query anything Redundant images and formatting all retained Practically impossible None Personal note-keeping
Format conversion only Text readable, tables often mangled Still manual, file by file Slightly smaller File known, step unknown None Small one-off imports
Full pre-intake treatment Layout, tables and reading order preserved 13 categories auto-detected and redacted 60-80% smaller, token cost falls with it Progress visible, failures traced to the file Incremental updates, rollback supported Enterprise, continuously operated

Humans cannot eyeball this at scale

At this point the instinctive reply is: assign someone to inspect incoming documents. The arithmetic says otherwise. Research on workplace attention has found that after an interruption it takes about 23 minutes to regain deep focus, and that the average worker switches between 35 different applications in a day. Asking a person to manually verify parsing quality, redaction and chunking across hundreds of files is just another form of work about work. In practice the review becomes a rubber stamp, and the bad files sail through anyway.

Inspection belongs to the pipeline, and the pipeline must be observable. The plain engineering standard looks like this: for any batch, you can see which file is being processed, which step it reached, which file failed and why — at any moment. The observability improvements in our preprocessing stage address exactly this: long batches show visible progress, failures trace to a specific file, and a mistaken run can be rolled back. Operators stop running batches blind and hoping; problems surface on the spot and get fixed on the spot.

The same discipline exists across the industry, usually under the banner of evaluation-first. Prepare a small set of questions whose right answers you already know — a golden set. After every change to intake logic or configuration, rerun the golden set and watch whether hit rates regress. One step further: deliberately slip corrupted files and obviously sensitive files into a batch and check whether the pipeline catches them. None of this is exotic. It only requires treating knowledge base quality as a measurable number rather than a feeling.

A failure story makes the stakes concrete. One team loaded two years of meeting minutes and asked about the conclusion of a project review; the system blended three separate sessions and answered with a conclusion long since overturned. The post-mortem found two root causes: early scanned minutes parsed badly, and updated minutes carried no version markers, so stale and fresh material stood equal in retrieval. Both flaws sat outside the model. Both were cheap to fix. The expensive part was that nobody had checked the intake, and the damage sat undetected for half a year.

Change the feeding before changing the model

Circle back to the self-assessment at the start. If you could not answer those three questions, the order of operations is fairly clear.

Go through existing documents in order of importance and look honestly at parsing quality, scans and complex layouts above all. Define the sensitive-data rules — what gets auto-redacted, what is barred from the index entirely — and write them down as policy, not verbal custom. Add observability to the intake pipeline so every batch has a checkable trail. Only then evaluate whether the model itself needs changing, and by how much.

Run the sequence the other way around and you will most likely pay for a more expensive version of the same wrong answers. No model rescues polluted input; conversely, clean, sensibly chunked, permission-aware corpora routinely make a mid-sized model look better than anyone expected.

There is also a practical boundary many teams weigh: document stores full of contracts, pricing, HR and research material are exactly the kind of data that should not leave the network. That is the case for private deployment — processing happens locally, the index lives in your own environment, and nothing crosses the perimeter. UglyPear Data's RAG data engineering foundation follows that route; you can read more at the RAG data engineering foundation page, and the document compression layer that feeds it is covered under SmartSlim.

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: We already loaded our files into a knowledge base and the quality is poor. Do we start over?
A: No. Treat it as incremental remediation: snapshot the existing index, re-process the weak batches (re-parsing, redaction, re-chunking), compare results against an evaluation set before and after, and swap in the improved batches once the numbers improve. Rollback support keeps the trial-and-error cost contained.

Q: Won't redaction distort content and hurt answer accuracy?
A: Mature redaction replaces or masks specific categories — ID numbers, account numbers, contact details — while preserving surrounding context. The accuracy cost is far smaller than the compliance cost of leaving sensitive fields in the open. Rules should be configurable so each business line sets its own strictness.

Q: How much should documents be compressed before intake, and does compression hurt AI readability?
A: Pre-intake compression targets embedded images and redundant formatting; the publicly stated range is a 60 to 80 percent size reduction with body text untouched. Smaller files mean lighter parsing and retrieval work — a help to AI readability, not a hindrance.

Q: How do we know whether the knowledge base is actually improving over time?
A: Keep a golden set of questions with known answers, rerun it after every intake or configuration change, and record hit rates and error types. Tracking that trend beats intuition by a wide margin.