Token导航 LogoToken导航TokenDH.com
研究检索external-serviceunknown未标认证来源可访问许可证需确认审计未展示

doclingdocling 命令行

Agent Skill

docling 用于查找、检索和筛选相关信息,适合在 Local Agent 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

480

周安装

20

下载量

160
Local Agent

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:docling(docling 命令行)
来源仓库:https://smithery.ai
仓库路径:docling
安装命令:
Basic Installation
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 对应宿主 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.sh安装方式未标明
Basic Installation

简介

docling 用于查找、检索和筛选相关信息。

  • 适合在 Local Agent 中根据关键词或任务场景快速定位候选结果。
  • 安装命令为 Basic Installation。
  • 可结合来源仓库和 README 核验具体用法。
  • 使用前需确认是否会触发联网或文件读写操作。docling 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Docling - Document Processing for Gen AI

Overview

Docling is a powerful Python library developed by IBM Research that simplifies document processing for generative AI applications. With 48,400+ GitHub stars and 159 contributors, Docling excels at parsing diverse document formats—including advanced PDF understanding with layout analysis—and provides seamless integrations with AI frameworks like LangChain, LlamaIndex, and Model Context Protocol (MCP) servers.

Key Features

📄 Multi-Format Document Processing

  • 12+ Input Formats: PDF, DOCX, XLSX, PPTX, HTML, Markdown, AsciiDoc, CSV, Images (PNG, JPEG, TIFF), USPTO XML, JATS XML, WebVTT
  • Advanced PDF Understanding: Page layout analysis, reading order detection, table structure recognition, code block extraction, mathematical formula parsing, image classification
  • Unified Document Representation: All formats parsed into consistent Docling Document structure
  • 5+ Export Formats: Markdown, HTML, JSON (lossless), Plain Text, Doctags markup

🤖 AI Ecosystem Integration

  • LangChain Official Extension: langchain-docling package with document loaders
  • LlamaIndex Integration: Docling Reader + Node Parser for RAG applications
  • MCP Server: Model Context Protocol server for agentic applications
  • Framework Support: Compatible with Crew AI, Haystack, and other AI frameworks

🚀 Production Features

  • Local Execution: Run entirely offline for sensitive data (no remote service dependencies)
  • OCR Support: Built-in optical character recognition for scanned documents
  • Vision Language Models: VLM integration for enhanced understanding
  • Audio/ASR Support: Transcription capabilities for audio formats
  • Table Extraction: TableFormer with FAST/ACCURATE modes
  • Code Detection: Automatic code block identification and preservation

Architecture

Document Processing Pipeline

Input Document → Format Detection → Backend Selection → Pipeline Execution → Docling Document
                                                                               ↓
                                                         [Export] → Markdown, HTML, JSON, Text
                                                         [Serialize] → Chunking, Embedding

Core Components

  1. Document Converter: Orchestrates format-specific workflows
  2. Format Backends: Specialized parsers per format (PDF, DOCX, etc.)
  3. Processing Pipelines: Layout analysis, table extraction, OCR
  4. Docling Document: Unified document representation (Pydantic v2)
  5. Serializers: Export to various formats with customization

Extensibility

  • Base classes available for subclassing (custom backends, pipelines)
  • Custom model integration (HuggingFace models)
  • Configurable processing options per document type

Installation

Basic Installation

# Standard installation
pip install docling

# Verify installation
python -c "import docling; print(docling.__version__)"

Platform Support

  • Operating Systems: macOS, Linux, Windows
  • Architectures: x86_64, arm64
  • Python: 3.9+ (Pydantic v2 requirement)

Dependencies

  • Core: Pydantic v2, PyMuPDF (PDF processing)
  • Optional: TensorFlow/PyTorch (for ML models), OpenCV (image processing)
  • Auto-Downloaded: ML models (layout analysis, table extraction) on first use

Offline/Air-Gapped Installation

# Prefetch models
docling-tools models download

# Or specify artifacts path
export DOCLING_ARTIFACTS_PATH=/path/to/models

# Download custom HuggingFace models
docling-tools download-hf-repo --repo-id <model_id>

Use Cases

1. Basic Document Conversion

from docling.document_converter import DocumentConverter

# Initialize converter
converter = DocumentConverter()

# Convert document
result = converter.convert("document.pdf")

# Export to Markdown
markdown_content = result.document.export_to_markdown()
print(markdown_content)

# Export to HTML
html_content = result.document.export_to_html()

# Export to JSON (lossless)
json_data = result.document.export_to_dict()

