HeadlinesBriefing favicon HeadlinesBriefing.com

Three RAG Corpus Types and Their Architecture Costs

Towards Data Science •
×

Enterprise RAG systems fail when treated as a flat document pile. Three collection shapes exist: unrelated reports, duplicate contracts, and case bundles. Each requires distinct architecture. A senior claims handler at a 250,000 document brokerage answers "what are the seller's obligations in our distribution agreements with retailer X" by selecting three relevant folders. A naive pipeline embeds everything, retrieves top-30 by similarity, and hallucinates answers mixing unrelated files. Re-rankers don't fix this—if the right document isn't in the candidate set, re-scoring is useless. The fix: classify the collection shape upfront using three business questions. Question one: do documents reference each other? Question two: can users name a consistent field across all documents? Question three: do documents arrive in case bundles? Answering these determines whether to use document-level filtering, field-based indexing, or bundle clustering. A quarter million documents collapse to three candidates via structured filters before embedding. Building the wrong architecture costs accuracy, explainability, and compute. The baseline notebook shows one answer among five model calls on real PDFs.

The three questions are: (1) do documents point at each other, (2) can a business user name a field every document carries consistently, and (3) do documents arrive in bundles about one case. These determine the collection shape and required preparation.

Start with the companion notebook at doc-intel/notebooks-vol1 to run the five-PDF baseline and see the waste pattern on real documents.