AI Skill Report Card

Parsing Documents with LlamaIndex

A-83·Sep 26, 2026·Source: Extension-page
14 / 15
Bash
pip install llama-parse
Python
from llama_parse import LlamaParse parser = LlamaParse( api_key="llx-...", # from cloud.llamaindex.ai result_type="markdown", # "markdown" or "text" parsing_instruction="Extract all tables with full row/column structure", premium_mode=True, # enables agentic/VLM parsing for complex docs ) documents = parser.load_data("./contract.pdf") print(documents[0].text)

For fully local/offline parsing with no LLM tokens:

Bash
npm install @llamaindex/liteparse
Recommendation▾
Add a concrete example of the Pydantic schema extraction workflow with actual code, since it's mentioned repeatedly but never shown
13 / 15

Progress:

  • Step 1: Identify document complexity (simple text vs. scanned/handwritten/multi-modal)
  • Step 2: Choose the right tool (LlamaParse cloud for complex/agentic parsing, LiteParse for fast local parsing)
  • Step 3: Parse — get layout-aware markdown/text output with bounding boxes if needed
  • Step 4: Extract — define a schema and run LLM-powered structured extraction
  • Step 5: Split/Classify — segment long documents into logical sections, tag by natural-language rules
  • Step 6: Index — chunk and embed for RAG retrieval
  • Step 7: Validate — spot-check tables, charts, and handwritten sections for accuracy; re-run with premium_mode or custom parsing_instruction if quality is low

Decision guide:

  • Scanned/handwritten/complex multi-column docs → LlamaParse with premium_mode=True
  • Clean digital PDFs, Office docs, images, no cloud/tokens desired → LiteParse (local)
  • Need structured JSON from unstructured content → LlamaParse Extract with a Pydantic schema
  • Need to route document types differently → LlamaParse Classify + Split before extraction
Recommendation▾
Include a bad-output example (e.g., what happens when premium_mode is skipped on a scanned doc) to illustrate contrast, not just good outcomes
16 / 20

Example 1: Input: A 40-page financial due-diligence PDF with dense multi-page tables and embedded charts. Output: Markdown output preserving table row/column relationships, chart data converted to structured JSON (labels, series, values), ready to chunk and embed for RAG.

Example 2: Input: Scanned insurance claim form with handwritten notes. Output: Clean text extraction of handwritten fields via agentic OCR auto-correction loop, structured into a defined schema (claimant name, date, claim amount, notes) with confidence flags on low-certainty fields.

Example 3: Input: Directory of 500 mixed invoices (different vendors/layouts). Output: Classified by vendor type using natural-language rules, then extracted into a unified schema (invoice_number, line_items, total) with no per-template custom code.

Recommendation▾
Clarify the LiteParse local-parsing pathway with a code snippet parallel to the LlamaParse quick start, since it's introduced but never demonstrated
  • Always set a parsing_instruction for domain-specific documents (e.g., "preserve table structure," "extract handwritten annotations separately") — improves accuracy significantly.
  • Use premium_mode/agentic parsing for anything with charts, tables, handwriting, or irregular layout; reserve fast/basic mode for clean digital text to save cost.
  • Define extraction schemas explicitly (Pydantic/JSON schema) rather than relying on free-form prompts — yields consistent, machine-parseable output.
  • Chunk after parsing, not before — parse the full document first to preserve layout context, then split logically for indexing.
  • For production/enterprise workloads, use VPC deployment and enable access controls if handling PHI/PII (HIPAA/GDPR/SOC2 scope).
  • Validate outputs on a sample set before running full-batch extraction on high-volume document sets.
  • Don't run cheap/basic OCR on scanned or handwritten documents — it silently fails on messy layouts; use agentic/premium parsing instead.
  • Don't skip schema definition for extraction — free-form extraction is inconsistent and hard to validate downstream.
  • Don't chunk raw OCR text before parsing corrects layout — this destroys table/row relationships permanently.
  • Don't assume one parsing config fits all document types — finance tables, medical handwriting, and manufacturing specs need different parsing_instructions.
  • Don't ignore auto-correction/confidence signals — always surface low-confidence extractions for human review in high-stakes domains (finance, healthcare, insurance).
0
Grade A-AI Skill Framework
Scorecard
Criteria Breakdown
Quick Start
14/15
Workflow
13/15
Examples
16/20
Completeness
17/20
Format
15/15
Conciseness
14/15