How does structure-aware ingestion fix RAG accuracy at scale?

Answer

RAG accuracy comes from structure-aware ingestion and separate indexes, not query-time prompt tweaks.

  1. Structure-aware chunking keeps headings, code fences, and tables intact with full breadcrumb paths.
  2. LLM descriptions and dual Markdown plus CSV storage make tables searchable by meaning and readable at answer time.
  3. Separate prose, table, and summary indexes run in parallel so strong matches never lose to noisy fragments.
  4. Hard tenant partitions and idempotent batch upserts keep storage isolated and re-ingestion safe.

Applies toMulti-tenant corpusmillions of chunksprose, tables, code

1

How do documents flow from ingestion to ranked retrieval?

Structure-Aware Multi-Index RAG Pipeline
Diagram structure
  • Knowledge Corpus corpus
  • User Query query
  • Doc Summarizer doc_summary
  • Structure Parser struct_parser
  • Table Enricher table_enricher
  • Batched Ingestor batch_ingest
  • Tenant Guard tenant_gate
  • Summary Index summary_idx
  • Prose Index prose_idx
  • Table Index table_idx
  • Parallel Merger parallel_ranker
  • corpus → doc_summary · full document
  • corpus → struct_parser · prose + code
  • corpus → table_enricher · raw tables
  • doc_summary → batch_ingest · file summary
  • struct_parser → batch_ingest · addressed chunks
  • table_enricher → batch_ingest · MD + CSV + desc
  • batch_ingest → summary_idx · summary vectors
  • batch_ingest → prose_idx · prose vectors
  • batch_ingest → table_idx · table vectors
  • query → tenant_gate · tenant query
  • tenant_gate → prose_idx · scoped query
  • tenant_gate → table_idx · scoped query
  • summary_idx → parallel_ranker · doc overview
  • prose_idx → parallel_ranker · prose matches
  • table_idx → parallel_ranker · table matches
  1. Structure Parser

    Splits files along headings, code fences, and word boundaries while attaching Report > Performance > Benchmarks paths.

  2. Table Enricher

    Keeps each table whole with Markdown and CSV copies plus an LLM summary of what the table compares.

  3. Doc Summarizer

    Creates one file-level summary vector so broad document questions return complete overviews.

  4. Batched Ingestor

    Deletes old vectors before upserting new batches within API rate limits and tracks live progress.

  5. Tenant Guard

    Scopes every write and search to the tenant partition so data never leaks across tenants.

  6. Parallel Merger

    Queries prose, table, and summary indexes in parallel and ranks all hits on one relevance scale.

2

Why did fixed-size v1 leak accuracy, and how does v2 fix each gap?

Failure ModeNaive v1 (Fixed-Size Chunks)Structure-Aware v2 (7 Ingestion Upgrades)
Mid-sentence cuts & broken codeFragmentedFixed token windows split sentences and treat # in code as headingsIntact boundariesParses real sections, respects code fences, and splits long sections at word boundaries
Missing citation contextOrphanedChunks lose parent headings and section orderAddressedEvery chunk stores its heading path and parent/section indices
Flattened, unreadable tablesCorruptedTables split across chunks with misaligned columnsDual formatOne chunk per table storing full Markdown and a clean CSV copy
Semantic table queries missMissedCell values lack words like "faster" or "before/after"Meaning-indexedLLM writes a semantic description indexed alongside the table
Broad "what is in this doc?" queriesNo overviewReturns random low-context fragmentsFile summaryDedicated file-level summary vector answers document-wide questions
Prose crowds out tablesUnfair rankingOne shared index biases toward wordy paragraphsFair competitionSeparate prose and table indexes queried in parallel and merged by score
Multi-tenant & re-ingest riskLeak & driftShared namespace and duplicate vectors on re-runIsolated & idempotentHard tenant partitions, delete-before-write idempotency, and batched API calls
3

How does a query run across isolated indexes at read time?

Parallel tenant-isolated retrieval
Diagram structure
  • Client Team client
  • Tenant Guard router
  • Prose & Summary Indexes prose
  • Table Index tables
  • Parallel Merger ranker
  • client → router · Ask question + tenant ID
  • router → prose · Search tenant prose & file summaries
  • router → tables · Search tenant table descriptions & cells
  • prose → ranker · Addressed sections (heading path + score)
  • tables → ranker · Matched tables (Markdown + CSV + score)
  • ranker → client · Ranked results with exact section addresses

Opening diagram…