Wednesday, July 29, 2026

Today’s Edition

AI Intel Report

MARKETS

Enterprise AI

Production RAG Pipeline for Enterprise PDFs Incorporates Relational Parsing and TOC Retrieval

The system upgrades document parsing, question parsing, retrieval, and generation to deliver typed answers with citations from complex PDF documents using the Attention Is All You Need paper as the running example.

5 MIN READ
In a contemporary enterprise office an anonymous professional viewed strictly from behind sits at a wide wooden desk engaged with multiple computer displays showing interfaces for a production retrieval augmented generation system applied to enterprise PDF documents. The main monitor exhibits structured outputs from relational parsing operations including extracted sections organized by table of contents hierarchies and linked data elements from lengthy technical PDFs. Physical printouts of complex academic papers rest on the desk surface including copies of the transformer architecture study from arXiv alongside generic enterprise contract bundles and technical manuals. Open notebooks display diagrams illustrating question parsing flows answer generation steps and citation mapping without any readable characters. A secondary display presents retrieval results drawn from document collections with highlighted relational links between parsed entities. The workspace includes an ergonomic chair a neatly arranged keyboard and mouse external storage drives for handling large PDF repositories and several file folders containing additional multi page documents. Bookshelves in the background hold reference volumes on artificial intelligence data science and enterprise software topics. The room features standard office partitions a partially visible window overlooking urban buildings and organized cabling beneath the desk. Every element grounds the scene in real world application of upgraded document parsing question parsing retrieval and generation capabilities that produce typed answers with source citations from intricate enterprise PDFs using the specified transformer paper as the concrete demonstration case. Additional dense details include the grain of the wooden desk surface the matte finish of the monitor bezels the stacked arrangement of paper edges the precise positioning of the notebooks relative to the screens the texture of the professional attire on the seated figure the arrangement of reference books on the shelves the subtle presence of a generic corporate nameplate holder without markings and the overall layout emphasizing hardware and document handling tools central to enterprise AI document intelligence workflows. The composition remains a single unified live action view capturing the integration of TOC retrieval with relational structures inside production RAG pipelines for complex PDF processing in a professional setting.
Illustration: AI Intel Report

A production RAG pipeline for enterprise PDFs is a system that upgrades the four bricks of document parsing, question parsing, retrieval, and generation to handle complex documents and noisy questions with relational data and typed outputs.

The upgraded pipeline applies the four bricks to the same question on the Attention Is All You Need paper.

The baseline pipeline consists of one hundred lines of Python code that wire the four functions together.

What limitations does the basic RAG pipeline face with enterprise PDFs?

That pipeline returns the right answer on a clean question against a paper with a built-in table of contents.

On a real corpus it breaks the first time the user types a query with two typos.

It also breaks the first time the document is a 200-page contract with no PDF outline.

The basic approach breaks the first time the question asks for every exclusion instead of one.

It breaks the first time downstream code wants a typed object instead of a string.

That pipeline returns the right answer on a clean question against a paper with a built-in table of contents. On a real corpus it breaks the first time the user types “positonal encodig” with two typos, the first time the document is a 200-page contract with no PDF outline, the first time the question asks for every exclusion instead of one, the first time downstream code wants a typed object instead of a string.Angela Shi, Author

How does relational parsing improve document handling?

Document parsing produces line_df one row per visible line with page_num, line_num, text, bounding box.

Document parsing also produces page_df one row per page.

It produces toc_df one row per section with title, level, start_page.

The parsing produces parsing_summary as well.

On the Attention paper the toc_df has three levels and twenty-two entries.

In what way does question parsing address noisy inputs?

Question parsing turns noisy input like “What are the optoins for posiitional encoding?” into a structured ParsedQuestion.

The structured ParsedQuestion includes corrected keywords.

It includes intent.

It includes RetrievalQuery.

It includes GenerationBrief.

How does TOC-aware retrieval enhance accuracy?

Retrieval filters using keyword hits per TOC section.

It then uses an LLM TOC router to pick sections by semantic relevance.

The process merges with keyword pages.

It sizes context by question granularity.

What does the generation step produce in the upgraded pipeline?

Generation returns a typed answer with one citable span per item.

It also returns four context-quality indicators.

What are the market and stakeholder implications for enterprise AI?

The output is what an enterprise user needs a typed answer with verbatim quotes tied to line ranges and a full audit trail from question to citation.

This approach supports production use on real corpora.

How have experts reacted to the pipeline approach?

Angela Shi described the limitations of the basic pipeline in detail.

What comes next for this enterprise document intelligence series?

The companion GitHub repo at doc-intel/notebooks-vol1 provides runnable notebooks for the series.

The repo has 32 stars.

The series builds an enterprise RAG system from four bricks.

A follow up article points the one pipeline at four very different PDFs.

The Attention Is All You Need arXiv paper used as the running example is 15 pages long.

A hundred lines of Python wire the four functions together in the baseline pipeline.

The public companion-code repo at doc-intel/notebooks-vol1 provides runnable notebooks for the series.

The series is called Enterprise Document Intelligence.

The article opens Part III of Enterprise Document Intelligence.

The output is a typed answer with verbatim quotes tied to line ranges and a full audit trail from question to citation.

In the previous article the pipeline was upgraded for each of the four bricks.

The pipeline is pointed at four very different PDFs in the follow up.

Document parsing produces line_df one row per visible line with page_num line_num text bounding box.

Document parsing produces page_df one row per page.

Document parsing produces toc_df one row per section with title level start_page.

Document parsing produces parsing_summary.

Question parsing corrects typos and infers answer shape.

Retrieval uses TOC router plus keywords.

Generation returns typed answers with citable spans.

The pipeline returns the right answer on a clean question against a paper with a built-in table of contents.

On a real corpus it breaks the first time the user types “positonal encodig” with two typos.

It breaks the first time the document is a 200-page contract with no PDF outline.

It breaks the first time the question asks for every exclusion instead of one.

It breaks the first time downstream code wants a typed object instead of a string.

Comparison of RAG pipeline components between baseline and upgraded versions
ComponentBaselineUpgraded Pipeline
Document ParsingBasic text extractionRelational set with line_df page_df toc_df and parsing_summary
Question ParsingRaw inputParsedQuestion with corrected keywords intent RetrievalQuery and GenerationBrief
RetrievalEmbedding similarityTOC router plus keyword hits merging with keyword pages
GenerationString responseTyped answer with citable spans and four context-quality indicators
  1. Document parsing produces relational dataframes.
  2. Question parsing structures the input.
  3. Retrieval selects relevant sections using TOC and keywords.
  4. Generation creates typed answers with citations.

Frequently asked

What is the length of the example paper used in the pipeline demonstration?

The running example uses the public 15-page arXiv paper Attention Is All You Need.

How many entries are in the TOC of the example paper?

The native TOC on the Attention paper has three levels and twenty-two entries.

Sources

  1. Towards Data Science — The upgraded pipeline upgrades four bricks on the same Attention Is All You Need paper.
  2. GitHub — The companion GitHub repo provides runnable notebooks for the series with 32 stars.
  3. Towards Data Science — The pipeline is pointed at four very different PDFs using the same four bricks.