Agent skill
docling
Turn ANY File (PDF, DOCX, Audio) into LLM-Knowledge in SECONDS using Docling.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/docling-leandrolarrosa-gentlemonster
SKILL.md
Docling - Universal Document Converter
[!IMPORTANT] Docling is the specialized tool for the "Data Curation" step of RAG (Retrieval Augmented Generation). It turns complex, messy file formats into clean, structured Markdown that LLMs love.
1. Core Capabilities
- Universal Parsing: Handles PDF, DOCX, PPTX, Images, HTML, AsciiDoc, Markdown, and Audio (via Whisper).
- Layout Awareness: Understands tables, headers, footers, page numbers, and reading order in PDFs (OCR included).
- Hybrid Chunking: Smart chunking strategy that uses embedding models to keep semantically related text together, rather than just splitting by character count.
- Export to Markdown: The gold standard format for LLM context.
2. Quick Start
Installation
pip install docling
# Optional: Audio support
pip install ffmpeg-python openai-whisper
Basic Extraction (PDF to Markdown)
from docling.document_converter import DocumentConverter
source = "path/to/document.pdf" # Can be URL or local path
converter = DocumentConverter()
result = converter.convert(source)
# Export to Markdown
markdown_output = result.document.export_to_markdown()
print(markdown_output)
3. Advanced Usage: Hybrid Chunking
This is the killer feature for RAG. Don't just split by characters; split by meaning.
from docling.document_converter import DocumentConverter
from docling.chunking import HybridChunker
doc_converter = DocumentConverter()
conv_res = doc_converter.convert("complex_report.pdf")
doc = conv_res.document
# Initialize Hybrid Chunker
chunker = HybridChunker(
tokenizer="intfloat/multilingual-e5-base" # Or other embedding model tokenizer
)
# Generate Chunks
chunk_iter = chunker.chunk(doc)
chunks = list(chunk_iter)
for chunk in chunks:
print(f"Chunk Text:\n{chunk.text}\n---\n")
# Store 'chunk.vector' in your DB if using embedded creation here
4. Working with Audio (Transcription)
Docling streamlines the audio-to-text pipeline for RAG.
# Requires: pip install openai-whisper
from docling.document_converter import DocumentConverter
converter = DocumentConverter()
result = converter.convert("meeting_recording.mp3")
# Output includes timestamps and speaker separation if supported
print(result.document.export_to_markdown())
5. RAG Integration Pattern
- Ingest: Use
DocumentConverterto read files from your source directory. - Process: Convert every file (PDF, Word, Audio) into a uniform
DoclingDocument. - Chunk: Apply
HybridChunkerto split documents intelligently. - Embed & Store: Send chunks to your Vector DB (PGVector, Pinecone, etc.).
- Retrieve: Query your DB for relevant chunks and feed them to the LLM.
Resources
- Docling GitHub & Docs
- Recommended for robust Parsing vs. "Crawl4AI" for Web Parsing.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?