Before Full Agentic RAG: Know How You Decide, and the Parsing Methods You Pick From

AI engineers today frequently discuss agentic AI, where the core principle is to let the model decide. For a general-purpose assistant, this approach works well: let the agent try, and observe its actions. However, for an enterprise retrieval-augmented generation (RAG) process, it poses risks. The outputs feed real decisions, so we must understand every step and control the flow between them.

This article applies that perspective to a critical step where letting the model decide is most tempting: selecting the appropriate parsing method for each document. We construct this choice as a dispatcher we control. It reads the PDF’s nature, plans suitable methods, executes them in order, and synthesizes all outputs into one enriched corpus for retrieval, generation, and evaluation. Each decision is explicit and logged, ensuring the plan can be reviewed and validated before execution.

This article extends the document parsing component of Enterprise Document Intelligence, a series that builds an enterprise RAG system from four foundational blocks. It completes that block by composing the methods introduced one at a time: fitz for the text layer, Azure Document Intelligence and Docling for tables, a vision LLM for charts and diagrams, EasyOCR for pages without a text layer, image captioning for otherwise skipped content, and two approaches to recover a table of contents—from the printed summary or solely from body typography.

🧭 New to the series? Start with the map: Prompt, Context, Loop outlines the three engineering layers every RAG system relies on: the prompt (the call itself), the context (what fills the model’s window), and the loop (when the next call fires and when it stops). It guides you through the series with that lens, article by article, and is the fastest way to grasp the coverage and where this piece fits.

Diagram showing where this article fits in the series, closing brick 1 by composing parsing methods
Where this article sits: it closes brick 1 by composing every parsing method the previous articles introduced – Image by author

📓 The runnable notebook executes parse_pdf_agentic() on the attention paper (data/paper/1706.03762v7.pdf), prints the detected nature, the four-step plan the dispatcher produced, and the merged corpus dictionary with a 15-row native toc_df and a 1048-row line_df: doc-intel/notebooks-vol1.

1. Why the Scare Quotes on “Agentic”

Every RAG vendor now labels their document-parsing loop as agentic. Looking under the hood, it is almost always the same: a rule-based dispatcher reads file signals, selects an ordered plan of methods, runs each sequentially, and aggregates outputs. LLMs reside in individual leaves—such as a heading validation loop, a vision reader on figures, or an OCR post-processor. No LLM at the dispatch layer decides what to run next, and there is no feedback loop where an agent observes output and re-plans.

That is precisely what the dispatcher in this article does. So, calling it agentic is a stretch, and doing so without quotes would perpetuate the buzzword inflation prevalent in the market. The quotes remain.

The honest picture, function by function:

  • detect_document_nature(pdf_path): six deterministic flags read from line_df / span_df: is_scanned, has_native_outline, has_sommaire, is_composite, has_rich_figures, has_tables_signal. The docstring states plainly: “deterministic; no LLM”.
  • plan_parsing_methods(nature): pure Python if / elif on the nature label. Each branch returns a hard-coded ordered list of MethodStep. No LLM.
  • parse_pdf_agentic(pdf_path...): orchestrates the above, executes the planned steps, and merges outputs, with logging at each stage for transparency.

The dispatcher embodies a controlled, deterministic approach to parsing, ensuring enterprise RAG systems remain reliable and auditable. In 2026, as RAG deployments scale into regulated industries, this method-centric design—where decisions are explicit and traceable—becomes increasingly critical. It aligns with emerging standards for AI governance, where reproducibility and explainability are non-negotiable.

By adopting this dispatcher model, you gain a parsing pipeline that is both robust and flexible, ready to adapt to diverse document types while maintaining full control. The article walks you through composing these methods, providing a blueprint for building a parsing layer that supports high-stakes decisions with confidence.

via Towards Data Science

Related