# Repository Briefing: docling-project/docling-graph
> Source: https://repoforai.com/repo/docling-project/docling-graph (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/docling-project/docling-graph
- **Category**: RAG, Data & Memory (知识库 / 爬虫 / 记忆层)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: A+ (91/100 · Maintenance 35/35 · Adoption 16/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v1.10.0 (2026-12-03) — https://github.com/docling-project/docling-graph/releases
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: CLI, Local AI, API
- **Momentum**: 1,005 ★ total (+2 24h / +11 7d) · 109 forks
- **Topics**: `ai`, `convert`, `docling`, `document-processing`, `knowledge-graph`
- **When to Use**: Best for: Document ingestion in legal or finance workflows where contracts, parties, instruments, and obligations must become typed relationships that reviewers can trace to the source. Skip if: Passage retrieval already meets your needs, you cannot maintain an extraction schema, or you need a turnkey graph database and query service.

## Overview
```text
### Architecture & 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`.
```

## Key Capabilities
```text
- Schema and graph mapping: Pydantic templates define extracted fields, while `graph_id_fields` and `edge()` specify identity fields and relationship labels.
- Inference backends: Docling handles local VLM extraction; LiteLLM routes LLM extraction to local runtimes or hosted providers.
- Traceability: Standard `__provenance__` links nodes to source chunks and pages without an extra LLM call.
- Graph merging: Deterministic, auditable merges require no further inference; batched Cypher export supports downstream loading.
- Template tooling: Generate editable SPEC YAML from sample documents, or compile templates from supported ontologies and schemas without an LLM.
- Runtime footprint: v1.10.0 keeps PyTorch out of the base install; local PDF and image conversion uses the `docling` extra.
```

## Quick Start / Clone
```bash
pip install docling-graph
```
