TOOL WIKI · DATA & RETRIEVAL
Docling
Converts document content and structure into representations for application pipelines.
Jump to a section 10 sections
EXAMPLE USE CASE
Preserve a policy’s structure in Markdown
A policy assistant needs usable source text or relevant evidence before a generation model can answer a question reliably.
- Input
- The supplied HTML policy document.
- Expected output
- policy.md containing its headings and 30-day condition.
- Success check: policy.md preserves the returns heading and 30-day condition.
- Try a failure: A parser success without the critical policy condition should fail ingestion acceptance.
Example scope: Actual document conversion; OCR, complex PDFs and tables need their own fixtures.
Preserve provenance, input format, and access-control metadata.
inputTo 02 · DoclingProcessing documents locally or in a controlled ingestion service. Check layout fidelity and the handling of scans and complex tables.
processTo 03 · Prepared recordsValidate the component-specific output, including failed or empty records.
Store derived data with source version and deletion information.
Use compatible query processing and tenant-scoped filtering.
outputTo 06 · EvaluationCheck extraction quality, retrieval recall, and answer grounding separately.
Result or stopping point
Processing documents locally or in a controlled ingestion service. Check layout fidelity and the handling of scans and complex tables.
When to consider it
- Processing documents locally or in a controlled ingestion service.
A design decision to make
- Check layout fidelity and the handling of scans and complex tables.
Prerequisites and setup
- Python 3.11+ on a supported platform. PDF/OCR pipelines may require model downloads and system dependencies.
python3 -m venv .venv
source .venv/bin/activate
pip install doclingTry a small integration
policy.html
<!doctype html><html lang="en"><title>Returns policy</title><main><h1>Returns</h1><p>Returns are accepted within 30 days.</p><h2>Shipping</h2><p>Dispatch follows packing.</p></main></html>convert.py
from pathlib import Path
from docling.document_converter import DocumentConverter
result = DocumentConverter().convert("policy.html")
markdown = result.document.export_to_markdown()
assert "30 days" in markdown
Path("policy.md").write_text(markdown,encoding="utf-8")
print(markdown)Run and check the result
python convert.py- policy.md preserves the returns heading and 30-day condition.
- Start with HTML to isolate the conversion API; then compare a PDF/table fixture against its rendered source.
Common failures
- A successful parse job does not prove table/reading-order accuracy; compare output with the original page.
- Enforce file-size, duration and memory limits. Treat extracted text as untrusted content rather than instructions.
Production decisions
- Preserve document ID, version, page/section, access scope and parser/model configuration alongside each chunk or vector.
- Evaluate extraction and retrieval separately. Test tables, scans, empty documents, duplicates, malformed input and source deletion.
Keep exploring
Explore the same layer
Compare candidates on your own workload. This entry describes a product’s role; it is not a claim that products in the category are interchangeable.