Docling — Document Parsing for AI
IBM document parsing library. Converts PDFs, DOCX, PPTX, images, and HTML into structured markdown or JSON. Built for RAG pipelines and LLM ingestion.
Ready-to-run agent install
This asset can be installed after the agent chooses its runtime, checks the plan, and runs the matching command.
npx -y tokrepo@latest install 443e86c2-3811-496e-8e4d-6eef742ab219 --target codexRun after dry-run confirms the install plan.
What it is
Docling is IBM's open-source document parsing library that converts PDFs, Word documents, PowerPoint files, images, and HTML into structured markdown or JSON. It handles complex layouts with tables, headers, figures, and multi-column text, producing clean output suitable for RAG pipelines and LLM ingestion. The library uses AI models for layout understanding and OCR when needed.
Developers building RAG applications, document Q&A systems, or any pipeline that needs to extract structured text from documents benefit from Docling. It replaces fragile PDF parsers with a model-based approach that handles real-world document complexity.
How it saves time or tokens
Docling produces clean, structured output that LLMs can process directly. Without it, developers chain together multiple tools (PDF parsers, table extractors, OCR engines) and write custom post-processing code. Docling handles the entire pipeline in one library call. Clean output also means fewer tokens wasted on HTML tags, layout artifacts, and parsing noise.
How to use
- Install Docling via pip
- Create a DocumentConverter instance
- Convert documents and get structured markdown or JSON
Example
from docling.document_converter import DocumentConverter
converter = DocumentConverter()
result = converter.convert('report.pdf')
# Get markdown output
markdown = result.document.export_to_markdown()
print(markdown)
# Get structured JSON
json_output = result.document.export_to_dict()
# Process multiple files
for path in ['doc1.pdf', 'doc2.docx', 'slides.pptx']:
result = converter.convert(path)
print(f'{path}: {len(result.document.pages)} pages')
Related on TokRepo
- AI tools for documents — Browse document processing and parsing tools
- RAG tools — Explore retrieval-augmented generation frameworks
Common pitfalls
- Complex table layouts with merged cells may not parse perfectly; verify output for critical documents
- OCR accuracy depends on image quality; low-resolution scans produce lower quality text extraction
- Processing large documents (100+ pages) can be slow; batch processing with parallel workers improves throughput
Frequently Asked Questions
Docling supports PDF, DOCX, PPTX, images (PNG, JPEG, TIFF), HTML, and AsciiDoc. PDF is the primary format with the most robust parsing support. Other formats have varying levels of layout preservation.
Docling uses AI models to detect table boundaries and cell structure. Tables are converted to markdown tables or structured JSON with row and column information. Complex tables with merged cells may require post-processing.
Yes. Docling includes OCR capabilities for scanned documents and images. The OCR pipeline runs automatically when text is not extractable from the PDF. Quality depends on scan resolution.
Docling is open-source and runs locally with no API costs. LlamaParse is a cloud service with potentially better accuracy on complex layouts but requires an API key and per-page pricing. Docling gives you data privacy and no usage fees.
Yes. Docling is maintained by IBM Research and used in production document processing pipelines. It handles common document formats reliably. For edge cases, combine it with fallback parsers.
Citations (3)
- Docling GitHub— IBM document parsing library for structured output
- Docling Documentation— AI-based layout understanding and OCR
- Docling PyPI— Multi-format document conversion for RAG pipelines
Related on TokRepo
Source & Thanks
Created by IBM. Licensed under MIT. DS4SD/docling — 15K+ GitHub stars
Discussion
Related Assets
crw — Fast Web Scraping + Search MCP in Rust
crw is a Rust web scraping/search tool with a Firecrawl-compatible API plus built-in MCP support for agents. Verified 87★; pushed 2026-05-14.
magic-cli — LLM Command Suggestion for Terminals
magic-cli is a Rust CLI that suggests commands, semantically searches shell history, and works with local or cloud LLM providers.
Uni-CLI — Governed Software Commands + MCP for Agents
Searchable CLI catalog (282 sites, 1680 commands) that serves governed tools to agents via MCP, with repairable adapters; verified 73★, pushed 2026-05-13.
Codeg — Local AI Coding Workspace (Tauri/Web)
Run Codeg as a standalone server or desktop app to manage local agent workflows, MCP installs, and engineering loops; one-line install is available.