docling-project /docling-graph

Transform unstructured documents into validated, rich and queryable knowledge graphs.

★ 995⑂ 108👁 8⑃ 139● 7▤ 30
PythonMITCreated 2025-11-17
下载:v1.9.2v1.9.2 ↓1.9.22026-11-08
+1
日增长
995
stars
108
forks
8
watchers
139
prs
7
issues
30
releases

README

Docling Graph



















Docling-Graph turns documents into validated Pydantic objects, then builds a directed knowledge graph with explicit semantic relationships.

This transformation enables high-precision use cases in chemistry, finance, and legal domains, where AI must capture exact entity connections (compounds and reactions, instruments and dependencies, properties and measurements) rather than rely on approximate text embeddings.

This toolkit supports two extraction paths: local VLM extraction via Docling, and LLM-based extraction routed through LiteLLM for local runtimes (vLLM, Ollama) and API providers (OpenAI, Gemini, IBM watsonx, Mistral and more), all orchestrated through a flexible, config-driven pipeline.



 Key Capabilities

- ✍🏻 Input formats: Docling’s supported inputs: PDF, images, DocLang, markdown, Office and more.

- 🧠 Extraction: LLM or VLM backends, with chunking and processing modes.

- 💎 Graphs: Pydantic to NetworkX directed graphs with stable IDs, edge and provenance metadata.

- 📦 Export: CSV, Cypher, and other KG-friendly formats.

- 🔍 Visualization: Interactive HTML and Markdown reports.

- 🐛 Trace capture: Debug exports for extraction and fallback diagnostics.

 Latest Changes

- 🔗 Graph fusion: Merge multiple knowledge graphs into one. Fully audited, deterministic, and no LLM calls.

- 🧩 Template generation: Generate Pydantic templates from example documents or ontologies (OWL/RDFS...).

- 🦆 DocLang support: Parse .dclg/.dclx inputs, and optionally serialize document as DocLang for the LLM.

- 📍 Data grounding: Deterministic provenance ledger with bounding-box geometry and no extra LLM calls.

- ✨ Dense extraction: Advanced skeleton-then-flesh extraction mode for complex documents.

- 🚀 Docling Serve support: Offload document conversion to a remote docling-serve instance.


 Quick Start

 Requirements

- Python 3.10 or higher

 Installation

bash
pip install docling-graph


This installs the core package with LiteLLM for remote and local LLM providers.

VLM backend support requires the vlm extra:
bash
pip install "docling-graph[vlm]


For detailed installation instructions (including optional extras and GPU setup), see Installation Guide.

 API Key Setup (Remote Inference)

Copy .env.example to .env and fill in the values for the provider(s) you use:

bash
cp .env.example .env


See API Keys Setup for provider-specific instructions (including Amazon Bedrock's AWS credential chain).

 Basic Usage

 CLI

bash
 Initialize configuration
docling-graph init

 Convert document from URL (each line except the last must end with \)
docling-graph convert "https://arxiv.org/pdf/2207.02720" \
    --template "docs.examples.templates.rheology_research.ScholarlyRheologyPaper" \
    --processing-mode "many-to-one" \
    --extraction-contract "dense" \
    --debug

 Visualize results
docling-graph inspect outputs


 Python API - Default Behavior

python
from docling_graph import run_pipeline, PipelineContext
from docs.exam

Top issues

Latest release

v1.9.2 v1.9.2 2026-11-08
Bug Fixes

 Identity Deduplication

- Keep non-Latin letters in identity dedup keys (b15de72)

Thanks to @RaphaelFakhri for the report and fix.

Snapshot: 2026-11-27T22:26:53Z · Data license Apache-2.0 · JSON