Don’t Pause RAG for a Document Cleanup — RAGroom from Day-0 to Day-2

One of the hardest conversations in an enterprise RAG project is not explaining what the technology cannot do. It is explaining why a technically possible shortcut should not become the production design. "We need to clean up the documents first" sounds reasonable. Yet when years of copies, revisions, and drafts are scattered across repositories, the cleanup itself can become a transformation program. Waiting for it to finish may leave the RAG initiative stalled.

In the previous article I argued that a document an AI can read is not necessarily a document the company can stand behind. This follow-up is about what to do next. RAGroom is my ongoing exploration of treating tagging and triage as a bounded engineering workstream, rather than demanding perfect enterprise-wide knowledge management upfront.

Run document triage alongside RAG, not before everything

I would separate the work into two tracks. The RAG service starts with a narrow question set, known audiences, and a reviewed document subset. In parallel, a document intake track inventories the wider corpus, identifies duplicates and possible versions, proposes tags, and queues unclear items for their owners. The tracks meet at an admission gate: being processed does not make a file safe to publish into retrieval.

A service track narrows a question to a scoped RAG service backed by reviewed knowledge, while a separate document-intake track triages the wider corpus. Both routes meet an approval gate before producing search-eligible knowledge.
This diagram shows how RAG delivery and document triage can proceed together while ownership, access, and approval remain conditions for search admission.

For an internal employee assistant, a small set of verified operational guides may be enough for an initial service. Customer- or partner-facing answers require stricter ownership and access checks. When validated coverage is incomplete, abstaining on an unanswered question can be a safer operating choice than opening the entire raw corpus.

Day-0: establish the rules before parsing

Day-0 is less about prompting an LLM and more about defining the work. Which repositories and file types are in scope? What counts as a source identity or document version? What minimal taxonomy helps reviewers? Who decides whether something is official? A small, practical classification scheme can be sufficient to start.

A filesystem modification timestamp is not an effective date or a business approval. Source identity, hashes, provenance, parsing outcome, and possible owners need separate treatment. The exact runtime contract will vary by environment; I present this as a design direction rather than a verified feature of a finished product.

Day-1: turning a PDF collection into reviewable knowledge candidates

My initial hands-on approach involved roughly two thousand local PDF files. I used PyMuPDF and related processing to parse the documents once, retain parsed results in a memory cache, and reuse those results for subsequent tagging and triage work. The figure describes the approximate scale of the source collection, not a benchmark for classification accuracy, throughput, or savings.

The downstream questions need different techniques. Identical bytes can be recognized through a content hash. A near-duplicate or possible revision might differ in its cover page or a handful of paragraphs, so matching hashes alone is not enough. An LLM can suggest the document category or business topic, but its suggestion cannot certify which version received formal approval. In this workflow, classification produces review candidates—not deletion or publishing instructions.

An exploratory input of about 2,000 PDFs moves through document parsing and a reusable cache, then into binary-hash evidence and proposed document and topic tags. Human review and an approval decision come before official searchable knowledge, with no automatic publication.
The workflow separates parsing, identity checks, and semantic tagging from the human decision that determines whether a document can become official searchable knowledge.

Consider a synthetic example: several files are called "Service Operations Guide." One is a byte-for-byte copy, another contains minor revisions, and a third is an unapproved draft. These belong in a common review queue, but choosing the file with the newest name or modification timestamp would be a poor substitute for approval. This is an illustrative scenario, not material from any identifiable customer.

Microsoft’s Databricks guidance likewise treats parsing, metadata enrichment, deduplication, and filtering as distinct activities when preparing unstructured data for RAG. Retrieval quality and the preparation of trustworthy retrieval candidates are separate engineering questions. (Reference: https://learn.microsoft.com/en-us/azure/databricks/agents/tutorials/ai-cookbook/quality-data-pipeline-rag)

What changes when the source becomes AEM or a DAM?

A local directory is a convenient environment for early experiments. An enterprise source may instead be Adobe Experience Manager or another Digital Asset Management system. Reading the original PDF bytes is still necessary for parsing, but permanently copying every asset into another local repository is not always necessary. An adapter could fetch an authorized download URL, parse the bytes in memory, and cache derived results.

The differences are operational: expiring URLs, changing access controls, network failures, source revision races, and bounded memory. I would isolate those concerns in a source adapter while keeping the core tagging and triage logic stable. This is an intended extension, not a claim that a production AEM integration is already live.

Day-2: the work begins again when the source changes

Day-1 does not freeze the company’s documents. A file can be renamed, a new draft can appear, and access can be revoked even when content stays unchanged. Re-running a full bulk classification pipeline on every minor change wastes work. The next RAGroom design problem is to isolate a Day-2 maintenance function that processes deltas against known state.

A synthetic example makes the distinctions clear. When a PDF is renamed with the same content hash, a metadata synchronization may be enough. When an operations guide changes support hours from 9 a.m.–6 p.m. to 10 a.m.–5 p.m., the meaning of the proposed revision matters. When access is revoked, however, the system must restrict retrieval without waiting for an LLM to analyze whether the wording changed. These are different kinds of changes and should not share the same execution path.

A document change event first undergoes hash and access checks. Revoked access blocks search exposure, an unchanged hash takes a metadata-only path, and meaningful changes go to a Decision Model with four fixed choices before policy approval, idempotent indexing, and external readback.
The Day-2 workflow makes the boundary explicit: the model classifies change meaning, while deterministic operations control access, approval, index updates, verification, and targeted retry.

A Decision Model is not the owner of the approval state

For semantic changes, a constrained classification can be more suitable than asking a general-purpose model to rewrite or summarize an entire document. The useful answer might simply be one of four choices: cosmetic edit, material operating change, new subject, or uncertain. OpenAI’s Decisions API provides typed predicate, choice, and score questions for such cases. Azure OpenAI also documents a Decisions endpoint, subject to deployment and region availability. (References: https://developers.openai.com/api/docs/guides/decisions and https://learn.microsoft.com/en-us/azure/foundry/openai/how-to/decisions)

Suppose the model classifies a changed support-hours paragraph as a material change. That is a reason to route a revision candidate for review, not a command to replace the approved guide. A policy-driven process and an accountable business owner decide what becomes official and who is allowed to retrieve it.

The design boundary is deliberate. Use AI for semantic judgments, not as a database transaction manager. Source identities, content hashes, state persistence, security restrictions, index mutation, and post-update readback belong to deterministic code. Duplicate change events must not produce duplicate updates. After a partial failure, inspect durable state and external effects before replaying only the affected item.

This is not a hypothetical operational concern. Azure AI Search documentation explains that deleting a source before its deletion detection has synchronized can leave orphaned documents in the index. Aligning source state with retrieval state is part of the maintenance function, not an optional polishing task. (Reference: https://learn.microsoft.com/en-us/azure/search/search-how-to-delete-documents)

From one-time cleanup to maintainable knowledge

I would not begin with an ontology or graph database as the remedy for a disordered document collection. Until the document’s owner, validity, approval, and access scope are clear, richer relationships do not resolve the underlying authority problem.

An AX consultant does not need to promise a perfect knowledge-management program before delivering any RAG value. A narrow service and a bounded triage stream can proceed together. Day-2 then keeps their approved knowledge boundary in sync as source documents change.

What I want to build is not simply an AI that reads more corporate PDFs. It is a practical process for identifying the documents a business can stand behind—and keeping that answer current.