Title Trust vs flexibility Query → Cypher Agentic pipeline Ontologies Expansion Results
ICDAR 2026 · Historical Document Analysis · Esposalles

Robust Interpretation of
Historical Documents in
Knowledge Graphs

An agentic GraphRAG that turns a question into a graph query — then survives the noise of handwritten-text recognition by expanding fragile literals through word spotting.

Authors
Nicolau · Molina · Ramos Terrades · Lladós
Idea
NL → Cypher → expand → execute
agentic GraphRAG word-spotting expansion HTR-robust auditable retrieval
Scroll
The Tension

Flexible LLMs hallucinate.
Grounded graphs break on noise.

Archives need accountability — a guarantee that a fact is present or absent. LLMs give flexibility but invent. Knowledge graphs give grounding but assume clean text. Historical handwriting gives neither.

A plain RAG retrieves plausible passages and lets a generative model phrase an answer — convenient, but prone to hallucination and blind to anything outside its retrieved window. A knowledge graph is the opposite: every entity and relation is explicit and queryable. The catch is construction: when the graph is built from handwritten documents, recognition errors aren't rare glitches — they are a consistent characteristic of the data, splitting one entity into many misspelled ghosts and producing endless false negatives.

exact match  {name: 'girona'}  misses  gerona · gran · hieronma  — the same place, recognised three wrong ways.

The paper's answer is a semi-symbolic agent: keep the LLM's generalization for turning questions into queries, but ground execution in a graph — and, at runtime, relax the brittle string literals (names, places) into the set of variants word spotting actually found on the page.

The interleaved collaboration between word spotting and code generation lets the agent build queries robust to misinterpretation and hallucination, while still using approximate search where noise would otherwise hinder precise retrieval.
The Idea · Fig. 1

From a sentence to a verified record

Walk the running example: a natural-language request becomes a Cypher query whose fragile literals are marked, expanded with their word-spotting variants, then executed on the graph. Step through it — the graph on the right responds.

STEP 1
Query
STEP 2
Cypher
STEP 3
Expand
STEP 4
Execute
"Find me a carpenter who married a fisherman in Sabadell."
The Architecture · Fig. 2

An agentic loop with a safety net

The query is grounded in the graph's ontology, translated to Cypher, validated and repaired in a correction cycle, expanded by word spotting, executed, and only then phrased into an answer. Click any node; press run to watch it flow.

click a node to inspect
LEGEND
A property graph models entities (individuals, marriages, places, records). Every step is inspectable — the opposite of an opaque end-to-end model. Click a node above to read its role.
Knowledge Graph Ontologies · Fig. 3

Property graph, or RDF?

Two ways to model the same Esposalles marriage record. The property graph is compact; the RDF version explodes names, surnames, and occupations into their own nodes — more nodes, but far more expressive for complex, multi-hop queries. Toggle between them.

compact
Property Graph
expressive
RDF Graph

The results bear this out: RDF wins 7 of 9 word-spotting comparisons. The extra structure isn't a burden — names become first-class, independently queryable nodes, which is exactly what multi-hop and relational questions need.

Interactive · The Expansion Operator

One literal, all its ghosts

When the LLM marks a literal for approximate matching, word spotting returns its variants and the query is rewritten as a case-insensitive regex over the disjunction: l ↦ regex(v₁ ∨ … ∨ vₖ). Type a name or place and watch it expand.

literal marked for expansion girona
word-spotting variants
expanded Cypher literal
Try the paper's cases: girona, sabadell, carpenter, colomer — or any word, and orthographic OCR variants are generated for it.

This is the noise filter at query time. Exact matching for girona returns 5 individuals; PHOC expansion to (girona|gerona|gran|hieronma) recovers all 9 — the difference between a confidently wrong count and the right one.

Results · Esposalles-DocVQA (100 curated questions)

GraphRAG climbs, word spotting lifts

A new evaluation set of 100 hand-curated questions, scored by both a deterministic entity metric (NERO-ANLS) and an LLM judge. RAG hits a ceiling; GraphRAG soars with transcription quality; word spotting helps everywhere — most of all the small models.

.876
best NERO-ANLS · PHOC RDF-GT (Qwen3)
~.50
RAG ceiling · barely surpassed
7/9
RDF beats Property (word-spotting)

Performance vs. HTR accuracy (approx. of Fig. 4b). RAG stays flat — resilient but capped. GraphRAG rises steeply and word-spotting variants (PHOC, MPNet) shift the whole curve up, especially at low legibility.

What the 100 questions ask — designed to stress structured reasoning, not just lookup.

Table 2 — back-end LLM matters, to a point. Bold = best per metric.

SystemQwen3-VL (32B)GPT-5.1Phi-4 (15B)
NERO-ANLS
RAG · GT transcription.435.469.418
GraphRAG · RDF-GT.813.865.638
+ PHOC · RDF-GT.876.817.646
+ MPNet · RDF-HTR1 (noisy).690.673.671

Code inference scales from Phi-4 → Qwen3, then plateaus: Qwen3 ≈ GPT-5.1 beyond ~32B. Word spotting's biggest lift is for the smallest model (Phi-4: .53 → .631 on noisy HTR1).

Qualitative — why it matters.

✗ without expansion
How many individuals lived in Girona?
Exact match on "girona" misses variant spellings.
→ "5 individuals lived in Girona."  (wrong)
✓ with PHOC expansion
How many individuals lived in Girona?
Regex (?i)^(girona|gerona|gran|hieronma)$ captures all mis-transcriptions.
→ "9 individuals lived in Girona."  (correct)
✗ RAG · partial view
Where do individuals with the surname Colomer live?
Retrieves only a limited sample of documents.
→ "mainly in Bara"  (incomplete)
✓ GraphRAG · full coverage
Where do individuals with the surname Colomer live?
Queries all nodes holistically.
→ Barcelona, Arenys, Pierola, Viladecans
Where it lands

Traceable, holistic,
noise-resilient retrieval

01
First GraphRAG for noisy HKGs
Query execution is augmented at runtime by word-spotting literal expansion — built for graphs where recognition error is the norm, not the exception.
02
Word spotting always helps
Contrary to the initial hypothesis, it doesn't make HTR irrelevant — it consistently lifts every system, most of all the smaller models. PHOC beats MPNet on character noise.
03
RDF over property graphs
Independently queryable name/place nodes win 7/9 comparisons — modeling complexity becomes structured signal, not overhead.
04
Holistic & auditable
Graph + code execution answers statistical and multi-hop questions RAG can't, and every variant cluster is traceable — trustworthy access for the archive.

A new 100-question Esposalles-DocVQA benchmark, a recall-oriented NERO-ANLS metric, and a runtime expansion operator: agentic graph workflows look like a promising, accountable direction for reading the archive.