2. Advanced PDF Processing

from docling.document_converter import DocumentConverter
from docling.datamodel.pipeline_options import (
    PdfPipelineOptions,
    TableFormerMode
)

# Configure PDF processing
pipeline_options = PdfPipelineOptions()
pipeline_options.do_table_structure = True
pipeline_options.table_structure_options.mode = TableFormerMode.ACCURATE
pipeline_options.do_ocr = True

# Initialize converter with options
converter = DocumentConverter(
    pipeline_options=pipeline_options
)

# Convert with advanced features
result = converter.convert("complex_report.pdf")

# Access structured content
for table in result.document.tables:
    print(f"Table: {table.to_markdown()}")

for figure in result.document.pictures:
    print(f"Figure caption: {figure.caption}")

3. Batch Processing with Resource Limits

from docling.document_converter import DocumentConverter

# Configure resource constraints
converter = DocumentConverter(
    max_file_size=50_000_000,  # 50 MB limit
    max_num_pages=100           # First 100 pages only
)

# Process multiple documents
documents = ["doc1.pdf", "doc2.docx", "doc3.xlsx"]

for doc_path in documents:
    try:
        result = converter.convert(doc_path)
        output_path = doc_path.replace(".pdf", ".md")
        with open(output_path, "w") as f:
            f.write(result.document.export_to_markdown())
        print(f"✅ Converted: {doc_path}")
    except Exception as e:
        print(f"❌ Failed: {doc_path} - {e}")

4. LangChain Integration (RAG Pipeline)

from langchain_docling import DoclingLoader
from langchain_text_splitters import RecursiveCharacterTextSplitter
from langchain_openai import OpenAIEmbeddings
from langchain_community.vectorstores import FAISS

# Load documents with Docling
loader = DoclingLoader(
    file_path="technical_manual.pdf",
    export_type="markdown"  # or "json" for lossless
)
documents = loader.load()

# Split documents into chunks
text_splitter = RecursiveCharacterTextSplitter(
    chunk_size=1000,
    chunk_overlap=200
)
splits = text_splitter.split_documents(documents)

# Create vector store
embeddings = OpenAIEmbeddings()
vectorstore = FAISS.from_documents(splits, embeddings)

# Query the documents
retriever = vectorstore.as_retriever()
relevant_docs = retriever.get_relevant_documents("What is the installation process?")

for doc in relevant_docs:
    print(doc.page_content)

5. LlamaIndex Integration

from llama_index.readers.docling import DoclingReader
from llama_index.node_parser.docling import DoclingNodeParser
from llama_index.core import VectorStoreIndex

# Load documents with Docling Reader
reader = DoclingReader(export_type="json")  # Lossless serialization
documents = reader.load_data(file_path="research_paper.pdf")

# Parse into nodes
node_parser = DoclingNodeParser()
nodes = node_parser.get_nodes_from_documents(documents)

# Build index
index = VectorStoreIndex(nodes)

# Query
query_engine = index.as_query_engine()
response = query_engine.query("Summarize the methodology section")
print(response)

6. Custom Pipeline Configuration

from docling.document_converter import DocumentConverter
from docling.datamodel.pipeline_options import PdfPipelineOptions
from docling.backend.pdf_backend import PyPdfiumBackend
import os

# Configure threading (for performance)
os.environ["OMP_NUM_THREADS"] = "8"  # Use 8 CPU threads

# Custom pipeline options
pipeline_options = PdfPipelineOptions()
pipeline_options.do_cell_matching = True  # Enable table cell matching
pipeline_options.generate_page_images = True  # Extract page images
pipeline_options.generate_picture_images = True  # Extract figures

# Use specific backend
converter = DocumentConverter(
    allowed_formats=["pdf"],
    format_options={"pdf": PyPdfiumBackend}
)

# Convert with custom settings
result = converter.convert(
    "scientific_paper.pdf",
    pipeline_options=pipeline_options
)

# Save extracted images
for i, image in enumerate(result.document.pictures):
    image.save(f"figure_{i}.png")

7. Binary Stream Processing

from docling.document_converter import DocumentConverter, DocumentStream
from io import BytesIO

# Load PDF as binary stream
with open("document.pdf", "rb") as f:
    pdf_bytes = BytesIO(f.read())

# Create document stream
doc_stream = DocumentStream(
    name="document.pdf",
    stream=pdf_bytes
)

# Convert from stream
converter = DocumentConverter()
result = converter.convert(doc_stream)

markdown = result.document.export_to_markdown()

