RAG Framework Connectors#
Docling ships official integration packages for three RAG ecosystems: LangChain, LlamaIndex, and Open WebUI. Each connector exposes Docling's document parsing and chunking pipeline within the host framework's abstractions, so engineers can swap in Docling without changing the rest of their retrieval stack.
The Docling integration stubs live in docs/integrations/ and point out to the full documentation maintained by each framework.
LangChain — langchain-docling#
Package: langchain-docling · GitHub: docling-project/docling-langchain · Official docs: python.langchain.com/docs/integrations/providers/docling
Install with:
pip install langchain-docling
The integration exposes one primary class, DoclingLoader , which handles conversion and chunking in a single call and returns standard LangChain Document objects.
Two export modes — choose at construction time :
| Mode | Description | When to use |
|---|---|---|
ExportType.DOC_CHUNKS | One Document per Docling chunk; each carries metadata["dl_meta"] with full DocMeta provenance (page, bbox, headings) | Recommended — document-native grounding for citation |
ExportType.MARKDOWN | One Document per input file; split externally (e.g. MarkdownHeaderTextSplitter) | Custom splitting logic required |
from langchain_docling import DoclingLoader
from langchain_docling.loader import ExportType
For a full RAG pipeline example, see docs/examples/rag_langchain.ipynb.
LlamaIndex — llama-index-readers-docling + llama-index-node-parser-docling#
Official docs: LlamaIndex step-by-step guide
Install with:
pip install llama-index-readers-docling llama-index-node-parser-docling
The integration is split into two cooperating components :
| Component | Class | Role |
|---|---|---|
llama-index-readers-docling | DoclingReader | Converts documents → LlamaIndex Document objects |
llama-index-node-parser-docling | DoclingNodeParser | Parses Docling-format Document objects → LlamaIndex Node objects (chunks for embedding) |
from llama_index.readers.docling import DoclingReader
from llama_index.node_parser.docling import DoclingNodeParser
Two export paths :
- Markdown (
DoclingReader()) — simple, lossy. Each document's.textis Markdown. Works withoutDoclingNodeParser. - JSON + NodeParser (
DoclingReader(export_type=DoclingReader.ExportType.JSON)+DoclingNodeParser()) — lossless; nodes carrypage_no,bbox, headings, and other Docling metadata. Recommended for rich RAG metadata.
Component references: DoclingReader PyPI · DoclingNodeParser PyPI
Open WebUI — Plugin via docling-serve#
Official docs: docs.openwebui.com/features/rag/document-extraction/docling
Unlike the Python-library connectors above, Open WebUI delegates document extraction to a running docling-serve instance over HTTP . Configure it in Admin Panel → Documents → Content Extraction Engine.
Three environment keys drive the integration :
| Key | Purpose |
|---|---|
DOCLING_SERVER_URL | Base URL of the docling-serve instance (e.g. http://docling-serve:5001) |
DOCLING_API_KEY | Optional API key for authenticated deployments |
DOCLING_PARAMS | JSON dict of conversion options forwarded to docling-serve |
Open WebUI uses the async conversion path (/v1/convert/source/async) internally . Key gotcha: use ocr_preset (not the deprecated ocr_engine) in DOCLING_PARAMS. For Tesseract, ocr_lang uses + as separator (e.g. "eng+deu"), not an array.
For version-specific issues (e.g. the v1.25.0 rocm72 regression) and tenant-isolation 404s, see the Open WebUI Integration KB article.
Choosing the Right Connector#
| Scenario | Recommended connector |
|---|---|
| Already using LangChain | langchain-docling with DOC_CHUNKS |
| Already using LlamaIndex | llama-index-readers-docling + llama-index-node-parser-docling, JSON mode |
| Open WebUI deployment | docling-serve plugin with DOCLING_SERVER_URL |
| No framework / custom stack | Use DocumentConverter + HybridChunker directly; see the PDF-to-RAG Pipeline KB article |
Both LangChain and LlamaIndex integrations pass documents through Docling's HybridChunker under the hood — the tokenizer used for chunking must match the embedding model's tokenizer to avoid token-boundary mismatches .