Document navigation,
for AI Agents.

DocSlicer is a lightweight parser that turns PDFs, DOCX, PPTX, and HTML into a queryable tree of sections. Stop dumping entire files into your context window - let your LLM pull only the chunks it needs.

Read the docs
~/contracts/parse.py
import docslicer

# HSBC Holdings PLC Annual Report — 372 pages · 518,426 tokens
result = docslicer.parse_document("hsbc_annual_report_2025.pdf")
# → done in 7.85s

# inspect the outline before pulling anything into context
result.hierarchy.to_outline()
  # - Highlights
  # - Our Strategy
  #   - ...
  # - Financial Summary
  #   - Income statement commentary
  #     - Net interest income
  #       - Summary of interest income by type of asset
  #   - ...

# pull only what the agent needs
section = result.find_heading("Summary of interest income by type of asset")[0]
chunks  = result.chunks_under(section)  # ~1,000 tokens
  # |                                     | Avg balance | Interest | Yield |
  # |                                     | 2025, $m    | 2025, $m | %     |
  # | ----------------------------------- | ----------- | -------- | ----- |
  # | Short-term funds and loans to banks | 325,790     | 11,460   | 3.52  |
  # | Loans and advances to customers     | 971,804     | 46,036   | 4.74  |
    
PDF · DOCX · PPTX · HTMLMulti-Format
~32 pages/secSingle-thread · CPU Only
630 KB installNo ML models · runs anywhere
Open SourceAGPL-3.0
[1]Developer quick start

One unified parser.
Endless downstream workflows.

Go from a 400-page doc to structured, agent-ready data in three lines of Python. No API keys, no gigabytes of model weights to download on first run - just queryable objects out of the box.

parse.py
import docslicer

def main():
    result = docslicer.parse_document("annual_report.pdf")

    result.chunks      # list[Chunk]  — heading-aware chunks, ready for embedding
    result.tables      # list[Table]  — typed cells with spans; multi-format export
    result.metadata    # title, author, language, page count, OCR flag, ...
    result.hierarchy   # HierarchyTree — navigable tree of all headings

    # Also accepts DOCX, PPTX, HTML, URLs, and raw bytes
    result = docslicer.parse_document("contract.docx")
    result = docslicer.parse_document("deck.pptx")
    result = docslicer.parse_document("filing.html")
    result = docslicer.parse_document("https://www.sec.gov/Archives/.../10-K.htm")
    result = docslicer.parse_document(file_bytes)

# PDFs over ~50 pages fan out across processes — guard the entry point
if __name__ == "__main__":
    main()
[2]Features

Layout-aware parsing
that understands the page.

DocSlicer reconstructs the document structure - so your LLM sees clean, faithful content instead of scrambled text.

PART I
Item 1. Business
Products
iPhone
Mac
iPad
PART I
Item 1. Business
Products
iPhone
Mac
iPad

Heading hierarchy

Every heading is detected and reconstructed into a navigable outline tree — so an agent can jump straight to the section it needs instead of scanning the whole document.

123456

Reading order

Multi-column layouts, figures, and footnotes are untangled into the exact sequence a human would read — no scrambled text bleeding across columns.

Net interest incomecolspan = 3Year endedQuarter endedDec 25Dec 24Dec 23Dec 25Sep 25Dec 24Interest income97,872108,631100,86824,50324,36126,004Interest expense(63,078)(75,898)(65,072)(15,307)(15,584)(17,819)Net interest income34,79432,73335,7969,1968,7778,185

Tables

Table structure is recovered cell-by-cell, preserving the row- and column-spans that flat text extraction silently throws away.

Benchmarks

The only parser that combines
speed and accuracy.

BizDocBench scores parsers on six axes, across PDF, DOCX, PPTX and HTML. DocSlicer is the only tool that is well-suited for agentic harnesses, combining fast parsing, with accuracy and support for multiple document types

docslicerAll formatsPDF only
fast and accurate0.51251020501000.40.50.60.70.80.9aggregate pages / sec (log)bizdocbench scoredocslicer0.88 · 31.3 p/sdocling0.70 · 3.5 p/smarkitdown0.58 · 27.4 p/sunstructured0.58 · 0.5 p/sopendataloader0.54 · 117.3 p/spymupdf4llm0.45 · 11.8 p/smineru0.41 · 0.7 p/smarker0.37 · 0.9 p/s
vs docling
10× faster
Document Hierarchy Accuracy
>85%
Table Accuracy
>80%
RAG Performace
Best in Class
Reproduce this run
Full results8 tools · 6 axes
ToolScoreCoveragen=77Speedn=parsedHierarchyn=9Faithfuln=9Tablesn=12Retrievaln=19Parsed
docslicer0.881.000.880.850.980.800.7677/77
docling0.701.000.380.490.890.750.7177/77
markitdown0.581.000.850.060.800.260.5477/77
unstructured0.580.910.110.430.910.480.6470/77
opendataloader0.540.581.000.390.650.270.3345/77
pymupdf4llm0.450.600.650.110.650.360.3646/77
mineru0.410.600.140.420.620.300.3946/77
marker0.370.600.160.190.610.300.3846/77

77 business documents · Apple M4 Max, 16 cores, 64 GB · every tool at its official defaults, versions pinned · score is the mean of the six axes, each macro-averaged over its documents · speed is a log-scaled throughput score over the documents a tool parsed · a failed or assisted parse scores 0 on every axis

[4]Get started

One parser.
Every document.
Zero wasted tokens.

DocSlicer is free and open source under AGPL-3.0. Using it in a closed-source product? Reach out about a commercial license.