8. Remote Services (Cloud OCR)

from docling.document_converter import DocumentConverter
from docling.datamodel.pipeline_options import PdfPipelineOptions

# IMPORTANT: Explicit opt-in required for remote services
# Main purpose of Docling is local execution
pipeline_options = PdfPipelineOptions()
pipeline_options.enable_remote_services = True  # Explicit consent

# Configure cloud OCR (if needed)
converter = DocumentConverter(pipeline_options=pipeline_options)

# Process document (may use cloud services)
result = converter.convert("scanned_document.pdf")

Advanced Features

Table Extraction Modes

from docling.datamodel.pipeline_options import TableFormerMode

# FAST mode (faster processing)
pipeline_options.table_structure_options.mode = TableFormerMode.FAST

# ACCURATE mode (better quality)
pipeline_options.table_structure_options.mode = TableFormerMode.ACCURATE

Trade-offs:

  • FAST: ~2x faster, good for simple tables
  • ACCURATE: Higher precision, better for complex tables with merged cells

Output Format Customization

Markdown Export:

# With embedded images
markdown = result.document.export_to_markdown(image_mode="embedded")

# With image references
markdown = result.document.export_to_markdown(image_mode="referenced")

HTML Export:

# With custom CSS
html = result.document.export_to_html(
    include_styles=True,
    custom_css="body { font-family: Arial; }"
)

JSON Export (Lossless):

# Complete document structure
json_data = result.document.export_to_dict()

# Includes:
# - Full layout information
# - Reading order
# - Bounding boxes
# - Confidence scores
# - Metadata

Document Chunking Strategies

from docling.chunking import HybridChunker

# Configure chunker
chunker = HybridChunker(
    chunk_size=1000,        # Target chunk size
    chunk_overlap=200,      # Overlap between chunks
    respect_boundaries=True # Respect document structure
)

# Chunk document
chunks = chunker.chunk(result.document)

for i, chunk in enumerate(chunks):
    print(f"Chunk {i}:")
    print(chunk.text)
    print(f"Metadata: {chunk.metadata}")

Confidence Scores

# Access confidence scores for extracted content
for element in result.document.elements:
    if hasattr(element, 'confidence'):
        print(f"Element: {element.text[:50]}")
        print(f"Confidence: {element.confidence}")

MCP Server Integration

Docling provides a Model Context Protocol (MCP) server for integration with agentic applications like Claude Desktop.

MCP Server Setup

# Install MCP server
pip install docling-mcp-server

# Start server
docling-mcp-server --port 3000

MCP Configuration (Claude Desktop)

{
  "mcpServers": {
    "docling": {
      "command": "docling-mcp-server",
      "args": ["--port", "3000"],
      "env": {
        "DOCLING_ARTIFACTS_PATH": "/path/to/models"
      }
    }
  }
}

MCP Use Cases

  • Document Parsing Tool: Convert documents to structured format for AI agents
  • RAG Pipeline Integration: Extract and chunk documents for retrieval
  • Multi-Format Support: Handle various document types in agentic workflows

Performance Optimization

CPU Thread Control

# Set number of threads (default: 4)
export OMP_NUM_THREADS=8

# Or in Python
import os
os.environ["OMP_NUM_THREADS"] = "8"

Memory Management

# Process documents in batches to manage memory
def process_batch(file_paths, batch_size=10):
    converter = DocumentConverter()

    for i in range(0, len(file_paths), batch_size):
        batch = file_paths[i:i+batch_size]

        for file_path in batch:
            result = converter.convert(file_path)
            # Process result

        # Clear memory between batches
        import gc
        gc.collect()

Prefetching Models

# Download all models in advance
docling-tools models download

# Verify models
ls $HOME/.cache/docling/models

Supported Formats

Input Formats (12+)

FormatExtensionNotes
PDF.pdfAdvanced layout understanding, table extraction
Microsoft Word.docxOffice 2007+ (Open XML)
Excel.xlsxSpreadsheet data extraction
PowerPoint.pptxSlide content and structure
HTML.html, .xhtmlWeb page content
Markdown.mdPlain text markup
AsciiDoc.adoc, .asciidocTechnical documentation
CSV.csvTabular data
Images.png, .jpg, .tiff, .bmp, .webpOCR processing
USPTO XML.xmlPatent documents
JATS XML.xmlJournal articles
WebVTT.vttVideo subtitle files

Output Formats

