docling-project/docling-graph
A Pydantic pipeline that turns documents into traceable knowledge graphs
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Docling Graph is a Python ingestion pipeline for knowledge graphs, not a database or retrieval server. It converts documents locally or through docling-serve when needed, runs extraction against a Pydantic template, and maps validated objects to a directed NetworkX graph. Conversion and extraction are separately configurable: local VLM extraction uses Docling, while the LLM path uses LiteLLM to route inference.
The template is the main extension point. It defines what to extract and how to represent it in the graph: is_entity marks entities, graph_id_fields lets authors choose identity fields, and edge() names relationships. The Python entry point, run_pipeline(config), returns a PipelineContext with the graph, extracted models, and metadata. The CLI separates conversion, inspection, and merge into distinct operations.
Key Capabilities & Differentiators
The pipeline accepts DoclingDocument JSON, DocLang, Markdown, plain text, HTML, and Word, PowerPoint, and Excel files. PDF and image conversion needs the local Docling stack or docling-serve. The LLM path supports local targets such as vLLM and Ollama and hosted providers including OpenAI, Gemini, IBM watsonx, and Mistral. Chunking and dense extraction address complex inputs; dense fill recovery can preserve failed instances for recovery and repair parent-child links.
Standard node provenance records the source chunk and page without extra inference. Graphs from separate runs can be merged deterministically and audited without further LLM calls, then exported as CSV or Cypher. For schema authoring, template from-docs has the model propose structured definitions rather than Python code. A deterministic renderer writes the module and an editable SPEC YAML, and --trial-run runs an extraction on the first sample to help assess the template. Supported ontologies and schemas can also be compiled without an LLM.
Trade-offs & Limitations
Compared with a vector-only RAG pipeline, Docling Graph makes named relationships and entity identities explicit, which is useful for queries that cross document boundaries. The cost is schema design and ongoing review of identity fields, extraction errors, and duplicates. Pydantic validation enforces structure, not factual accuracy. Provenance helps reviewers find the source, but deterministic graph construction and merging do not make the upstream model extraction deterministic.
Compared with using Docling for conversion alone, this adds schema-bound extraction and graph assembly, along with model execution and more failure modes to monitor. Fully local processing keeps documents within your deployment boundary when both stages are local, but shifts model sizing and operations to your team. Hosted inference reduces local model overhead, but adds provider credentials, data-handling decisions, and usage costs. NetworkX and the exporters produce graph artifacts; plan downstream storage and serving separately if you need persistent queries.
Hardware & Deployment Guide
Use Python 3.10 or newer. pip install docling-graph suits supported inputs that do not need the local Docling conversion stack, or deployments that delegate conversion to docling-serve. Install docling-graph[docling] for local PDF/image conversion and use the vlm extra to enable VLM support. With the CLI, docling-graph init initializes configuration, --docling-serve-url selects a conversion service, and --debug writes intermediate artifacts. Hosted inference requires provider credentials and is independent of where conversion runs.
The v1.10.0 packaging split removes PyTorch from the default install. For fully local deployment, provision the chosen conversion and inference models and test peak RAM and, where applicable, GPU VRAM at representative page sizes and concurrency. The v1.10.0 identity change affects identifiers with multiple digit groups, so compare regenerated IDs against stored graphs before migration. v1.9.2 fixed deduplication keys for non-Latin letters, while v1.9.1 made Cypher output typed and idempotent via MERGE.
graph_id_fields and edge() specify identity fields and relationship labels.__provenance__ links nodes to source chunks and pages without an extra LLM call.docling extra.Document ingestion in legal or finance workflows where contracts, parties, instruments, and obligations must become typed relationships that reviewers can trace to the source.
Passage retrieval already meets your needs, you cannot maintain an extraction schema, or you need a turnkey graph database and query service.
Quick Start & Installation
pip install docling-graphComparison vs. Top RAG, Data & Memory Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| docling-graph ★ | 1k | +11 | Python | MIT | A Pydantic pipeline that turns documents into traceable knowledge graphs |
| LightRAG | 41k | +110 | Python | MIT | Graph-backed RAG for cross-document retrieval and multimodal indexing |
| docling | 71.4k | +285 | Python | MIT | Local-first document parser for structure-aware RAG ingestion |
| cognee | 33.8k | +174 | Python | Apache-2.0 | Graph and vector retrieval for persistent agent memory across sessions |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/docling-project/docling-graph.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about docling-graph
How do I integrate Docling Graph into an existing ingestion pipeline?
run_pipeline(config) and read context.knowledge_graph, context.extracted_models, and context.graph_metadata. The Python API returns these in memory by default without writing files. Use CSV or Cypher exports when a separate process or graph database owns ingestion.Do I need a GPU, and how should I size a worker?
Can I self-host it for commercial use with confidential documents?
When should I choose it over plain Docling, vector retrieval, or a graph database?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy