Announcing our LlamaCloud General Availability (and our $19M series A)!
LlamaIndex

Jerry Liu 2025-04-23

Beyond chatbots: adopting Agentic Document Workflows for enterprises

2025 is the year of agents, but what does that look like in practice?

Earlier this year we introduced the Agentic Document Workflow (ADW) architecture. In this post we begin a series of articles that dive deeper, starting with the basic questions: how do you do implement ADW, and when should you do so?

What is ADW?

2025 is the year of agents. Since 2023, we’ve been saying that naive RAG by itself isn’t sufficient to meet enterprise needs, so we don’t need to make that case again. Instead, we want to lay out a positive vision of what real-world agentic applications look like, especially when tasked with tackling the challenges of enterprise data.

Enterprise working patterns are dominated by file formats like PDFs, PowerPoints, HTML and Excel spreadsheets. These files are designed to be read and written by humans, posing what has previously been a barrier to automation.

With the advent of LLMs, that barrier has fallen. LLMs are exceptionally good at handling the kind of unstructured and semi-structured data in enterprise files, opening the possibility of creating agentic applications that automate major parts of previously manual processes.

What’s been missing is a clear reference architecture that can get enterprises beyond “chat with your documents” prototypes to fully-integrated, automatic processes that tackle the real-world use cases we see with our customers. Agentic Document Workflows is the missing reference architecture.

The four stages of ADW

A minimal ADW has four stages, connected by formal data contracts:

Stage Responsibility Typical tech
Parse Convert raw files into lossless, typed objects (text blocks, tables, images, metadata) LlamaParse, multimodal OCR, custom extractors
Retrieve Surface only the slices of context relevant to the task, with lineage back to source Hybrid BM25 + dense vector search, metadata filters, recursive lookup
Reason Apply policy and multi‑step logic; maintain state across turns ReAct / function‑calling loop, declarative workflow DSL, guardrails
Act Commit results to downstream systems; emit audit logs Webhooks, SQL writes, ERP/CRM adapters, messaging bots

The power of the ADW patterns comes from the typed messages (such as Pydantic models) that are used to pass outputs from each stage to the next. These allow each stage to confidently expect their input, allowing for better error handling and retries. These formal contracts differentiate ADW from earlier, more ad-hoc RAG and agent implementations.

These formal hand-off points also facilitate the often critical element of human in the loop. Human expertise isn’t always required at every stage, but for some applications manual review is essential for handling exceptions, quality control, and providing oversight.

The Building Blocks of ADW

To implement the ADW pattern effectively, you need four key components working together:

  1. Parsing Engine – A VLM‑native parser that can understand complex layouts and tables, and can extract into structured output. This is the critical base layer that allows LLMs to understand your data.
  2. Knowledge Layer – An indexing and retrieval system that can provide your agents with tools (e.g. via an MCP server) to access your various sources of data
  3. Agent Orchestration – A system that allows you to blend fully deterministic and LLM-mediated steps to make use of the flexibility of agents while maintaining guardrails.
  4. Action Connectors – Typed interfaces to enterprise systems like ERP, CRM, databases, and communication channels that allow your agents to connect their output to the rest of your software ecosystem.

In each of these components, human in the loop can provide approval mechanisms and feedback loops that allow human experts to review, override and improve system outputs.

To implement ADW effectively, your agent framework needs access to high quality data, a clear mechanism for blending flexibility with determinism, and a wide variety of high-quality interfaces for data both incoming and outgoing.

ADW in the real world: Contract Risk Analysis

Let's examine a customer use case we've implemented: reviewing inbound vendor contracts overnight, flagging clauses that expose the company to unacceptable risk, and creating actionable tasks in contract lifecycle management systems.

Stage Action Output artifact Human in the loop (optional)
Parse / Extract LlamaParse converts the PDF into Markdown and a JSON list of clause blocks with positional metadata clauses[] with IDs, page numbers, raw text Review the clauses
Retrieve / Match Each clause is mapped against a policy knowledge base of forbidden or negotiable terms using hybrid search and keyword filters matches[] linking clause‑ID → policy rule+score Validate the matches
Reason / Synthesize The agent builds a structured summary with severity scores, offending clause snippets, and suggested fallback language red_flag_report {risk_level, offending_clauses[], suggestions} Approve the summary
Act / Connect Connects to CLM systems (e.g Ironclad, Icertis, Coupa) and sends notifications via Slack tool_call {task_id, input} Sign off on the action

This implementation highlights some design principles:

  • The agent workflow codifies business logic: You want to define explicit constraints in the agent workflow (e.g. first parse, then retrieve) while leaving space for LLMs to reason and take actions (e.g. building the summary), in a way that reflects the actual business process.
  • Structured outputs enable automation: Downstream systems can parse JSON payloads rather than trying to extract meaning from prose

This same pattern can be applies across many domains, from privacy audits to financial due diligence. You simply swap the policy knowledge base and the connector while keeping the core architecture intact.

When to Adopt the ADW Pattern

Not every document-centered task needs this level of structure. Here's a quick decision framework:

Scenario Good fit? Rationale
"Search this handbook" Plain RAG is cheaper and fast enough
Summarize one PDF for manual review ⚠️ Simple chain patterns work fine; no automation needed
Parse 500 invoices, reconcile against POs, schedule payments Multiple document types, business rules, and stateful actions demand ADW
Run contract risk scoring nightly and create tickets Requires scheduled orchestration and system integration

The key decision factors are:

  1. Does the workflow span multiple document types?
  2. Are there complex business rules to apply?
  3. Does the process need to update systems of record?
  4. Is there a need for scheduled or high-volume processing?

When these factors align, the ROI of implementing a full ADW architecture becomes compelling. Our enterprise customers usually start with simple RAG chatbots but upgrade to ADW as their needs and complexity scale up.

ADW is the essential next step beyond document Q&A

RAG chatbots proved that LLMs can understand documents. Agentic Document Workflows demonstrate they can work with them — safely, repeatedly, and at enterprise scale.

LlamaIndex provides the end-to-end stack for building these workflows, from LlamaCloud (our document intelligence layer) to our open-source agent framework with event-driven orchestration.

If your organization is wrestling with document-heavy processes that still require manual handling, check out our resources below, come talk to us, or hop in our Discord.

Happy building!

Resources: ADW reference implementations

We have assembled a growing collection of reference implementations based on real applications where ADW has been effective for our customers and open source users. In each case, organizations started with simple document Q&A but evolved to these more sophisticated workflows when manual integration became the bottleneck.

  • Invoice Intelligence Agent – Processing invoices in bulk, it extracts header and line items, validates totals against POs, posts to financial systems, and flags discrepancies. Notebook.
  • Contract Risk Agent – Identifies problematic clauses around indemnity and data privacy, routes to legal teams, and tracks resolutions. Notebook.
  • Financial Due Diligence Assistant – Analyzes financial documents and models, highlights year-over-year risk changes, and generates structured reports. (Related report generation notebook).