FormatUse CaseLossless
MarkdownHuman-readable, AI-friendlyNo
HTMLWeb renderingNo
JSONComplete structure preservationYes
Plain TextSimple text extractionNo
DoctagsLayout-aware markupPartial

Common Workflows

1. PDF to Markdown for RAG

from docling.document_converter import DocumentConverter

converter = DocumentConverter()
result = converter.convert("whitepaper.pdf")

# Export to Markdown
markdown = result.document.export_to_markdown()

# Save for RAG ingestion
with open("whitepaper.md", "w") as f:
    f.write(markdown)

2. Extract Tables from Excel

from docling.document_converter import DocumentConverter

converter = DocumentConverter()
result = converter.convert("financial_report.xlsx")

# Extract all tables
for table in result.document.tables:
    print(table.to_markdown())
    # Or: table.to_dataframe() for pandas integration

3. Multi-Format Document Collection

from docling.document_converter import DocumentConverter
from pathlib import Path

converter = DocumentConverter()

# Process directory
input_dir = Path("documents/")
output_dir = Path("processed/")

for file_path in input_dir.glob("*"):
    if file_path.suffix in [".pdf", ".docx", ".xlsx", ".pptx"]:
        result = converter.convert(str(file_path))

        output_file = output_dir / f"{file_path.stem}.md"
        with open(output_file, "w") as f:
            f.write(result.document.export_to_markdown())

Troubleshooting

Model Download Issues

# Manually download models
docling-tools models download

# Check model cache
ls ~/.cache/docling/models

# Set custom cache location
export DOCLING_ARTIFACTS_PATH=/custom/path

Memory Errors with Large PDFs

# Limit pages processed
converter = DocumentConverter(max_num_pages=50)

# Or limit file size
converter = DocumentConverter(max_file_size=20_000_000)  # 20 MB

OCR Not Working

# Ensure OCR is enabled
from docling.datamodel.pipeline_options import PdfPipelineOptions

pipeline_options = PdfPipelineOptions()
pipeline_options.do_ocr = True

converter = DocumentConverter(pipeline_options=pipeline_options)

Table Extraction Failures

# Try ACCURATE mode
pipeline_options.table_structure_options.mode = TableFormerMode.ACCURATE

# Enable cell matching
pipeline_options.do_cell_matching = True

Security & Privacy

Local Execution (Default)

  • No Remote Calls: All processing happens locally by default
  • Sensitive Data Safe: No data transmitted to external services
  • Offline Capable: Works in air-gapped environments

Remote Services (Opt-In)

# MUST explicitly enable
pipeline_options.enable_remote_services = True

Only use remote services when:

  • Processing non-sensitive documents
  • Need cloud OCR for scanned documents
  • Using vision model APIs

Community & Resources

Official Links

Key Statistics

  • Stars: 48,400
  • Forks: 3,400
  • Contributors: 159
  • Latest Release: v2.66.0 (December 2025)
  • License: MIT

Integration Packages

  • LangChain: langchain-docling
  • LlamaIndex: llama-index-readers-docling, llama-index-node-parser-docling
  • MCP Server: docling-mcp-server

Learning Resources

When to Use This Skill

Use the Docling skill when:

  • ✅ Processing PDFs with complex layouts (tables, figures, multi-column)
  • ✅ Building RAG applications that need structured document understanding
  • ✅ Extracting data from multiple document formats (PDF, DOCX, XLSX, etc.)
  • ✅ Need local/offline document processing (sensitive data, air-gapped)
  • ✅ Integrating with LangChain, LlamaIndex, or AI frameworks
  • ✅ Converting documents to Markdown for LLM consumption
  • ✅ Extracting tables, figures, and code blocks programmatically
  • ✅ Building document processing pipelines for AI applications
  • ✅ Need MCP server for agentic document workflows
  • ✅ OCR for scanned documents or images

Related Technologies

  • PyMuPDF: PDF processing library (used by Docling)
  • Pydantic v2: Data validation (Docling Document structure)
  • LangChain: AI application framework (official integration)
  • LlamaIndex: Data framework for LLM applications (official integration)
  • Model Context Protocol (MCP): Tool integration standard (Docling MCP server)
  • TableFormer: Table extraction model (integrated)
  • Tesseract OCR: Open-source OCR engine (alternative)

Skill Type: Document Processing Library Complexity Level: Intermediate to Advanced Maintenance Status: ✅ Active (v2.66.0, December 2025) Community Health: ✅ Excellent (48.4k stars, 159 contributors)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Local Agent

90.95%
按下载量换算146

安全审计

暂无安全审计结果可展示。

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills