What is CrewDoclingSource?
CrewDoclingSource delegates parsing to Docling so tables, side-by-side columns, and footnotes stay associated with the text they annotate instead of being shredded into random token order. That structural fidelity matters for 10-Ks, scientific PDFs, and insurance PDF forms where a single wrong row alignment changes compliance answers. Expect heavier CPU and dependency requirements than PDFKnowledgeSource — treat this as the precision path, not the quick-start path.
You can pass a single path or a list of paths; batching amortizes model load costs when you rebuild indexes nightly. Retrieval still behaves like other knowledge sources: agents query embeddings scoped to the source, and chunk boundaries approximate Docling segments rather than naive page splits.
When scans are noisy, pair Docling output with human QA or OCR confidence thresholds. Docling improves layout, but it cannot invent pixels that were never captured — extremely low DPI scans may still produce empty tables that look authoritative once embedded.
When to Use
PDFs with tables, multi-column layouts, or mixed media.
Use Cases
- • Academic papers
- • Financial reports
- • Insurance forms
Key Features
- ✓ Layout-aware chunking
- ✓ Table extraction
When NOT to Use
Simple text PDFs — PDFKnowledgeSource is lighter.
Notes
Install footprint
Docling pulls additional native dependencies. Bake them into your Docker image and pin versions — silent upgrades are a common source of CI-only failures.
Latency during ingestion
First-time embedding of large PDFs can take minutes. Run ingestion offline or in a worker queue so HTTP kickoff paths do not block on parsing.
Table hallucination guardrails
Even perfect layout extraction does not guarantee numeric correctness. Ask agents to quote row headers and require Tool or calculator verification for final figures.
When PDFKnowledgeSource suffices
Linear prose PDFs without tables rarely justify Docling overhead. Benchmark retrieval quality before defaulting to CrewDoclingSource everywhere.
Import
from crewai.knowledge.source.crew_docling_source import CrewDoclingSource
Key Parameters
| Parameter | Type | Default | Purpose |
|---|---|---|---|
| file_path | str | list[str] | — | One or more document paths. |
Code Examples
Single complex filing
from crewai.knowledge.source.crew_docling_source import CrewDoclingSource
src = CrewDoclingSource(file_path='filings/acme-10k.pdf')
Batch multiple PDFs
from crewai.knowledge.source.crew_docling_source import CrewDoclingSource
src = CrewDoclingSource(file_path=['risk/q1.pdf', 'risk/q2.pdf', 'risk/q3.pdf'])
Crew-level Docling + analyst agent
from crewai import Agent, Task, Crew, Process
from crewai.knowledge.source.crew_docling_source import CrewDoclingSource
src = CrewDoclingSource(file_path=['reports/model-risk.pdf'])
analyst = Agent(role='Risk analyst', goal='Answer from the PDF', backstory='Cite section titles.')
Crew(agents=[analyst], tasks=[Task(description='Summarize model validation findings', expected_output='Bullets', agent=analyst)], knowledge_sources=[src], process=Process.sequential).kickoff()
Common Mistakes
❌ Feeding password-protected PDFs without unlocking
✅ Decrypt upstream or agents will embed empty text silently.
CrewDoclingSource FAQ
What is CrewDoclingSource in CrewAI?
Layout-aware document loader for complex PDFs (tables, multi-column, scans). CrewDoclingSource delegates parsing to Docling so tables, side-by-side columns, and footnotes stay associated with the text they annotate instead of being shredded into random token order. That structural fidelity matters for 10-Ks, scientific PDFs, and insurance PDF forms where a single wrong row alignment changes compliance answers. Expect heavier CPU and dependency requirements than PDFKnowledgeSource — treat this as the precision path, not the quick-start path. You can p…
Which package defines the CrewAI class CrewDoclingSource?
DevShelfHub maps CrewDoclingSource to Python module crewai.knowledge.source (package path crewai.knowledge.source in this reference). Pin your installed crewai version and match imports to the snippet on this page.
When should I use CrewDoclingSource?
PDFs with tables, multi-column layouts, or mixed media.
When should I avoid using CrewDoclingSource?
Simple text PDFs — PDFKnowledgeSource is lighter.
How do I import CrewDoclingSource in Python?
from crewai.knowledge.source.crew_docling_source import CrewDoclingSource
Where can I explore more CrewAI API reference pages?
Open the CrewAI API reference index on DevShelfHub to search 58 classes, 30 methods, and 16 decorators, each with runnable examples, parameters, common mistakes, and cross-links.